Skip to content

Commit

Permalink
fixed an issue in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-fri-end committed Mar 29, 2024
1 parent 4d21bfb commit 73c7910
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions new_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os

from unify import Unify

unify = Unify(
# This is the default and optional to include.
api_key=os.environ.get("UNIFY_KEY"),
)
response = unify.generate(
messages="Hello Llama! Who was Isaac Newton?",
model="llama-chat",
provider="anyscale",
)
4 changes: 2 additions & 2 deletions unify/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_incorrect_model_name_raises_internal_server_error(self) -> None:
unify = Unify(self.valid_api_key)
# Provide incorrect model name to generate function
with self.assertRaises(InternalServerError):
unify.generate("hello", "llama-chat")
unify.generate(messages="hello", model="llama-chat")

def test_generate_returns_string_when_stream_false(self) -> None:
# Instantiate Unify with a valid API key
Expand Down Expand Up @@ -72,7 +72,7 @@ async def test_incorrect_model_name_raises_internal_server_error(self) -> None:
async_unify = AsyncUnify(api_key=self.valid_api_key)
# Provide incorrect model name to generate function
with self.assertRaises(InternalServerError):
await async_unify.generate("hello", "llama-chat")
await async_unify.generate(messages="hello", model="llama-chat")

async def test_generate_returns_string_when_stream_false(self) -> None:
# Instantiate AsyncUnify with a valid API key
Expand Down

0 comments on commit 73c7910

Please sign in to comment.