diff --git a/CHANGELOG.md b/CHANGELOG.md index 616290c..62f4c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and initialize it to start the flow. - All examples have been updated to align with the API changes. +### Fixed + +- Fixed an issue where importing the Flows module would require OpenAI, + Anthropic, and Google LLM modules. + ## [0.0.9] - 2024-12-08 ### Changed diff --git a/dev-requirements.txt b/dev-requirements.txt index 38842c6..f464368 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,4 +4,5 @@ pytest~=8.3.2 pytest-asyncio~=0.23.5 pytest-cov~=4.1.0 ruff~=0.6.7 -setuptools~=72.2.0 \ No newline at end of file +setuptools~=72.2.0 +python-dotenv~=1.0.1 \ No newline at end of file diff --git a/src/pipecat_flows/adapters.py b/src/pipecat_flows/adapters.py index 1406a59..0aee1ed 100644 --- a/src/pipecat_flows/adapters.py +++ b/src/pipecat_flows/adapters.py @@ -282,8 +282,8 @@ def create_adapter(llm) -> LLMAdapter: if isinstance(llm, OpenAILLMService): logger.debug("Creating OpenAI adapter") return OpenAIAdapter() - except ImportError: - pass + except ImportError as e: + logger.debug(f"OpenAI import failed: {e}") # Try Anthropic try: @@ -292,8 +292,8 @@ def create_adapter(llm) -> LLMAdapter: if isinstance(llm, AnthropicLLMService): logger.debug("Creating Anthropic adapter") return AnthropicAdapter() - except ImportError: - pass + except ImportError as e: + logger.debug(f"Anthropic import failed: {e}") # Try Google try: @@ -302,8 +302,8 @@ def create_adapter(llm) -> LLMAdapter: if isinstance(llm, GoogleLLMService): logger.debug("Creating Google adapter") return GeminiAdapter() - except ImportError: - pass + except ImportError as e: + logger.debug(f"Google import failed: {e}") # If we get here, either the LLM type is not supported or the required dependency is not installed llm_type = type(llm).__name__