From 1c8d30dc0f7fc8bfaeace2ec01ac36ad58f95f67 Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Thu, 12 Feb 2026 18:53:05 -0700 Subject: [PATCH] passing initial tests --- agent/config.py | 10 +++++++++- agent/loop.py | 4 +--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/agent/config.py b/agent/config.py index 892bdbf..c29d390 100644 --- a/agent/config.py +++ b/agent/config.py @@ -1,5 +1,9 @@ +from pathlib import Path + from pydantic_settings import BaseSettings +PROJECT_ROOT = Path(__file__).parent.parent + class Settings(BaseSettings): anthropic_api_key: str @@ -7,4 +11,8 @@ class Settings(BaseSettings): safedir: str = "./workspace" max_tokens: int = 500 - model_config = {"env_file": ".env"} + model_config = {"env_file": PROJECT_ROOT / ".env"} + + +# create singleton instance, causes validation +settings = Settings() diff --git a/agent/loop.py b/agent/loop.py index b685cc5..ec56dcf 100644 --- a/agent/loop.py +++ b/agent/loop.py @@ -2,9 +2,7 @@ import asyncio from anthropic import AsyncAnthropic -from agent.config import Settings - -settings = Settings() +from agent.config import settings client = AsyncAnthropic(api_key=settings.anthropic_api_key)