Any issue with gpt-4o model recently relating to tool calls?

i noticed some inconsistency in the tool call recently,

{
        "type": "function",
        "function": {
            "name": "verify_user",
            "description": "requires user to input their account number",
            "parameters": {
                "type": "object",
                "properties": {
                    "account_number": {
                        "description": "the user's account number",
                        "type": "string"
                    }
                },
                "required": [
                    "account_number"
                ]
            }
        }

until yesterday, the model always ask the user for their account number, now, it assume that it already know the account number and filling a default either:

function args {‘account_number’: ‘xxxxxx’}
or
function args {‘account_number’: ‘123456’}

i tried gpt-4-turbo to test and seems to be working fine

This function call in Chat Completion or Assistant APIs? If you’re using Chat Completion, use this is System Instruction:

Don’t make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous.

If you are using Assistant APIs, put this above in ‘additional instruction’ of your ‘run’.

Let me know if this doesn’t fix your issue. We can try more things.

Yes definitely, especially gpt-4o-mini with Structured Outputs with Assistants. Increasing degradation over the past week. 4o seems more stable.

I have the same issue, I assume. When i started feeding to the chat model some data, it understands it, but runs the tool several times and then stops due to large number of agent execution. It fetches ok though from the chat itself. I am using langchain. But when i changed the model from o to turbo - all worked. The 4o still is handling prompts ok and provides the desired more less output via promps, but fails with functions. I think it is a bug on OpenAI site, they claim to have 4o as the more stable and the latest, but in reality turbo works better and way more stable. This issue I have seen before from time to time, but from 30.08 it is consistent and even forced me to re-write the code today 2 hours before presentation. Is there any intentional degradation of the model?

1 Like

Uodate. It started working with august version of gpt-4o. it would be nice for OpenAI to notify about the changes of current gpt-4o version

The error you’re encountering likely results from an issue in your implementation where the function declaration is either being misused or incorrectly formatted in the context where it’s being called or defined. Here’s a breakdown of what might be causing the problem and how to fix it:

Potential Issues:

  1. Misplacement in the Code: The function might be placed or called in a context where it’s not allowed or doesn’t make sense. For instance, it might be defined inside another function or an inappropriate block of code.

  2. Incorrect JSON Formatting: If this snippet is part of a larger JSON object or a configuration file, the JSON structure around it may be incorrect, such as missing or extra commas, brackets, or braces.

  3. Usage Context: If this is meant to be an inline function definition in a scripting language or environment that doesn’t support such syntax, you’ll get an error. This could happen if you’re trying to define the function in a place where only expressions or certain kinds of statements are allowed.

  4. Execution Environment: The environment where you’re running this code might not support this kind of function definition. Some environments require functions to be defined in specific ways.

How to Fix:

  1. Review the Placement: Ensure that the function is defined in an appropriate place in your code, typically at the global level or within a proper function scope.

  2. Check the JSON Structure: If this is part of a larger JSON object, validate the JSON structure to make sure it’s correctly formatted. Use an online JSON validator to ensure that the structure is correct.

  3. Appropriate Syntax: If you’re working within a specific environment (e.g., JavaScript, Python, etc.), make sure that you are using the correct syntax for defining and calling functions in that environment.

  4. Check the Function Call: If this is a callable function within a larger script or program, ensure that the function is called correctly and that the environment supports the type of function definition you’re using.

  5. Environment Compatibility: If this function is part of an API definition, ensure that the API framework or environment you’re using supports this structure and format for defining functions.

Here’s a corrected example assuming you’re working in a JavaScript or a similar environment where JSON-like syntax might be used in an API context:

{
    "type": "function",
    "name": "verify_user",
    "description": "requires user to input their account number",
    "parameters": {
        "type": "object",
        "properties": {
            "account_number": {
                "description": "the user's account number",
                "type": "string"
            }
        },
        "required": [
            "account_number"
        ]
    }
}

This is assuming you’re defining this function in the context of an API or similar JSON structure. Ensure that the surrounding context or system calling this function understands and can correctly process this definition.

I’m using chat completion, and yes my prompt always has that instruction since, basically it was 100% working until yesterday with no code changes.

1 Like

I was looking at this too, I saw the structure changed, I updated to this structure but still the same issue, unless I changed to Turbo then it works however other issue also exist in turbo i.e. function to handover to human suddenly doesn’t get called.

Compare the same question he asked they asksed us and see that the answers different then yours? Right?

Update, I switched to gpt-4o-2024-08-06 model and seems to be stable after several testing. Hopefully Openai fixes this issue in the current model.

1 Like