From 6c538fea0dfa0258820bf22d02a8c9857bcdc04e Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Mon, 3 Feb 2025 11:18:35 -0800 Subject: [PATCH] support system mesage behavior # What does this PR do? Updates AgentConfig to support https://github.com/meta-llama/llama-stack/pull/938 - [ ] Addresses issue (#issue) ## Test Plan Tested in https://github.com/meta-llama/llama-stack/pull/938 ## Sources Please link relevant resources if necessary. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Ran pre-commit to handle lint / formatting issues. - [ ] Read the [contributor guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md), Pull Request section? - [ ] Updated relevant documentation. - [ ] Wrote necessary unit or integration tests. --- .../types/shared_params/agent_config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/llama_stack_client/types/shared_params/agent_config.py b/src/llama_stack_client/types/shared_params/agent_config.py index 186eff85..76aa164c 100644 --- a/src/llama_stack_client/types/shared_params/agent_config.py +++ b/src/llama_stack_client/types/shared_params/agent_config.py @@ -20,6 +20,11 @@ class ToolgroupUnionMember1(TypedDict, total=False): Toolgroup: TypeAlias = Union[str, ToolgroupUnionMember1] +class ToolConfig(TypedDict, total=False): + tool_choice: Literal["auto", "required"] + tool_prompt_format: Literal["json", "function_tag", "python_list"] + system_message_behavior: Literal["append", "replace"] + class AgentConfig(TypedDict, total=False): enable_session_persistence: Required[bool] @@ -40,8 +45,12 @@ class AgentConfig(TypedDict, total=False): sampling_params: SamplingParams + # DEPRECATED: use tool_config instead tool_choice: Literal["auto", "required"] + # DEPRECATED: use tool_config instead tool_prompt_format: Literal["json", "function_tag", "python_list"] toolgroups: List[Toolgroup] + + tool_config: ToolConfig