mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 07:26:16 +00:00
core[patch]: fix structured prompt template format (#27003)
template_format is an init argument on ChatPromptTemplate but not an attribute on the object so was getting shoved into StructuredPrompt.structured_ouptut_kwargs
This commit is contained in:
@@ -2,6 +2,7 @@ from collections.abc import Iterator, Mapping, Sequence
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Literal,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
@@ -37,6 +38,7 @@ class StructuredPrompt(ChatPromptTemplate):
|
||||
schema_: Optional[Union[dict, type[BaseModel]]] = None,
|
||||
*,
|
||||
structured_output_kwargs: Optional[dict[str, Any]] = None,
|
||||
template_format: Literal["f-string", "mustache", "jinja2"] = "f-string",
|
||||
**kwargs: Any,
|
||||
) -> None:
|
||||
schema_ = schema_ or kwargs.pop("schema")
|
||||
@@ -47,6 +49,7 @@ class StructuredPrompt(ChatPromptTemplate):
|
||||
messages=messages,
|
||||
schema_=schema_,
|
||||
structured_output_kwargs=structured_output_kwargs,
|
||||
template_format=template_format,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user