mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
(test) add gpt-4 vision
This commit is contained in:
parent
71da9d0d63
commit
c2c186eb28
1 changed files with 30 additions and 0 deletions
|
@ -113,6 +113,36 @@ def test_completion_gpt4_turbo():
|
|||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_gpt4_turbo()
|
||||
|
||||
def test_completion_gpt4_vision():
|
||||
try:
|
||||
response = completion(
|
||||
model="gpt-4-vision-preview",
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "What’s in this image?"
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
)
|
||||
print(response)
|
||||
except openai.error.RateLimitError:
|
||||
print("got a rate liimt error")
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_completion_gpt4_turbo()
|
||||
|
||||
def test_completion_perplexity_api():
|
||||
try:
|
||||
# litellm.set_verbose=True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue