From 6be47ee64e72ad1a2bf891b0479aa446dbde65ef Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 01:07:01 +0000 Subject: [PATCH] Fix issue #2353: Add tests for importing LLM from crewai Co-Authored-By: Joe Moura --- tests/test_import_llm.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_import_llm.py diff --git a/tests/test_import_llm.py b/tests/test_import_llm.py new file mode 100644 index 000000000..8e23bf39e --- /dev/null +++ b/tests/test_import_llm.py @@ -0,0 +1,23 @@ +import pytest + +def test_import_llm_from_crewai(): + """Test that LLM can be imported directly from crewai.""" + try: + from crewai import LLM + assert LLM is not None + except ImportError as e: + pytest.fail(f"Failed to import LLM from crewai: {e}") + +def test_bedrock_llm_creation(): + """Test that a Bedrock LLM can be created.""" + try: + from crewai import LLM + + # Just test the object creation, not the actual API call + bedrock_llm = LLM( + model="bedrock/anthropic.claude-3-sonnet-20240229-v1:0" + ) + assert bedrock_llm is not None + assert bedrock_llm.model == "bedrock/anthropic.claude-3-sonnet-20240229-v1:0" + except Exception as e: + pytest.fail(f"Failed to create Bedrock LLM: {e}")