diff --git a/.envrc.private.example b/.envrc.private.example index 2f91226..9d232ad 100644 --- a/.envrc.private.example +++ b/.envrc.private.example @@ -1,4 +1,4 @@ # Copy this file to .envrc.private and fill in your API keys # .envrc.private is gitignored and will not be committed -export ANTHROPIC_API_KEY="your-api-key-here" +export STORIED_ANTHROPIC_API_KEY="your-api-key-here" diff --git a/src/storied/engine.py b/src/storied/engine.py index b59d93d..8451bbe 100644 --- a/src/storied/engine.py +++ b/src/storied/engine.py @@ -1,6 +1,7 @@ """DM Engine - the agentic loop for running D&D sessions.""" import copy +import os from collections.abc import Iterator from pathlib import Path @@ -46,7 +47,9 @@ class DMEngine: model: Claude model to use prompt_name: System prompt to use (default: "dm-system", or "character-creation") """ - self.client = anthropic.Anthropic() + self.client = anthropic.Anthropic( + api_key=os.environ.get("STORIED_ANTHROPIC_API_KEY"), + ) self.model = model self.world_id = world_id self.player_id = player_id