mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
refactor(openai_proxy-->-litellm_server): renaming project for simplicity
This commit is contained in:
parent
f6be642f2f
commit
16f39ec840
15 changed files with 1 additions and 1 deletions
38
litellm_server/tests/test_openrouter.py
Normal file
38
litellm_server/tests/test_openrouter.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
import openai
|
||||
openai.api_base = "http://0.0.0.0:8000"
|
||||
openai.api_key = "this can be anything"
|
||||
print("making request")
|
||||
|
||||
api_key = ""
|
||||
response = openai.ChatCompletion.create(
|
||||
model = "openrouter/google/palm-2-chat-bison",
|
||||
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 = "openrouter/google/palm-2-chat-bison",
|
||||
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)
|
Loading…
Add table
Add a link
Reference in a new issue