mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
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",
|
||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||
)
|
||||
print("Openai Response\n")
|
||||
print(response)
|
||||
|
||||
# azure call
|
||||
response = completion(
|
||||
model = "azure/<your-azure-deployment>",
|
||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||
)
|
||||
|
||||
print("Azure Response\n")
|
||||
print(response)
|
||||
```
|
||||
|
||||
## Completion() with Streaming
|
||||
|
@ -53,6 +56,9 @@ response = completion(
|
|||
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
||||
stream=True
|
||||
)
|
||||
print("OpenAI Streaming response")
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
|
||||
# azure call
|
||||
response = completion(
|
||||
|
@ -60,6 +66,9 @@ response = completion(
|
|||
messages = [{ "content": "Hello, how are you?","role": "user"}],
|
||||
stream=True
|
||||
)
|
||||
print("Azure Streaming response")
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue