Skip to content

Commit d4188e4

Browse files
committed
fixed the lint issues
1 parent 6d08690 commit d4188e4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

libs/core/langchain_core/messages/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,8 +1623,7 @@ def _remove_orphaned_tool_messages(
16231623
cleaned_messages: list[BaseMessage] = []
16241624
for message in messages:
16251625
if isinstance(message, ToolMessage) and (
1626-
not valid_tool_call_ids
1627-
or message.tool_call_id not in valid_tool_call_ids
1626+
not valid_tool_call_ids or message.tool_call_id not in valid_tool_call_ids
16281627
):
16291628
continue
16301629
cleaned_messages.append(message)

libs/core/tests/unit_tests/prompts/test_prompt.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def test_mustache_prompt_from_template(snapshot: SnapshotAssertion) -> None:
232232
yo
233233
234234
hello
235-
is a test.""" # noqa: W293
235+
is a test."""
236236
)
237237
assert prompt.input_variables == ["foo"]
238238
if PYDANTIC_VERSION_AT_LEAST_29:
@@ -358,7 +358,7 @@ def test_prompt_invalid_template_format() -> None:
358358
PromptTemplate(
359359
input_variables=input_variables,
360360
template=template,
361-
template_format=cast(PromptTemplateFormat, "bar"),
361+
template_format=cast("PromptTemplateFormat", "bar"),
362362
)
363363

364364

@@ -692,10 +692,9 @@ def test_prompt_with_template_variable_name_jinja2() -> None:
692692

693693
def test_prompt_template_add_with_with_another_format() -> None:
694694
with pytest.raises(ValueError, match=r"Cannot add templates"):
695-
_ = (
696-
PromptTemplate.from_template("This is a {template}")
697-
+ PromptTemplate.from_template("So {{this}} is", template_format="mustache")
698-
)
695+
_ = PromptTemplate.from_template(
696+
"This is a {template}"
697+
) + PromptTemplate.from_template("So {{this}} is", template_format="mustache")
699698

700699

701700
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)