Field order in function calling on gpt-4-0125-preview model


I’m using model GPT-4-0125-preview with function calling enabled (using the tools property in the API). In the previous version, GPT-4-1106-preview, all fields were returned in the same order specified in the function request. Now, however, the returns sometimes maintain the same order, while at other times they are in alphabetical order. I understand that there is no specific mention of the order in the documentation, but has there been a change in this aspect?

The output of a function’s properties is the actual text the AI writes.

It is unlikely that the external endpoint between the AI and you takes the AI text and sorts it for you in a few cases now. (they do have some messing with token weights going on concerning functions in general)

So now it is more likely about the AI’s training, presentation of prompt information, which fields are made required, and the sampling parameters of token generation that are determining what the AI decides to write first.

In a dictionary format, the order shouldn’t matter, and it was only in recent versions of python that their contents was even made ordered when reproducing. So in placement of the specification into the AI context, you shouldn’t expect any guarantees by code between API parameters and AI-received specification.

You can use temperature and top_p parameters, lowering them, to get AI reproduction to be more reproducible, favoring the most likely token choices.