test_generate() — langchain Function Reference
Architecture documentation for the test_generate() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 2ac541d8_3a59_9a91_2838_4e523d7cf807["test_generate()"] af57ae60_607e_c138_9ab0_fb8bb1c5916a["test_chat_models.py"] 2ac541d8_3a59_9a91_2838_4e523d7cf807 -->|defined in| af57ae60_607e_c138_9ab0_fb8bb1c5916a style 2ac541d8_3a59_9a91_2838_4e523d7cf807 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/groq/tests/integration_tests/test_chat_models.py lines 141–156
def test_generate() -> None:
"""Test sync generate."""
n = 1
chat = ChatGroq(model=DEFAULT_MODEL_NAME, max_tokens=10)
message = HumanMessage(content="Hello", n=1)
response = chat.generate([[message], [message]])
assert isinstance(response, LLMResult)
assert len(response.generations) == 2
assert response.llm_output
assert response.llm_output["model_name"] == chat.model_name
for generations in response.generations:
assert len(generations) == n
for generation in generations:
assert isinstance(generation, ChatGeneration)
assert isinstance(generation.text, str)
assert generation.text == generation.message.content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_generate() do?
test_generate() is a function in the langchain codebase, defined in libs/partners/groq/tests/integration_tests/test_chat_models.py.
Where is test_generate() defined?
test_generate() is defined in libs/partners/groq/tests/integration_tests/test_chat_models.py at line 141.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free