18 feature add anthropic response api support - #19
Merged
chengzi404-hash merged 7 commits intoAug 16, 2026
Conversation
Updated contribution guidelines to specify merging into the 'dev' branch instead of 'master'.
- Provider 新增 type 字段(openai/responses/anthropic),JSON 解析缺失或非法 type 时拒绝该 provider;Config.validate() 在活动 provider 被拒时给出明确 type 错误。 - use_preset() 把 type 写入生成的 provider 配置。 - stream_completion 按 provider.type 分发到三个后端: - openai: 原有 chat.completions.create 路径 - responses: OpenAI SDK 的 responses 接口(system -> instructions,工具结果转 function_call_output) - anthropic: anthropic SDK 的 messages.stream(system 独立参数,必填 max_tokens) - 统一 usage 归一化为 prompt_tokens/completion_tokens/total_tokens,ChatClient 透明累加。 - 现有 /openai 兼容预设(DeepSeek/GLM/Kimi/Qwen/MiniMax 等)补齐 type=openai;新增 anthropic 预设。 - requirements.txt 增加 anthropic 依赖。 - 配套测试:test_provider.py(type 解析/拒绝/use_preset 持久化/validate)、test_client.py(make_client 分发 + 三个后端的流事件解析)、test_ui.py(_setup_providers/_setup_preset 补 type 字段)。
在「多供应商与模型」章节加入 type 字段说明表(openai/responses/anthropic 三个取值对应的底层传输),并补 Anthropic provider 配置示例。
chengzi404-hash
deleted the
18-feature-add-anthropic-response-api-support
branch
August 16, 2026 10:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #18