test_system_message_multiple_tools() — langchain Function Reference
Architecture documentation for the test_system_message_multiple_tools() function in test_structured_chat.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5293a97e_53df_6e75_7ac4_469a2be9bf1a["test_system_message_multiple_tools()"] 742971a1_c426_ee5f_9355_f94bbb636166["TestCreatePrompt"] 5293a97e_53df_6e75_7ac4_469a2be9bf1a -->|defined in| 742971a1_c426_ee5f_9355_f94bbb636166 style 5293a97e_53df_6e75_7ac4_469a2be9bf1a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_structured_chat.py lines 197–251
def test_system_message_multiple_tools(self) -> None:
prompt: Any = StructuredChatAgent.create_prompt(
[
Tool(name="foo", description="Test tool FOO", func=lambda x: x),
Tool(name="bar", description="Test tool BAR", func=lambda x: x),
],
)
actual = prompt.messages[0].prompt.format()
expected = dedent(
"""
Respond to the human as helpfully and accurately as possible. You have access to the following tools:
foo: Test tool FOO, args: {'tool_input': {'type': 'string'}}
bar: Test tool BAR, args: {'tool_input': {'type': 'string'}}
Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input).
Valid "action" values: "Final Answer" or foo, bar
Provide only ONE action per $JSON_BLOB, as shown:
```
{
"action": $TOOL_NAME,
"action_input": $INPUT
}
```
Follow this format:
Question: input question to answer
Thought: consider previous and subsequent steps
Action:
```
$JSON_BLOB
```
Observation: action result
... (repeat Thought/Action/Observation N times)
Thought: I know what to respond
Action:
```
{
"action": "Final Answer",
"action_input": "Final response to human"
}
```
Begin! Reminder to ALWAYS respond with a valid json blob of a single action. Use tools if necessary. Respond directly if appropriate. Format is Action:```$JSON_BLOB```then Observation:.
Thought:
""", # noqa: E501
).strip()
assert actual == expected
Domain
Subdomains
Source
Frequently Asked Questions
What does test_system_message_multiple_tools() do?
test_system_message_multiple_tools() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_structured_chat.py.
Where is test_system_message_multiple_tools() defined?
test_system_message_multiple_tools() is defined in libs/langchain/tests/unit_tests/agents/test_structured_chat.py at line 197.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free