add azure/openai tutorial

This commit is contained in:
ishaan-jaff 2023-09-14 09:06:57 -07:00
parent f4a8162e7d
commit b3403cfe10
2 changed files with 31 additions and 0 deletions

View 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"}]
)
```

View file

@ -82,6 +82,7 @@ const sidebars = {
type: 'category',
label: 'Tutorials',
items: [
'tutorials/azure_openai',
'tutorials/ab_test_llms',
'tutorials/huggingface_tutorial',
'tutorials/TogetherAI_liteLLM',