ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s

This commit is contained in:
2026-08-20 13:12:50 +00:00
commit b119135836
10275 changed files with 3284984 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# Provider Selection (anthropic, openai, or openrouter)
PROVIDER=anthropic
# API Keys - Set the key for your chosen provider
ANTHROPIC_API_KEY=your_anthropic_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
OPENROUTER_API_KEY=your_openrouter_api_key_here
# OPENROUTER_API_KEY doubles as a UNIVERSAL FALLBACK:
# If PROVIDER=anthropic but ANTHROPIC_API_KEY is missing, or PROVIDER=openai but
# OPENAI_API_KEY is missing, the agent automatically routes through OpenRouter
# using the OpenAI-compatible API (as long as OPENROUTER_API_KEY is set).
# On fallback the model id is mapped/prefixed automatically:
# claude-sonnet-* -> anthropic/claude-sonnet-4.6
# claude-haiku-* -> anthropic/claude-haiku-4.5
# claude-opus-* / other claude-* -> anthropic/claude-opus-4.8
# gpt-* / o1-* -> openai/<model> (e.g. gpt-4o-mini -> openai/gpt-4o-mini)
# So you can run with ONLY an OPENROUTER_API_KEY set.
# Model Configuration - Use model appropriate for your provider
# For Anthropic:
DEFAULT_MODEL=claude-sonnet-4-20250514
# For OpenAI:
# DEFAULT_MODEL=gpt-4-turbo
# For OpenRouter (can use any provider's models):
# DEFAULT_MODEL=anthropic/claude-sonnet-4
# Agent Configuration
MAX_ITERATIONS=50
MAX_TOKENS=8192
# Working Directory (optional, defaults to current directory)
WORKING_DIRECTORY=