mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
core[patch]: update structured output tracing (#30123)
- Trace JSON schema in `options` - Rename to `ls_structured_output_format`
This commit is contained in:
@@ -1090,7 +1090,7 @@ class ChatOllama(BaseChatModel):
|
||||
llm = self.bind_tools(
|
||||
[schema],
|
||||
tool_choice=tool_name,
|
||||
structured_output_format={
|
||||
ls_structured_output_format={
|
||||
"kwargs": {"method": method},
|
||||
"schema": formatted_tool,
|
||||
},
|
||||
@@ -1107,7 +1107,7 @@ class ChatOllama(BaseChatModel):
|
||||
elif method == "json_mode":
|
||||
llm = self.bind(
|
||||
format="json",
|
||||
structured_output_format={
|
||||
ls_structured_output_format={
|
||||
"kwargs": {"method": method},
|
||||
"schema": schema,
|
||||
},
|
||||
@@ -1127,7 +1127,7 @@ class ChatOllama(BaseChatModel):
|
||||
schema = cast(TypeBaseModel, schema)
|
||||
llm = self.bind(
|
||||
format=schema.model_json_schema(),
|
||||
structured_output_format={
|
||||
ls_structured_output_format={
|
||||
"kwargs": {"method": method},
|
||||
"schema": schema,
|
||||
},
|
||||
@@ -1148,7 +1148,7 @@ class ChatOllama(BaseChatModel):
|
||||
response_format = schema
|
||||
llm = self.bind(
|
||||
format=response_format,
|
||||
structured_output_format={
|
||||
ls_structured_output_format={
|
||||
"kwargs": {"method": method},
|
||||
"schema": response_format,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user