fix linting bugs

This commit is contained in:
Krrish Dholakia 2023-09-23 22:23:41 -07:00
parent d454bcb749
commit 5dbbfe2f7e
3 changed files with 2 additions and 33 deletions

View file

@ -426,37 +426,6 @@ def test_completion_claude_stream_bad_key():
# test_completion_claude_stream_bad_key()
def test_completion_replicate_stream():
try:
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": "how does a court case get to the Supreme Court?",
},
]
response = completion(
model="replicate/meta/llama-2-70b-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3", messages=messages, stream=True, max_tokens=50
)
complete_response = ""
has_finish_reason = False
# Add any assertions here to check the response
for idx, chunk in enumerate(response):
chunk, finished = streaming_format_tests(idx, chunk)
has_finish_reason = finished
if finished:
break
complete_response += chunk
if has_finish_reason is False:
raise Exception("finish reason not set for last chunk")
if complete_response.strip() == "":
raise Exception("Empty response received")
print(f"completion_response: {complete_response}")
except InvalidRequestError as e:
pass
except Exception as e:
pytest.fail(f"Error occurred: {e}")
# test_completion_replicate_stream()
# def test_completion_vertexai_stream():

View file

@ -10,4 +10,4 @@ sys.path.insert(
import time
import litellm
api_key = litellm.validate_environment()
print(litellm.validate_environment("openai/gpt-3.5-turbo"))

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "litellm"
version = "0.1.740"
version = "0.1.741"
description = "Library to easily interface with LLM API providers"
authors = ["BerriAI"]
license = "MIT License"