From f1dbd3481b8f6df6c7a97d3a3ab9fc513da12f46 Mon Sep 17 00:00:00 2001 From: LeonOstrez Date: Thu, 25 Jul 2024 14:33:09 +0200 Subject: [PATCH] update default config.json setup and example-config.json --- core/config/__init__.py | 7 ++++++- core/llm/anthropic_client.py | 2 +- example-config.json | 12 ++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/config/__init__.py b/core/config/__init__.py index 71ae6f35..645670e3 100644 --- a/core/config/__init__.py +++ b/core/config/__init__.py @@ -306,7 +306,12 @@ class Config(_StrictModel): Pythagora Core configuration """ - llm: dict[LLMProvider, ProviderConfig] = Field(default={LLMProvider.OPENAI: ProviderConfig()}) + llm: dict[LLMProvider, ProviderConfig] = Field( + default={ + LLMProvider.OPENAI: ProviderConfig(), + LLMProvider.ANTHROPIC: ProviderConfig(), + } + ) agent: dict[str, AgentLLMConfig] = Field( default={ DEFAULT_AGENT_NAME: AgentLLMConfig(), diff --git a/core/llm/anthropic_client.py b/core/llm/anthropic_client.py index a834079a..f458a7b2 100644 --- a/core/llm/anthropic_client.py +++ b/core/llm/anthropic_client.py @@ -23,7 +23,7 @@ class AnthropicClient(BaseLLMClient): def _init_client(self): self.client = AsyncAnthropic( api_key=self.config.api_key, - # base_url=self.config.base_url, + base_url=self.config.base_url, timeout=Timeout( max(self.config.connect_timeout, self.config.read_timeout), connect=self.config.connect_timeout, diff --git a/example-config.json b/example-config.json index 5afefdcf..57a1e96d 100644 --- a/example-config.json +++ b/example-config.json @@ -10,6 +10,13 @@ "connect_timeout": 60.0, "read_timeout": 10.0 }, + // Example config for Anthropic (see https://docs.anthropic.com/docs/api-reference) + "anthropic": { + "base_url": "https://api.anthropic.com", + "api_key": "your-api-key", + "connect_timeout": 60.0, + "read_timeout": 10.0 + }, // Example config for Azure OpenAI (see https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions) "azure": { "base_url": "https://your-resource-name.openai.azure.com/", @@ -40,6 +47,11 @@ "provider": "openai", "model": "gpt-3.5-turbo", "temperature": 0.0 + }, + "BugHunter.check_logs": { + "provider": "anthropic", + "model": "claude-3-5-sonnet-20240620", + "temperature": 0.0 } }, // Logging configuration outputs debug log to "pythagora.log" by default. If you set this to null,