test_proxy_stream

This commit is contained in:
ishaan-jaff 2023-08-17 07:54:56 -07:00
parent 33f31eb38a
commit a2ea39818d
2 changed files with 17 additions and 17 deletions

View file

@ -1,21 +1,21 @@
import openai # import openai
import os # import os
os.environ["OPENAI_API_KEY"] = "" # os.environ["OPENAI_API_KEY"] = ""
openai.api_key = os.environ["OPENAI_API_KEY"] # openai.api_key = os.environ["OPENAI_API_KEY"]
openai.api_base ="http://localhost:5000" # openai.api_base ="http://localhost:5000"
messages = [ # messages = [
{ # {
"role": "user", # "role": "user",
"content": "write a 1 pg essay in liteLLM" # "content": "write a 1 pg essay in liteLLM"
} # }
] # ]
response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, stream=True) # response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, stream=True)
print("got response", response) # print("got response", response)
# response is a generator # # response is a generator
for chunk in response: # for chunk in response:
print(chunk) # print(chunk)

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "litellm" name = "litellm"
version = "0.1.406" version = "0.1.408"
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"