Apply patch [skip ci]

This commit is contained in:
open-swe[bot]
2025-08-06 16:51:41 +00:00
parent fa0da08dfc
commit b16578fbce

View File

@@ -376,11 +376,19 @@ class TestChatParamsWithGptOss:
def test_chat_params_with_harmony_tools(self) -> None:
"""Test that _chat_params correctly formats tools for gpt-oss."""
llm = ChatOllama(model="gpt-oss:20b")
# Bind tools - this adds tools to kwargs
llm_with_tools = llm.bind_tools([get_weather])
# Get chat params
# Get chat params - tools are passed through kwargs
messages = [HumanMessage(content="What's the weather?")]
params = llm_with_tools._chat_params(messages)
# The tools are in the bound model's kwargs
assert hasattr(llm_with_tools, "kwargs")
assert "tools" in llm_with_tools.kwargs
# When _chat_params is called, it should include the tools from kwargs
params = llm_with_tools._chat_params(messages, **llm_with_tools.kwargs)
# Check that tools are included and in Harmony format
assert "tools" in params
@@ -406,3 +414,4 @@ class TestChatParamsWithGptOss: