Open lowcountrylee opened 1 year ago
I see the variables set in:
I'm guessing the issue is that chat_mode is not coming back at the right type as I see the function_call code inside of add_text_to_chat_mode_generator.
The issue is that I'm not using streaming and the function logic seems to only be in the streaming handler. I resolved it in my instance by changing the function:
def add_text_to_chat_mode(chat_mode):
if isinstance(chat_mode, (types.AsyncGeneratorType, types.GeneratorType)):
return add_text_to_chat_mode_generator(chat_mode)
else:
for c in chat_mode['choices']:
if "content" in c['message'] and c['message']['content'] != "":
c['text'] = c['message']['content']
# capture function call data and convert to text again so we have a consistent interface with non-chat mode and open models
if "function_call" in c['message']:
# build the start of the function call (the follows the syntax that GPT says it wants when we ask it, and will be parsed by the @function_detector)
c['text'] = "\n```typescript\nfunctions." + c['message']['function_call']["name"] + "(" + c['message']['function_call']["arguments"].replace("\\n", "\n") + ")```"
return chat_mode
Just encountered this issue with GPT-4-32k on Azure
The bug This could be an issue on the other end but it appears that at the moment the Azure gpt-3.5-turbo 2023-07-01-preview function does not set message.content when using the function capability.
To Reproduce
System info (please complete the following information):