mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-24 15:48:23 +00:00
test: add gpt-5 and gpt-5-nano vision integration tests
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -155,6 +155,28 @@ class TestOpenAIGPT41MiniMultimodalIntegration:
|
|||||||
assert len(response) > 0
|
assert len(response) > 0
|
||||||
|
|
||||||
|
|
||||||
|
class TestOpenAIGPT5MultimodalIntegration:
|
||||||
|
"""Integration tests for OpenAI GPT-5 with vision."""
|
||||||
|
|
||||||
|
@pytest.mark.vcr()
|
||||||
|
def test_describe_image(self, test_image_bytes: bytes) -> None:
|
||||||
|
"""Test GPT-5 can describe an image."""
|
||||||
|
llm = LLM(model="openai/gpt-5")
|
||||||
|
files = {"image": ImageFile(source=test_image_bytes)}
|
||||||
|
|
||||||
|
messages = _build_multimodal_message(
|
||||||
|
llm,
|
||||||
|
"Describe this image in one sentence. Be brief.",
|
||||||
|
files,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = llm.call(messages)
|
||||||
|
|
||||||
|
assert response
|
||||||
|
assert isinstance(response, str)
|
||||||
|
assert len(response) > 0
|
||||||
|
|
||||||
|
|
||||||
class TestOpenAIGPT5MiniMultimodalIntegration:
|
class TestOpenAIGPT5MiniMultimodalIntegration:
|
||||||
"""Integration tests for OpenAI GPT-5-mini with vision."""
|
"""Integration tests for OpenAI GPT-5-mini with vision."""
|
||||||
|
|
||||||
@@ -177,6 +199,28 @@ class TestOpenAIGPT5MiniMultimodalIntegration:
|
|||||||
assert len(response) > 0
|
assert len(response) > 0
|
||||||
|
|
||||||
|
|
||||||
|
class TestOpenAIGPT5NanoMultimodalIntegration:
|
||||||
|
"""Integration tests for OpenAI GPT-5-nano with vision."""
|
||||||
|
|
||||||
|
@pytest.mark.vcr()
|
||||||
|
def test_describe_image(self, test_image_bytes: bytes) -> None:
|
||||||
|
"""Test GPT-5-nano can describe an image."""
|
||||||
|
llm = LLM(model="openai/gpt-5-nano")
|
||||||
|
files = {"image": ImageFile(source=test_image_bytes)}
|
||||||
|
|
||||||
|
messages = _build_multimodal_message(
|
||||||
|
llm,
|
||||||
|
"Describe this image in one sentence. Be brief.",
|
||||||
|
files,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = llm.call(messages)
|
||||||
|
|
||||||
|
assert response
|
||||||
|
assert isinstance(response, str)
|
||||||
|
assert len(response) > 0
|
||||||
|
|
||||||
|
|
||||||
class TestAnthropicMultimodalIntegration:
|
class TestAnthropicMultimodalIntegration:
|
||||||
"""Integration tests for Anthropic multimodal with real API calls."""
|
"""Integration tests for Anthropic multimodal with real API calls."""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user