docs: update all documentation to reflect apiKey refactoring (#528)

Update all documentation files that contained outdated apiKeyEnv
references to use the new apiKey approach.

## Changes

- docs/architecture.md: Update config example to use apiKey field
- docs/wf-stateless-design.md: Update config examples and type
  definitions to use apiKey instead of apiKeyEnv
- docs/builtin-agent-research.md: Update ProviderConfig type
  definition and code examples

All documentation now consistent with the code implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 05:34:49 +00:00
parent 0c90b88e08
commit 47a4268b9b
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -391,7 +391,7 @@ Everything else is immutable CAS content.
providers: providers:
openrouter: openrouter:
baseUrl: "https://openrouter.ai/api/v1" baseUrl: "https://openrouter.ai/api/v1"
apiKeyEnv: "OPENROUTER_API_KEY" apiKey: "sk-..."
models: models:
sonnet: sonnet:
+2 -2
View File
@@ -402,7 +402,7 @@ workflow 怎么配置和使用 model?
```136:160:packages/workflow-protocol/src/types.ts ```136:160:packages/workflow-protocol/src/types.ts
export type ProviderConfig = { export type ProviderConfig = {
baseUrl: string; baseUrl: string;
apiKeyEnv: string; apiKey: string;
}; };
export type ModelConfig = { export type ModelConfig = {
@@ -429,7 +429,7 @@ export type WorkflowConfig = {
export function resolveModel(config: WorkflowConfig, alias: ModelAlias): ResolvedLlmProvider { export function resolveModel(config: WorkflowConfig, alias: ModelAlias): ResolvedLlmProvider {
const modelEntry = config.models[alias]; const modelEntry = config.models[alias];
const providerEntry = config.providers[modelEntry.provider]; const providerEntry = config.providers[modelEntry.provider];
const apiKey = process.env[providerEntry.apiKeyEnv]; const apiKey = providerEntry.apiKey;
return { baseUrl: providerEntry.baseUrl, apiKey, model: modelEntry.name }; return { baseUrl: providerEntry.baseUrl, apiKey, model: modelEntry.name };
} }
``` ```
+4 -4
View File
@@ -280,13 +280,13 @@ threads.yaml: { "01J7K9M2XNPQR5VWBCDF8G3H4T": "8FWKR3TN5V1QA" }
providers: providers:
openai: openai:
baseUrl: "https://api.openai.com/v1" baseUrl: "https://api.openai.com/v1"
apiKeyEnv: "OPENAI_API_KEY" apiKey: "sk-..."
anthropic: anthropic:
baseUrl: "https://api.anthropic.com/v1" baseUrl: "https://api.anthropic.com/v1"
apiKeyEnv: "ANTHROPIC_API_KEY" apiKey: "sk-ant-..."
openrouter: openrouter:
baseUrl: "https://openrouter.ai/api/v1" baseUrl: "https://openrouter.ai/api/v1"
apiKeyEnv: "OPENROUTER_API_KEY" apiKey: "sk-or-..."
models: models:
sonnet: sonnet:
@@ -465,7 +465,7 @@ type Scenario = string; // e.g. "extract"
type ProviderConfig = { type ProviderConfig = {
baseUrl: string; baseUrl: string;
apiKeyEnv: string; // env var name to read API key from apiKey: string; // API key stored directly
}; };
type ModelConfig = { type ModelConfig = {