What's Changed
* [Feat] Support Azure GPT-4 Vision Enhancements by ishaan-jaff in https://github.com/BerriAI/litellm/pull/1475
Usage - with Azure Vision enhancements
Docs: https://docs.litellm.ai/docs/providers/azure#usage---with-azure-vision-enhancements
Note: **Azure requires the `base_url` to be set with `/extensions`**
Example
python
base_url=https://gpt-4-vision-resource.openai.azure.com/openai/deployments/gpt-4-vision/extensions
base_url="{azure_endpoint}/openai/deployments/{azure_deployment}/extensions"
**Usage**
python
import os
from litellm import completion
os.environ["AZURE_API_KEY"] = "your-api-key"
azure call
response = completion(
model="azure/gpt-4-vision",
timeout=5,
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Whats in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://avatars.githubusercontent.com/u/29436595?v=4"
},
},
],
}
],
base_url="https://gpt-4-vision-resource.openai.azure.com/openai/deployments/gpt-4-vision/extensions",
api_key=os.getenv("AZURE_VISION_API_KEY"),
enhancements={"ocr": {"enabled": True}, "grounding": {"enabled": True}},
dataSources=[
{
"type": "AzureComputerVision",
"parameters": {
"endpoint": "https://gpt-4-vision-enhancement.cognitiveservices.azure.com/",
"key": os.environ["AZURE_VISION_ENHANCE_KEY"],
},
}
],
)
**Full Changelog**: https://github.com/BerriAI/litellm/compare/v1.17.14...v1.17.15