GPT-4o sometimes generates tool call names with incorrect prefixes (e.g., "functions.", "functions/") that do not match the OpenAI API's expected regex pattern ('^[a-zA-Z0-9_-]+$'). This leads to 400 errors when the response is sent back as part of chat history. The user requests that the API itself enforce correct tool call naming to prevent these issues and improve developer experience.
sometimes i find gpt-4o avoids proper tool call names, and will instead - prefix with “functions.“, “functions/“, “/”, or similar - just write “functions” and describe what it’s doing in a comment within the args what’s weird is, these don’t always match the regex allowed by the OpenAI API, so if you send the response back as part of chat history, you’ll get a 400: “Expected a string that matches the pattern ‘^[a-zA-Z0-9_-]+$’.” not hard to validate client-side, but seems like something that could be enforced within the API itself?