passing initial tests
This commit is contained in:
+9
-1
@@ -1,5 +1,9 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
|
PROJECT_ROOT = Path(__file__).parent.parent
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
anthropic_api_key: str
|
anthropic_api_key: str
|
||||||
@@ -7,4 +11,8 @@ class Settings(BaseSettings):
|
|||||||
safedir: str = "./workspace"
|
safedir: str = "./workspace"
|
||||||
max_tokens: int = 500
|
max_tokens: int = 500
|
||||||
|
|
||||||
model_config = {"env_file": ".env"}
|
model_config = {"env_file": PROJECT_ROOT / ".env"}
|
||||||
|
|
||||||
|
|
||||||
|
# create singleton instance, causes validation
|
||||||
|
settings = Settings()
|
||||||
|
|||||||
+1
-3
@@ -2,9 +2,7 @@ import asyncio
|
|||||||
|
|
||||||
from anthropic import AsyncAnthropic
|
from anthropic import AsyncAnthropic
|
||||||
|
|
||||||
from agent.config import Settings
|
from agent.config import settings
|
||||||
|
|
||||||
settings = Settings()
|
|
||||||
|
|
||||||
client = AsyncAnthropic(api_key=settings.anthropic_api_key)
|
client = AsyncAnthropic(api_key=settings.anthropic_api_key)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user