test_web_search_v1() — langchain Function Reference
Architecture documentation for the test_web_search_v1() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD dd4573ce_4cdd_4891_f45f_69c458a74648["test_web_search_v1()"] af57ae60_607e_c138_9ab0_fb8bb1c5916a["test_chat_models.py"] dd4573ce_4cdd_4891_f45f_69c458a74648 -->|defined in| af57ae60_607e_c138_9ab0_fb8bb1c5916a style dd4573ce_4cdd_4891_f45f_69c458a74648 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/groq/tests/integration_tests/test_chat_models.py lines 705–735
def test_web_search_v1() -> None:
llm = ChatGroq(model="groq/compound", output_version="v1")
input_message = {
"role": "user",
"content": "Search for the weather in Boston today.",
}
full: AIMessageChunk | None = None
for chunk in llm.stream([input_message]):
full = chunk if full is None else full + chunk
assert isinstance(full, AIMessageChunk)
assert full.additional_kwargs["reasoning_content"]
assert full.additional_kwargs["executed_tools"]
assert [block["type"] for block in full.content_blocks] == [
"reasoning",
"server_tool_call",
"server_tool_result",
"reasoning",
"text",
]
next_message = {
"role": "user",
"content": "Now search for the weather in San Francisco.",
}
response = llm.invoke([input_message, full, next_message])
assert [block["type"] for block in response.content_blocks] == [
"reasoning",
"server_tool_call",
"server_tool_result",
"text",
]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_web_search_v1() do?
test_web_search_v1() is a function in the langchain codebase, defined in libs/partners/groq/tests/integration_tests/test_chat_models.py.
Where is test_web_search_v1() defined?
test_web_search_v1() is defined in libs/partners/groq/tests/integration_tests/test_chat_models.py at line 705.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free