agent bot commit (#31)

This commit is contained in:
agentmarketbot 2025-01-02 22:41:02 +01:00 committed by GitHub
parent dbfd4134da
commit 937c8c2a6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View File

@ -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]

View File

@ -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