forked from phoenix/litellm-mirror
add azure/openai tutorial
This commit is contained in:
parent
f4a8162e7d
commit
b3403cfe10
2 changed files with 31 additions and 0 deletions
30
docs/my-website/docs/tutorials/azure_openai.md
Normal file
30
docs/my-website/docs/tutorials/azure_openai.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Call Azure OpenAI, OpenAI Using LiteLLM
|
||||
|
||||
### Usage
|
||||
```python
|
||||
import os
|
||||
from litellm import completion
|
||||
|
||||
# openai configs
|
||||
os.environ["OPENAI_API_KEY"] = ""
|
||||
|
||||
# azure openai configs
|
||||
os.environ["AZURE_API_KEY"] = ""
|
||||
os.environ["AZURE_API_BASE"] = "https://openai-gpt-4-test-v-1.openai.azure.com/"
|
||||
os.environ["AZURE_API_VERSION"] = "2023-05-15"
|
||||
|
||||
|
||||
|
||||
# openai call
|
||||
response = completion(
|
||||
model = "gpt-3.5-turbo",
|
||||
messages= = [{ "content": "Hello, how are you?","role": "user"}]
|
||||
)
|
||||
|
||||
# azure call
|
||||
response = completion(
|
||||
model = "azure/<your-azure-deployment>",
|
||||
messages = [{ "content": "Hello, how are you?","role": "user"}]
|
||||
)
|
||||
|
||||
```
|
|
@ -82,6 +82,7 @@ const sidebars = {
|
|||
type: 'category',
|
||||
label: 'Tutorials',
|
||||
items: [
|
||||
'tutorials/azure_openai',
|
||||
'tutorials/ab_test_llms',
|
||||
'tutorials/huggingface_tutorial',
|
||||
'tutorials/TogetherAI_liteLLM',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue