mirror of
https://github.com/hwchase17/langchain.git
synced 2026-05-19 05:58:58 +00:00
Apply patch [skip ci]
This commit is contained in:
@@ -704,10 +704,9 @@ class ChatOllama(BaseChatModel):
|
||||
if tools := kwargs.get("tools"):
|
||||
# Check if we need Harmony format conversion for gpt-oss models
|
||||
if _is_gpt_oss_model(self.model) or kwargs.get("_harmony_format"):
|
||||
# For gpt-oss models, we need to convert tools to Harmony format
|
||||
# The actual conversion will be implemented with _convert_to_harmony_tool
|
||||
# TODO: Apply Harmony format conversion here
|
||||
params["tools"] = tools
|
||||
# For gpt-oss models, convert tools to Harmony format
|
||||
harmony_tools = [_convert_to_harmony_tool(tool) for tool in tools]
|
||||
params["tools"] = harmony_tools
|
||||
# Remove the internal flag if present
|
||||
if "_harmony_format" in kwargs:
|
||||
kwargs.pop("_harmony_format")
|
||||
@@ -1512,3 +1511,4 @@ class ChatOllama(BaseChatModel):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user