Function call message incomplete with 3.5-turbo-0613

The function call from gpt-4-0613 is correct

{
  "role": "assistant",
  "content": null,
  "function_call": {
    "name": "gf_2",
    "arguments": "{\n  \"function_name\": \"perform_web_search\",\n  \"kwargs\": {\n    \"search_query\": \"OpenAI news last week\",\n    \"number_of_results\": 5\n  }\n}"
  }
}

But the function call from gpt-3.5-turbo-0613 is not correct, it is missing the ‘function_name’ argument:

{
  "role": "assistant",
  "content": null,
  "function_call": {
    "name": "gf_2",
    "arguments": "{\n  \"kwargs\": {\n    \"search_query\": \"OpenAI news last week\",\n    \"number_of_results\": 5\n  }\n}"
  }
}

Same code except changed the model used.

Struggling a bit with this one. All help greatly appreciated.

Without seeing what you are specifying or describing to the AI, it’s pretty easy to see what’s going on: the function name is likely interpreted as the name of the function just repeated confusingly, so worthy of being deleted.

If you simply renamed that parameter key to something like API_operation the understanding would likely improve.

You have a function that performs multiple tasks that it needs a function name inside? If so, that would seem incompatible with the other parameters.

Thanks, I’ll give your renaming idea a shot.

no not multiple tasks

changed function_name to tool, now both 4 and 3.5 fail in the same way- missing ‘tool’ argument.

to be clear gpt-4 worked perfectly 100’s of times before this change.

I stand corrected. The change to ‘tool’ does work for both 4 and 3.5 but only after I changed the name in the required list as well :^)

Thanks so much for your help.

I’m glad you found a solution! Sometimes all we have to do is sleep on it and think for a bit.