fix: don't update tool_config inplace (#1338)

Summary:

messes tests up

Test Plan:
run agent tests
This commit is contained in:
ehhuang 2025-03-01 10:40:00 -08:00 committed by GitHub
parent 327b17e5f0
commit 81c6ef5c1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import copy
from typing import Any, AsyncGenerator, Dict, List, Optional
from llama_stack.apis.common.content_types import (
@ -159,6 +160,7 @@ class InferenceRouter(Inference):
params["tool_prompt_format"] = tool_prompt_format
tool_config = ToolConfig(**params)
tool_config = copy.copy(tool_config)
tool_config.tool_prompt_format = tool_config.tool_prompt_format or get_default_tool_prompt_format(model_id)
tools = tools or []