agent bot commit (#31)
This commit is contained in:
parent
dbfd4134da
commit
937c8c2a6a
|
|
@ -35,7 +35,8 @@ dependencies = [
|
||||||
"python-Levenshtein==0.23.0",
|
"python-Levenshtein==0.23.0",
|
||||||
"pathspec>=0.11.0",
|
"pathspec>=0.11.0",
|
||||||
"aider-chat>=0.69.1",
|
"aider-chat>=0.69.1",
|
||||||
"tavily-python>=0.5.0"
|
"tavily-python>=0.5.0",
|
||||||
|
"litellm"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,19 @@ class OpenRouterStrategy(ProviderStrategy):
|
||||||
|
|
||||||
return ValidationResult(valid=len(missing) == 0, missing_vars=missing)
|
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:
|
class ProviderFactory:
|
||||||
"""Factory for creating provider validation strategies."""
|
"""Factory for creating provider validation strategies."""
|
||||||
|
|
||||||
|
|
@ -231,7 +244,8 @@ class ProviderFactory:
|
||||||
'openai': OpenAIStrategy(),
|
'openai': OpenAIStrategy(),
|
||||||
'openai-compatible': OpenAICompatibleStrategy(),
|
'openai-compatible': OpenAICompatibleStrategy(),
|
||||||
'anthropic': AnthropicStrategy(),
|
'anthropic': AnthropicStrategy(),
|
||||||
'openrouter': OpenRouterStrategy()
|
'openrouter': OpenRouterStrategy(),
|
||||||
|
'ollama': OllamaStrategy()
|
||||||
}
|
}
|
||||||
strategy = strategies.get(provider)
|
strategy = strategies.get(provider)
|
||||||
return strategy
|
return strategy
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue