File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1623,8 +1623,7 @@ def _remove_orphaned_tool_messages(
1623
1623
cleaned_messages : list [BaseMessage ] = []
1624
1624
for message in messages :
1625
1625
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
1628
1627
):
1629
1628
continue
1630
1629
cleaned_messages .append (message )
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ def test_mustache_prompt_from_template(snapshot: SnapshotAssertion) -> None:
232
232
yo
233
233
234
234
hello
235
- is a test.""" # noqa: W293
235
+ is a test."""
236
236
)
237
237
assert prompt .input_variables == ["foo" ]
238
238
if PYDANTIC_VERSION_AT_LEAST_29 :
@@ -358,7 +358,7 @@ def test_prompt_invalid_template_format() -> None:
358
358
PromptTemplate (
359
359
input_variables = input_variables ,
360
360
template = template ,
361
- template_format = cast (PromptTemplateFormat , "bar" ),
361
+ template_format = cast (" PromptTemplateFormat" , "bar" ),
362
362
)
363
363
364
364
@@ -692,10 +692,9 @@ def test_prompt_with_template_variable_name_jinja2() -> None:
692
692
693
693
def test_prompt_template_add_with_with_another_format () -> None :
694
694
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" )
699
698
700
699
701
700
@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments