mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
style: bump ruff version to 0.15 (#35042)
This commit is contained in:
committed by
GitHub
parent
1493b4c5ee
commit
b97c629f9a
@@ -977,14 +977,14 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
||||
input_vars: set[str] = set()
|
||||
optional_variables: set[str] = set()
|
||||
partial_vars: dict[str, Any] = {}
|
||||
for _message in messages_:
|
||||
if isinstance(_message, MessagesPlaceholder) and _message.optional:
|
||||
partial_vars[_message.variable_name] = []
|
||||
optional_variables.add(_message.variable_name)
|
||||
for message in messages_:
|
||||
if isinstance(message, MessagesPlaceholder) and message.optional:
|
||||
partial_vars[message.variable_name] = []
|
||||
optional_variables.add(message.variable_name)
|
||||
elif isinstance(
|
||||
_message, (BaseChatPromptTemplate, BaseMessagePromptTemplate)
|
||||
message, (BaseChatPromptTemplate, BaseMessagePromptTemplate)
|
||||
):
|
||||
input_vars.update(_message.input_variables)
|
||||
input_vars.update(message.input_variables)
|
||||
|
||||
kwargs = {
|
||||
"input_variables": sorted(input_vars),
|
||||
|
||||
@@ -84,11 +84,11 @@ def _load_examples(config: dict) -> dict:
|
||||
|
||||
def _load_output_parser(config: dict) -> dict:
|
||||
"""Load output parser."""
|
||||
if _config := config.get("output_parser"):
|
||||
if output_parser_type := _config.get("_type") != "default":
|
||||
if config_ := config.get("output_parser"):
|
||||
if output_parser_type := config_.get("_type") != "default":
|
||||
msg = f"Unsupported output parser {output_parser_type}"
|
||||
raise ValueError(msg)
|
||||
config["output_parser"] = StrOutputParser(**_config)
|
||||
config["output_parser"] = StrOutputParser(**config_)
|
||||
return config
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user