Allow the regular openai class to be used for ChatGPT models (#1393)

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
Nuno Campos
2023-03-02 17:04:18 +00:00
committed by GitHub
parent 8947797250
commit 499e76b199
4 changed files with 15 additions and 1 deletions

View File

@@ -144,6 +144,13 @@ async def test_openai_async_streaming_callback() -> None:
assert isinstance(result, LLMResult)
def test_openai_chat_wrong_class() -> None:
"""Test OpenAIChat with wrong class still works."""
llm = OpenAI(model_name="gpt-3.5-turbo")
output = llm("Say foo:")
assert isinstance(output, str)
def test_openai_chat() -> None:
"""Test OpenAIChat."""
llm = OpenAIChat(max_tokens=10)