test_chat_openai_generate() — langchain Function Reference
Architecture documentation for the test_chat_openai_generate() function in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5352e0fb_78a4_ff8d_5bad_8aff25011ee2["test_chat_openai_generate()"] bd382a4e_442c_13ae_530c_6e34bc43623d["test_base.py"] 5352e0fb_78a4_ff8d_5bad_8aff25011ee2 -->|defined in| bd382a4e_442c_13ae_530c_6e34bc43623d style 5352e0fb_78a4_ff8d_5bad_8aff25011ee2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/integration_tests/chat_models/test_base.py lines 127–140
def test_chat_openai_generate() -> None:
"""Test ChatOpenAI wrapper with generate."""
chat = ChatOpenAI(max_tokens=MAX_TOKEN_COUNT, n=2) # type: ignore[call-arg]
message = HumanMessage(content="Hello")
response = chat.generate([[message], [message]])
assert isinstance(response, LLMResult)
assert len(response.generations) == 2
assert response.llm_output
for generations in response.generations:
assert len(generations) == 2
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_chat_openai_generate() do?
test_chat_openai_generate() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py.
Where is test_chat_openai_generate() defined?
test_chat_openai_generate() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py at line 127.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free