forked from phoenix/litellm-mirror
docs
This commit is contained in:
parent
48407a2e46
commit
1b2cf704af
1 changed files with 10 additions and 1 deletions
|
@ -23,13 +23,16 @@ response = completion(
|
||||||
model = "gpt-3.5-turbo",
|
model = "gpt-3.5-turbo",
|
||||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||||
)
|
)
|
||||||
|
print("Openai Response\n")
|
||||||
|
print(response)
|
||||||
|
|
||||||
# azure call
|
# azure call
|
||||||
response = completion(
|
response = completion(
|
||||||
model = "azure/<your-azure-deployment>",
|
model = "azure/<your-azure-deployment>",
|
||||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||||
)
|
)
|
||||||
|
print("Azure Response\n")
|
||||||
|
print(response)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Completion() with Streaming
|
## Completion() with Streaming
|
||||||
|
@ -53,6 +56,9 @@ response = completion(
|
||||||
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
||||||
stream=True
|
stream=True
|
||||||
)
|
)
|
||||||
|
print("OpenAI Streaming response")
|
||||||
|
for chunk in response:
|
||||||
|
print(chunk)
|
||||||
|
|
||||||
# azure call
|
# azure call
|
||||||
response = completion(
|
response = completion(
|
||||||
|
@ -60,6 +66,9 @@ response = completion(
|
||||||
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
||||||
stream=True
|
stream=True
|
||||||
)
|
)
|
||||||
|
print("Azure Streaming response")
|
||||||
|
for chunk in response:
|
||||||
|
print(chunk)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue