feat: add Claude and OpenRouter AI providers
OpenRouter is used when no provider flag is set. Claude is selected with .cl, and GLM stays available via .glm.
This commit is contained in:
@@ -63,6 +63,18 @@ class AiConfig:
|
||||
model="deepseek-v4-flash",
|
||||
)
|
||||
)
|
||||
claude: AiProviderConfig = field(
|
||||
default_factory=lambda: AiProviderConfig(
|
||||
api_url="https://api.anthropic.com",
|
||||
model="claude-haiku-5-5",
|
||||
)
|
||||
)
|
||||
openrouter: AiProviderConfig = field(
|
||||
default_factory=lambda: AiProviderConfig(
|
||||
api_url="https://openrouter.ai/api/v1",
|
||||
model="anthropic/claude-haiku-5.5",
|
||||
)
|
||||
)
|
||||
prompt_dir: Path = Path("prompts")
|
||||
base_dir: Path = Path(".")
|
||||
max_context_messages: int = 100
|
||||
@@ -215,6 +227,18 @@ def _parse_ai_config(raw: Any) -> AiConfig:
|
||||
default_model="deepseek-v4-flash",
|
||||
env_prefix="DEEPSEEK",
|
||||
)
|
||||
claude = parse_provider(
|
||||
"claude",
|
||||
default_url="https://api.anthropic.com",
|
||||
default_model="claude-haiku-5-5",
|
||||
env_prefix="CLAUDE",
|
||||
)
|
||||
openrouter = parse_provider(
|
||||
"openrouter",
|
||||
default_url="https://openrouter.ai/api/v1",
|
||||
default_model="anthropic/claude-haiku-5.5",
|
||||
env_prefix="OPENROUTER",
|
||||
)
|
||||
max_context_messages = _parse_int(
|
||||
raw_config.get("max_context_messages", 100),
|
||||
field_name="ai.max_context_messages",
|
||||
@@ -294,6 +318,8 @@ def _parse_ai_config(raw: Any) -> AiConfig:
|
||||
return AiConfig(
|
||||
glm=glm,
|
||||
deepseek=deepseek,
|
||||
claude=claude,
|
||||
openrouter=openrouter,
|
||||
prompt_dir=prompt_dir,
|
||||
max_context_messages=max_context_messages,
|
||||
max_media_bytes=max_media_bytes,
|
||||
|
||||
Reference in New Issue
Block a user