diff --git a/pyproject.toml b/pyproject.toml index 189688b..429e22a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,8 @@ dependencies = [ "python-Levenshtein==0.23.0", "pathspec>=0.11.0", "aider-chat>=0.69.1", - "tavily-python>=0.5.0" + "tavily-python>=0.5.0", + "litellm" ] [project.optional-dependencies] diff --git a/ra_aid/provider_strategy.py b/ra_aid/provider_strategy.py index b2cd56f..70fc768 100644 --- a/ra_aid/provider_strategy.py +++ b/ra_aid/provider_strategy.py @@ -213,6 +213,19 @@ class OpenRouterStrategy(ProviderStrategy): return ValidationResult(valid=len(missing) == 0, missing_vars=missing) +class OllamaStrategy(ProviderStrategy): + """Ollama provider validation strategy.""" + + def validate(self, args: Optional[Any] = None) -> ValidationResult: + """Validate Ollama environment variables.""" + missing = [] + + base_url = os.environ.get('OLLAMA_BASE_URL') + if not base_url: + missing.append('OLLAMA_BASE_URL environment variable is not set') + + return ValidationResult(valid=len(missing) == 0, missing_vars=missing) + class ProviderFactory: """Factory for creating provider validation strategies.""" @@ -231,7 +244,8 @@ class ProviderFactory: 'openai': OpenAIStrategy(), 'openai-compatible': OpenAICompatibleStrategy(), 'anthropic': AnthropicStrategy(), - 'openrouter': OpenRouterStrategy() + 'openrouter': OpenRouterStrategy(), + 'ollama': OllamaStrategy() } strategy = strategies.get(provider) return strategy