Converse API skips 'required' tool spec parameters #4226
Labels
closing-soon
This issue will automatically close in 4 days unless further comments are made.
documentation
This is a problem with documentation.
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
I've defined the following nested tool spec:
However the output often (depending on variability in the run) skips some required parameters. For example this output is missing several
duration
fields:Is there anything wrong with the
toolSpec
I've provided, is this a bug, or does the model/API just not support nested parameters?Expected Behavior
Expecting every required parameter to be included
Current Behavior
Some required parameters are skipped
Reproduction Steps
See code
Possible Solution
Add documentation around how this works. I think many people might (wrongly?) assume that when using a
toolSpec
, outputs will be verified to ensure they exactly match a provided spec. Having missing parameters in the output is very surprising.Note that I can get this to output all parameters more reliably by improving the descriptions. I'm more concerned about the lack of clarity or documentation here. One would expect indeterministic results for the
values
of the output that are filled in, but not in thekeys
as well!Additional Information/Context
For context, I'm trying to define a toolSpec to match this Pydantic
WorkoutPlan
model:I have code that takes as input
tools = [WorkoutPlan]
and outputs theformatted_tools
list I provided.SDK version used
Latest
Environment details (OS name and version, etc.)
MacOS
The text was updated successfully, but these errors were encountered: