Assistant + Function calling: response sometimes empty ""

Hi everyone

I’m building an assistant with function calling to look up orders from an e-commerce in Python.

It is in 99% of the time working as expected - but for some reasons in a very few cases I get an empty response.

I have printet out steps that it is taking and in my opinion it is all working. But for some reasons with this example here the assistant output is “”.

COMMAND:             root@p-m-shop01:~# /root/myenv/bin/python /data/h/chat/assistant/order.py 'asst_QMbHvzmiNOV3YWfIB4QYOOVO' 'Min ordre XARKXHNBH er ikke blevet leveret.' null

ASSISTANT RESPONSE:  {"thread.id": "thread_2aKJux9z5rWK91Et6C64qNZK", "response": "Jeg vil gerne hj\u00e6lpe dig med det. Kan du venligst give mig dit postnummer, s\u00e5 jeg kan tjekke status p\u00e5 din ordre?"}

COMMAND:             root@p-m-shop01:~# /root/myenv/bin/python /data/h/chat/assistant/order.py 'asst_QMbHvzmiNOV3YWfIB4QYOOVO' '8270' 'thread_2aKJux9z5rWK91Et6C64qNZK'

FUNCATION PRINT      [{'order_reference': 'XARKXHNBH', 'order_status': 'afsendt', 'sent': 'afsendt', 'Leveringsmetode': 'dao'}]

ASSISTANT RESPONSE   ""

So I first ask the assistant “My order XARKXHNBH has not been delivered” and send 3 values. Assistant_id, Message and ThreadID (Null first time).

Then I get a response asking me to confirm my zip code (requirements in all functions) and I answer this with the threadID too.

Then I can see it looks up the function and the function respond correctly but the assistant just responded “”.

Why? It’s driving crazy. Especially because in my other cases it works.

Is the function call response i.e in JSON is empty or the assistant reply is empty (which you get after ‘submit tool output’)? If the assistant reply is empty, are you sure that in that case Function is called?

Yes. Because I get the response from the function. This is the output of the function:
[{‘order_reference’: ‘XARKXHNBH’, ‘order_status’: ‘afsendt’, ‘sent’: ‘afsendt’, ‘Leveringsmetode’: ‘dao’}]

Fed then to the assistant. If the function wasn’t called I wouldn’t get this output. This is what is weird. And maybe one out of ten times running the same commands, then I does reply.

You’re using this JSON to search in your database right? If yes, if you manually Search(via SQL or something) your database with these parameter, do you find the order?

No. That is the output from the function calling. So that is why I don’t understand the assistant sends an empty reply.

When I send in a questions - it calls the function, get this response you are referring to, but it doesn’t create an answer but just sends an empty response “”