We don’t get a limit given to us in API reference specification, except for an array of a maximum of 128 functions, and a limit of the function name.
Your further investigation will provide insight. If rejected by the API endpoint, it is probably based on characters and not tokens.
“name”: {
“type”: “string”,
“description”: “The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.”
From my exploring the Azure REST API specs for 2023-12-01-preview, we do get other insights.
“seed”: {
“type”: “integer”,
“minimum”: -9223372036854775808,
“maximum”: 9223372036854775807,
And Azure extensions usurping OpenAI API capabilities: The ability to receive a vision grounding (bounding boxes locating items), or even explicitly requesting OCR.
Hi @andersskog@_j
I got the same error when put a long description.
I tested it a bit–try to make description a bit longer and shorter. Then find the limitation is 1027 characters including space. You can try a bit. If the description is longer than 1027 characters, you can repro this error.
Here is the structure of my request:
Blockquote
{
“max_tokens”: 10000,
“temperature”: 0.0,
“presence_penalty”: 0.0,
“frequency_penalty”: 0.0,
“messages”: [
{
“role”: “system”,
“content”: “xxxxxxxxxxxxxxxx”
},
{
“role”: “user”,
“content”: “xxxxxxxxxxxxxxxx”
}
],
“functions”: [
{
// this is a short description function
“name”: “function1”,
“description”: “xxxxxxxxxxx”,
“parameters”: {
“type”: “object”,
“properties”: {
“source_input”: {
“type”: “string”,
“description”: “xxxx”
}
}
}
},
{
// this is the function with the long description
“name”: “function2”,
“description”: “xxxxxxLONG-DESCRIPTIONxxxxxxx”,
“parameters”: {
“type”: “object”,
“properties”: {
“results”: {
“type”: “array”,
“description”: “xxxxxx”,
…
…
…
},
“required”: [
“xxx”
]
}
}
},
“required”: [
“xxx”
]
}
}
],
“function_call”: “auto”
}
You can also diversify the description: put the parts that are appropriate to the function call parameters themselves as descriptions of the parameter properties.
Anyone found any workaround (except shortening description or moving things around like parameters, …)
This “bug” (I don’t believe this was intended as design) is particularly annoying when using also other frameworks (LangChain, Llama Index) where we can’t control where something goes where)