docs: config with provider/model/agent registries and alias-based overrides
This commit is contained in:
+62
-24
@@ -272,19 +272,41 @@ threads.yaml: { "01J7K9M2XNPQR5VWBCDF8G3H4T": "8FWKR3TN5V1QA" }
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# ~/.uncaged/workflow/config.yaml — 全局配置
|
# ~/.uncaged/workflow/config.yaml — 全局配置
|
||||||
defaultAgent: "uwf-hermes"
|
providers:
|
||||||
agentOverrides:
|
openai:
|
||||||
solve-issue: # per-workflow
|
baseUrl: "https://api.openai.com/v1"
|
||||||
developer: "uwf-cursor"
|
apiKeyEnv: "OPENAI_API_KEY"
|
||||||
review-code:
|
anthropic:
|
||||||
reviewer: "uwf-hermes"
|
baseUrl: "https://api.anthropic.com/v1"
|
||||||
|
apiKeyEnv: "ANTHROPIC_API_KEY"
|
||||||
|
openrouter:
|
||||||
|
baseUrl: "https://openrouter.ai/api/v1"
|
||||||
|
apiKeyEnv: "OPENROUTER_API_KEY"
|
||||||
|
|
||||||
models:
|
models:
|
||||||
default:
|
sonnet:
|
||||||
provider: "openrouter"
|
provider: "openrouter"
|
||||||
model: "anthropic/claude-sonnet-4"
|
name: "anthropic/claude-sonnet-4"
|
||||||
extract:
|
gpt4o-mini:
|
||||||
provider: "openai"
|
provider: "openai"
|
||||||
model: "gpt-4o-mini"
|
name: "gpt-4o-mini"
|
||||||
|
|
||||||
|
agents:
|
||||||
|
hermes:
|
||||||
|
command: "uwf-hermes"
|
||||||
|
args: []
|
||||||
|
cursor:
|
||||||
|
command: "uwf-cursor"
|
||||||
|
args: []
|
||||||
|
|
||||||
|
defaultAgent: "hermes"
|
||||||
|
agentOverrides:
|
||||||
|
solve-issue:
|
||||||
|
developer: "cursor"
|
||||||
|
|
||||||
|
defaultModel: "sonnet"
|
||||||
|
modelOverrides:
|
||||||
|
extract: "gpt4o-mini"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -443,22 +465,38 @@ type ThreadListItem = {
|
|||||||
### 4.6 配置
|
### 4.6 配置
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
/** Alias types for config references */
|
||||||
|
type AgentAlias = string;
|
||||||
|
type ModelAlias = string;
|
||||||
|
type ProviderAlias = string;
|
||||||
|
type WorkflowName = string;
|
||||||
|
type RoleName = string;
|
||||||
|
type Scenario = string; // e.g. "extract"
|
||||||
|
|
||||||
|
type ProviderConfig = {
|
||||||
|
baseUrl: string;
|
||||||
|
apiKeyEnv: string; // env var name to read API key from
|
||||||
|
};
|
||||||
|
|
||||||
|
type ModelConfig = {
|
||||||
|
provider: ProviderAlias;
|
||||||
|
name: string; // e.g. "anthropic/claude-sonnet-4", "gpt-4o-mini"
|
||||||
|
};
|
||||||
|
|
||||||
|
type AgentConfig = {
|
||||||
|
command: string;
|
||||||
|
args: string[];
|
||||||
|
};
|
||||||
|
|
||||||
/** ~/.uncaged/workflow/config.yaml */
|
/** ~/.uncaged/workflow/config.yaml */
|
||||||
type WorkflowConfig = {
|
type WorkflowConfig = {
|
||||||
defaultAgent: string;
|
providers: Record<ProviderAlias, ProviderConfig>;
|
||||||
agentOverrides: Record<string, Record<string, string>> | null;
|
models: Record<ModelAlias, ModelConfig>;
|
||||||
// ^ workflow name ^ role name ^ agent command
|
agents: Record<AgentAlias, AgentConfig>;
|
||||||
models: ModelsConfig;
|
defaultAgent: AgentAlias;
|
||||||
};
|
agentOverrides: Record<WorkflowName, Record<RoleName, AgentAlias>> | null;
|
||||||
|
defaultModel: ModelAlias;
|
||||||
type ModelRef = {
|
modelOverrides: Record<Scenario, ModelAlias> | null;
|
||||||
provider: string; // e.g. "openai", "anthropic", "openrouter"
|
|
||||||
model: string; // e.g. "gpt-4o-mini", "claude-sonnet-4"
|
|
||||||
};
|
|
||||||
|
|
||||||
type ModelsConfig = {
|
|
||||||
default: ModelRef; // 默认 LLM
|
|
||||||
extract: ModelRef | null; // extract 专用,null 时用 default
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ~/.uncaged/workflow/threads.yaml */
|
/** ~/.uncaged/workflow/threads.yaml */
|
||||||
|
|||||||
Reference in New Issue
Block a user