mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
fix: agent config validation (#1053)
Summary:
Fixes AgentConfig init bug introduced with ToolConfig.
Namely, the below doesn't work
```
agent_config = AgentConfig(
**common_params,
tool_config=ToolConfig(
tool_choice="required",
),
)
```
bvecause tool_choice was defaulted to 'auto' leading to validation check
failing.
Test Plan:
added unittests
LLAMA_STACK_CONFIG=fireworks pytest -s -v tests/client-sdk/
--safety-shield meta-llama/Llama-Guard-3-8B
This commit is contained in:
parent
6ad272927d
commit
96c88397da
3 changed files with 66 additions and 13 deletions
|
|
@ -81,12 +81,6 @@ class MetaReferenceAgentsImpl(Agents):
|
|||
) -> AgentCreateResponse:
|
||||
agent_id = str(uuid.uuid4())
|
||||
|
||||
if agent_config.tool_config is None:
|
||||
agent_config.tool_config = ToolConfig(
|
||||
tool_choice=agent_config.tool_choice,
|
||||
tool_prompt_format=agent_config.tool_prompt_format,
|
||||
)
|
||||
|
||||
await self.persistence_store.set(
|
||||
key=f"agent:{agent_id}",
|
||||
value=agent_config.model_dump_json(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue