mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix linting bugs
This commit is contained in:
parent
d454bcb749
commit
5dbbfe2f7e
3 changed files with 2 additions and 33 deletions
|
@ -426,37 +426,6 @@ def test_completion_claude_stream_bad_key():
|
||||||
|
|
||||||
|
|
||||||
# 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()
|
# test_completion_replicate_stream()
|
||||||
|
|
||||||
# def test_completion_vertexai_stream():
|
# def test_completion_vertexai_stream():
|
||||||
|
|
|
@ -10,4 +10,4 @@ sys.path.insert(
|
||||||
import time
|
import time
|
||||||
import litellm
|
import litellm
|
||||||
|
|
||||||
api_key = litellm.validate_environment()
|
print(litellm.validate_environment("openai/gpt-3.5-turbo"))
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "litellm"
|
name = "litellm"
|
||||||
version = "0.1.740"
|
version = "0.1.741"
|
||||||
description = "Library to easily interface with LLM API providers"
|
description = "Library to easily interface with LLM API providers"
|
||||||
authors = ["BerriAI"]
|
authors = ["BerriAI"]
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue