Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Should tool_choice = auto generate response message content? #2621

Unanswered
jwcarman asked this question in Q&A
Discussion options

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:

  1. Prompt is sent to OpenAI
  2. Response comes back with only tool_calls (listAllDietaryPreferences, listAvailableIngredients, listEquipmentAvailable, and listFoodAllergies).
  3. Another request is sent up with the original prompt and the results of calling all of those tools.
  4. A response is returned that contains both a message (with the bulleted list of the meal plan by day) and a tool_call (addItemsToGroceryList).
  5. A request is sent to OpenAI with the results of the single tool_call.
  6. 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.

You must be logged in to vote

Replies: 1 comment

Comment options

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

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /