跳到主要内容

aidy.v2.protocol

Messages

message BedrockRuntimeProtocolConfig

bedrock-runtime 协议的兼容配置入口。 该协议仅作为上游出口协议使用,使用 Bedrock Runtime Converse / ConverseStream。

message BedrockRuntimeProtocolConfig {
// Claude Messages `messages[].role == "system"` 转 Bedrock Converse 时的处理策略。
// 默认为 `to_user`,只影响 claude-messages 来源的中途 system 消息。
// 可选值:to_user / reject / drop / to_system_array。
string mid_conversation_system_message_strategy = 1;
}

message ChatCompletionsProtocolConfig

chat-completions 协议的兼容配置。

message ChatCompletionsProtocolConfig {
// 覆盖转发到上游时使用的请求 path;为空时回退到协议默认值。
string chat_request_path = 1;
// 标记上游是否支持 `max_completion_tokens` 能力。
bool support_max_completion_tokens = 2;
// 是否为流式 chat-completions 请求自动添加 `stream_options.include_usage = true`。
// 默认为 true;设为 false 时,仅协议转换到 chat-completions 的请求仍会自动添加。
bool always_include_usage = 3;
// 是否把转发给上游的 `developer` role 改写为 `system` role。
// 默认为 false;仅用于不支持 `developer` role 的 chat-completions 兼容上游。
// 已有配置仍然支持;新配置优先使用 map_message_roles。
bool map_developer_role_to_system = 4;
// 出站消息 role 映射表。key 和 value 都必须是 chat-completions 支持的消息 role。
// 例如:{"developer": "user"} 可用于不接受 developer role 的兼容上游。
map<string,string> map_message_roles = 5;
}

message ClaudeMessagesProtocolConfig

claude-messages 协议的兼容配置。

message ClaudeMessagesProtocolConfig {
// 覆盖发往上游的 `anthropic-version` 请求头。
string anthropic_version = 1;
// 覆盖发往上游的一个或多个 `anthropic-beta` 请求头。
repeated string anthropic_beta = 2;
}

message OpenResponsesProtocolConfig

open-responses 协议的兼容配置。

message OpenResponsesProtocolConfig {
// 静默移除指定类型的 tool,例如 web_search 或 image_generation。
// 仅按 tool.type 匹配;function tool 本期不支持按名称移除。
repeated string remove_tools_by_type_silently = 1;
}