tophant.aidy.gateway.entity
Messages & Enums
message GlobalPluginConfig
message GlobalPluginConfig {}message GuardPluginConfig
message GuardPluginConfig { // 对于 chat 的请求进行检测 // 对于 chat 的响应进行检测 // 对于 embeddings 的请求进行检测 // 已弃用:请使用 detect_chat_request / detect_chat_response 替代 optional google.protobuf.Struct request_check_context = 12; optional google.protobuf.Struct response_check_context = 22;}enum GuardPluginConfig.CheckMode
enum CheckMode { CHECK_MODE_UNSPECIFIED = 0; // 关闭检测 CHECK_MODE_DISABLED = 1; // 阻断 CHECK_MODE_BLOCK = 2; // 仅记录检测结果(不阻断) CHECK_MODE_LOG_ONLY = 3;}message GuardPluginConfig.DetectConfig
message DetectConfig { // 检测模式:disabled / block / log_only // 透传给检测服务的上下文配置 optional google.protobuf.Struct context = 2;}message GuardPluginGlobalConfig
message GuardPluginGlobalConfig { // 检查服务 URL optional string check_service_url = 2; // 检测服务请求超时时间(默认 30s) optional google.protobuf.Duration timeout = 3;}message LogPluginGlobalConfig
请求日志记录插件配置
message LogPluginGlobalConfig { // 是否禁用请求日志上报 optional bool disabled = 1; // 是否记录未知路由的日志 optional bool log_unknown_routes = 21; // 是否记录未认证请求的日志 optional bool log_unauthenticated_routes = 22; // 利用 HTTP 进行上报 // 利用 Kafka 进行上报}message LogPluginGlobalConfig.Http
message Http { // 请求方法 optional string method = 1; // 日志上报上游 URL optional string url = 2;}message LogPluginGlobalConfig.Http.BasicAuth
message BasicAuth { optional string username = 1; optional string password = 2;}message LogPluginGlobalConfig.Kafka
message Kafka { // Kafka broker 地址列表 repeated string brokers = 1; // Kafka topic 名称 optional string topic = 2; // TLS 配置}message LogPluginGlobalConfig.Kafka.TlsConfig
message TlsConfig { // 是否启用 TLS optional bool enable = 1; // CA 证书文件路径 optional string ca_file_path = 2; // 客户端证书文件路径 optional string cert_file_path = 3; // 客户端私钥文件路径 optional string key_file_path = 4; // 是否跳过服务器证书验证 optional bool insecure_skip_verify = 5;}message Pair
message Pair { optional string name = 1; optional string value = 2;}message PluginConfig
message PluginConfig {}message Route
message Route { // 路由 ID,后续日志等会包含 optional string id = 1; // 路由名称,后续日志等会包含 optional string name = 2; // 路由前缀,用于匹配请求路径,必须以 / 开头,不可以使用特殊符号 optional string prefix = 3; // 访问该路由本身的认证(注意不是访问上游时的认证 —— 上游认证在 upstream 中配置) // capabilities 用于控制路由启用的能力 // 可选值: // - "openai-models":允许访问 /v1/models // - "openai-chat":允许访问 /v1/chat/completions // - "openai-embeddings":允许访问 /v1/embeddings // - "forward-unknown":对未显式支持的路径原样向上游转发(否则直接返回 404) repeated string capabilities = 23; // (已弃用)请使用 capabilities 中的 forward-unknown optional bool allow_unknown_routes = 22; // 自定义标签,用于上报时携带,最多10个 optional google.protobuf.Struct labels = 41;}message RouteAuth
message RouteAuth { // Bearer Token 认证}message RouteAuth.BearerAuth
message BearerAuth { repeated string tokens = 1;}message Upstream
message Upstream { optional string url = 2; optional string token = 3;}message UpstreamType
message UpstreamType {}message UpstreamType.AzureOpenAI
message AzureOpenAI { // no fields}message UpstreamType.OpenAICompatible
message OpenAICompatible { // no fields}