[Feature]: Support broader range on characters in function name
The Feature
Currently tool function names should contain a-z, A-Z, 0-9, underscores and dashes, with a maximum length of 64 characters.
While openai models do support broader range. For example it is possible to use Ä Ö Ü ß.
Please support the same function tools limitation as openai.
Motivation, pitch
I have configurable list of services for the user, that translates to the list of functions. User creates a new functions and specify their name+description. In their own language (e.g. German).
For LLM better understand when this function should run - it is good to have meaningful name, and stick to original user's name, which can be in different language.
Twitter / LinkedIn details
No response
what is needed to support this? I don't think we set any requirements for this @zshimanchik
Here is an example of the issue: function name is get_current_wäther with a German ä:
tools = [
{
"type": "function",
"function": {
"name": "get_current_wäther",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location"],
},
},
}
]
This results in an error from LiteLLM. In OpenAI the function name works without a problem.
Error occurred: OpenAIException - Error code: 400 - {'error': {'message': "'get_current_wäther' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'tools.0.function.name'", 'type': 'invalid_request_error', 'param': None, 'code': None}}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.