Skip to content

Commit

Permalink
fix: don't update tool_config inplace (#1338)
Browse files Browse the repository at this point in the history
Summary:

messes tests up

Test Plan:
run agent tests
  • Loading branch information
ehhuang authored Mar 1, 2025
1 parent 327b17e commit 81c6ef5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llama_stack/distribution/routers/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -159,6 +160,7 @@ async def chat_completion(
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 []
Expand Down

0 comments on commit 81c6ef5

Please sign in to comment.