You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the weird thing is I ask the agent to create the training program, call the tool, and hand it off to another agent. The handoff also has the workouts array blank:
but the agent it hands off is able to correctly display the entire training program to the user. so the missing is data is somewhere, but just not in the function tool calls?
Expected behavior
I expected the workouts list on TrainingProgram to be populated
The text was updated successfully, but these errors were encountered:
So my best guess is that the model decides it's valid to pass an empty list. Can you try adding function and field descriptions, which will make it clear how to create input? e.g.
class Exercise(BaseModel):
""A single exercise, ..."
...
class Workout(BaseModel):
"""A workout, which includes a list of exercises"
exercises: List[Exercise]
"""A list of exercises. Do NOT pass an empty list, pass all exercises known"
...
@function_tool
async def create_training_program(wrapper: RunContextWrapper[ChatContext], training_program: TrainingProgram)
"""Create a training program. You MUST pass a full training program with all parameters filled in"""
This is basically prompt engineering your tools and input. The descriptions are passed to the model, and hopefully it enables the model to do better.
Please read this first
Describe the bug
Nested arrays/objects of a Pydantic type are not passed to function tool arguments.
I have these classes:
function tool calls seem to always have the workouts list empty
Debug information
Repro steps
I have a function tool defined as so:
when one of my agents calls it, the workouts array is empty
the weird thing is I ask the agent to create the training program, call the tool, and hand it off to another agent. The handoff also has the workouts array blank:
but the agent it hands off is able to correctly display the entire training program to the user. so the missing is data is somewhere, but just not in the function tool calls?
Expected behavior
I expected the workouts list on TrainingProgram to be populated
The text was updated successfully, but these errors were encountered: