forked from phoenix/litellm-mirror
test_proxy_stream
This commit is contained in:
parent
33f31eb38a
commit
a2ea39818d
2 changed files with 17 additions and 17 deletions
|
@ -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)
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue