forked from phoenix/litellm-mirror
(v0) fixes for Azure GPT Vision enhancements
This commit is contained in:
parent
6cb6bf0727
commit
b95d6ec207
2 changed files with 37 additions and 5 deletions
|
@ -229,7 +229,7 @@ def test_completion_azure_gpt4_vision():
|
|||
litellm.set_verbose = True
|
||||
response = completion(
|
||||
model="azure/gpt-4-vision",
|
||||
timeout=1,
|
||||
timeout=5,
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
|
@ -244,21 +244,31 @@ def test_completion_azure_gpt4_vision():
|
|||
],
|
||||
}
|
||||
],
|
||||
base_url="https://gpt-4-vision-resource.openai.azure.com/",
|
||||
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": "efcd55c055ca47e08f61a8c54ba1707b",
|
||||
},
|
||||
}
|
||||
],
|
||||
)
|
||||
print(response)
|
||||
except openai.APITimeoutError:
|
||||
print("got a timeout error")
|
||||
pass
|
||||
except openai.RateLimitError:
|
||||
print("got a rate liimt error")
|
||||
except openai.RateLimitError as e:
|
||||
print("got a rate liimt error", e)
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
||||
# test_completion_azure_gpt4_vision()
|
||||
test_completion_azure_gpt4_vision()
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="this test is flaky")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue