Closed AngelVegaAlvarez closed 6 months ago
Here is the script to reproduce the issue.
sf = @(x)fprintf("%s",x);
f = openAIFunction("generateImage","Geneates an image from a text prompt.");
f = addParameter(f,"Prompt",type="string", description="text prompt that describes the image to generate.");
chat = openAIChat("You are an AI assistant",StreamFun=sf, Tools=f);
prompts = ["Where is the capital of France?";"Create a 3D avatar of a whimsical sushi on the beach."];
messages = openAIMessages;
for ii = 1:numel(prompts)
prompt = prompts(ii)
messages = addUserMessage(messages,prompt);
[txt,message,response] = generate(chat,messages);
if response.StatusCode ~= "OK"
response.Body.Data.error
end
end
This is the error when tool_calls was returned.
This is the intermittent error even when there is no tool_calls.
Here is the responses returned when this error occurs.
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":" How"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":" does"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":" p"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":"enguin"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8pHJr2oHzFuQXiP","object":"chat.completion.chunk","created":1709029144,"model":"gpt-3.5-turbo-0125","system_fingerprint":"fp_86156a94a0","choices":[{"index":0,"delta":{"content":" build"},"logprobs":null,"finish_reason":null}]}
{"id":"chatcmpl-8woq8HHNVGld8N8p
Streaming function errors when a tool is called