The program is a simple example of using the assistants API with function calling. There are three functions: get_lat, get_long and get_display_name. The first two functions use an API call to get latitude and longitude respectively, the third function provides a name of the of the location.
To satisfy the prompt: Get the coordinates of the location 55 King Street, Cobourg, Ontario, all three functions should be called.
Most times the required_action portion of the Run object looks like the one below. Some times it breaks the work into multiple steps. Either way is fine.
'required_action': {'submit_tool_outputs': {'tool_calls': [{'id': 'call_FLf8qdNeIh7YC3tauBfTkQ1d',
'function': {'arguments': '{"location": "Cobourg, Ontario"}',
'name': 'get_lat'},
'type': 'function'},
{'id': 'call_3HrT4gh7oX8Yh2gMirC6Lq2y',
'function': {'arguments': '{"location": "Cobourg, Ontario"}',
'name': 'get_long'},
'type': 'function'},
{'id': 'call_Z6lrL2GDeCoXzBKkQ23IFodR',
'function': {'arguments': '{"location": "Cobourg, Ontario"}',
'name': 'get_display_name'},
'type': 'function'}]},
'type': 'submit_tool_outputs'},
'started_at': 1701577250,
'status': 'requires_action',
The problem arises when the required_action portion of the run object looks like the one below. Notice the function name becomes âparalellâ. To the best of my knowledge this format is undocumented.
'required_action': {'submit_tool_outputs': {'tool_calls': [{'id': 'call_O5hqVnwak0UWOEGqWRUQEKt7',
'function': {'arguments': '{\n "tool_uses": [\n {\n "recipient_name": "functions.get_lat",\n "parameters": {\n "location": â55 King St, Cobourg, Ontario"\n }\n },\n {\n "recipient_name": "functions.get_long",\n "parameters": {\n "location": â55 King St, Cobourg, Ontario"\n }\n }\n ]\n}',
'name': 'parallel'},
'type': 'function'}]},
'type': 'submit_tool_outputs'},
'started_at': 1701548209,
'status': 'requires_action',
The question is am I missing something ? I can run this program over and over again, and most times a correctly formatted (as documented) run object is created, other times I get the format shown above. When this does occur the format is always the same, so if it is a hallucination, it is a consistent one.