-
Couldn't load subscription status.
- Fork 2k
-
I am creating a simple example that exhibits tool calling: https://github.com/callibrity/tools-demo
The idea is that I can use this to do a meal plan. When I execute the following prompt (via HTTPie):
http POST localhost:8080/chat prompt="Please provide a meal plan for the next 5 days for my family. If I need to buy groceries, please update my grocery list with anything I'm missing. Return a detailed, bulleted list of all meals you've planned separated by day as the final completion (after adding items to my grocery list)."This is the flow I'm observing:
- Prompt is sent to OpenAI
- Response comes back with only tool_calls (listAllDietaryPreferences, listAvailableIngredients, listEquipmentAvailable, and listFoodAllergies).
- Another request is sent up with the original prompt and the results of calling all of those tools.
- A response is returned that contains both a message (with the bulleted list of the meal plan by day) and a tool_call (addItemsToGroceryList).
- A request is sent to OpenAI with the results of the single tool_call.
- A response is sent back saying something like "I have successfully updated your grocery list with the necessary items. Your 5-day meal plan is all set, and you're ready to enjoy healthy Mediterranean meals! If you have any further requests or need adjustments, feel free to let me know. Enjoy your meals!"
Now, this behavior isn't consistent. Sometimes, I get back the bulleted list meal plan by day, but sometimes I get something more summary-level like above. Is there a way to tell OpenAI not to return mixed content and tool_calls? I thought that's what auto was supposed to do.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
I did ask a question on the OpenAI API forums about this as well. It seems this mixed content response type is indeed intended behavior. If that's the case, how would we handle that using the ChatClient as I'm doing in my example app? The intermediate content generated with the tool_call (addItemsToGrocery) is getting lost because all of the back-and-forth is automated and only the last completion is returned to me.
https://community.openai.com/t/tool-choice-auto-sending-content-and-tool-calls/1199283/2
Beta Was this translation helpful? Give feedback.