mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 06:53:59 +00:00
@@ -42,7 +42,7 @@ def test_indent_lines_after_first(text: str, prefix: str, expected_output: str)
|
||||
|
||||
|
||||
def test_nonlocals() -> None:
|
||||
agent = RunnableLambda(lambda x: x * 2) # noqa: F841
|
||||
agent = RunnableLambda(lambda x: x * 2)
|
||||
|
||||
def my_func(input: str, agent: Dict[str, str]) -> str:
|
||||
return agent.get("agent_name", input)
|
||||
|
@@ -143,7 +143,7 @@ def test_chat_message_chunks() -> None:
|
||||
role="User", content=" indeed."
|
||||
) == AIMessageChunk(
|
||||
content="I am indeed."
|
||||
), "Other MessageChunk + ChatMessageChunk should be a MessageChunk as the left side" # noqa: E501
|
||||
), "Other MessageChunk + ChatMessageChunk should be a MessageChunk as the left side"
|
||||
|
||||
|
||||
def test_function_message_chunks() -> None:
|
||||
|
@@ -626,7 +626,7 @@ def test_exception_handling_callable() -> None:
|
||||
expected = "foo bar"
|
||||
|
||||
def handling(e: ToolException) -> str:
|
||||
return expected # noqa: E731
|
||||
return expected
|
||||
|
||||
_tool = _FakeExceptionTool(handle_tool_error=handling)
|
||||
actual = _tool.run({})
|
||||
@@ -657,7 +657,7 @@ async def test_async_exception_handling_callable() -> None:
|
||||
expected = "foo bar"
|
||||
|
||||
def handling(e: ToolException) -> str:
|
||||
return expected # noqa: E731
|
||||
return expected
|
||||
|
||||
_tool = _FakeExceptionTool(handle_tool_error=handling)
|
||||
actual = await _tool.arun({})
|
||||
@@ -723,7 +723,7 @@ def test_validation_error_handling_callable() -> None:
|
||||
expected = "foo bar"
|
||||
|
||||
def handling(e: ValidationError) -> str:
|
||||
return expected # noqa: E731
|
||||
return expected
|
||||
|
||||
_tool = _MockStructuredTool(handle_validation_error=handling)
|
||||
actual = _tool.run({})
|
||||
@@ -785,7 +785,7 @@ async def test_async_validation_error_handling_callable() -> None:
|
||||
expected = "foo bar"
|
||||
|
||||
def handling(e: ValidationError) -> str:
|
||||
return expected # noqa: E731
|
||||
return expected
|
||||
|
||||
_tool = _MockStructuredTool(handle_validation_error=handling)
|
||||
actual = await _tool.arun({})
|
||||
|
Reference in New Issue
Block a user