Is it normal to get function call with content?

I’m developing with stream.

when I get response from GPT, I get both content and function call with same ID.

to be clear, it gives content at first and when the content is done, it starts giving function call.

and it ends with finish_reason: ‘function call’.

is the API supposed to be like this?

Hi and welcome to the Developer Forum!

Can you give an example of the output please?

for example, I get these response with same id during stream connection.

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4-32k","choices":[{"index":0,"delta":{"content":"some content"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4-32k","choices":[{"index":0,"delta":{"content":null, "function_call": {"name": "fn_name" }},"finish_reason":null}]}

Those looks like fairly normal delta packets, I’m not seeing any issue there.

1 Like

Also, I’m not sure if GPT-4-32K has function calling enabled, where did you see this documented?

I am actually using the 32K model, and the example code is simple version of the response I actually got. (programming with scala).

I was just wondering if it can give the content and function call in one message.

I thought it can only be one of content or function call.

Thanks a lot!

No problem, I think with the 32K model all bets are off, as there is no specific documentation and it’s all in alpha, if it works… awesome!

1 Like