Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 772 Bytes

File metadata and controls

46 lines (36 loc) · 772 Bytes

Provider 配置

URL 常量

URL::OpenAI
URL::Anthropic
URL::DeepSeek
URL::OpenRouter
URL::Poe

OpenAI

auto client = Client(Config{
    .apiKey = std::getenv("OPENAI_API_KEY"),
    .model = "gpt-4o-mini",
});

Anthropic

auto client = Client(AnthropicConfig{
    .apiKey = std::getenv("ANTHROPIC_API_KEY"),
    .model = "claude-sonnet-4-20250514",
});

OpenAI 兼容端点

auto client = Client(Config{
    .apiKey = std::getenv("DEEPSEEK_API_KEY"),
    .baseUrl = std::string(URL::DeepSeek),
    .model = "deepseek-chat",
});

能力对比

Provider 聊天 流式 Embeddings
openai::OpenAI
anthropic::Anthropic