(fix) rename proxy to openai-proxy

This commit is contained in:
ishaan-jaff 2023-10-21 15:59:34 -07:00
parent 5d78e054ab
commit 5ac497c56b
5 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,39 @@
import openai
openai.api_base = "http://127.0.0.1:8000"
openai.api_key = "this can be anything"
print("making request")
api_key = ""
response = openai.ChatCompletion.create(
model = "gpt-3.5-turbo",
messages = [
{
"role": "user",
"content": "this is a test message, what model / llm are you"
}
],
api_key=api_key,
max_tokens = 10,
)
print(response)
response = openai.ChatCompletion.create(
model = "gpt-3.5-turbo",
messages = [
{
"role": "user",
"content": "this is a test message, what model / llm are you"
}
],
api_key=api_key,
max_tokens = 10,
stream=True
)
for chunk in response:
print(chunk)