MCPcopy Create free account
hub / github.com/Forethought-Technologies/AutoChain / test_chat_completion

Function test_chat_completion

tests/models/test_chat_openai.py:38–44  ·  view source on GitHub ↗
(openai_completion_fixture)

Source from the content-addressed store, hash-verified

36
37
38def test_chat_completion(openai_completion_fixture):
39 os.environ["OPENAI_API_KEY"] = "mock_api_key"
40 model = ChatOpenAI(temperature=0)
41 response = model.generate([UserMessage(content="test message")])
42 assert isinstance(response, LLMResult)
43 assert len(response.generations) == 1
44 assert response.generations[0].message.content == "generated message"
45
46
47def test_convert_tool_to_dict():

Callers

nothing calls this directly

Calls 3

generateMethod · 0.95
ChatOpenAIClass · 0.90
UserMessageClass · 0.90

Tested by

no test coverage detected