- 新端点 /ai/v1/audio/speech(xai.grok-tts)、/rerank(cohere.rerank-v4)、/moderations(OCI Guardrails) - Responses 放行 code_interpreter 与远程 mcp 工具,web_search/x_search 解除仅非流式限制 - 模型能力映射扩展:TEXT_RERANK→RERANK、TEXT_TO_AUDIO→TTS - AI 网关文档独立 docs/ai-gateway.md,字段兼容矩阵只列支持项;README 精简引用 - swagger 修缺:135 处响应注解具体化,RawMessage/联合类型统一渲染 AnyJSON,overrides 迁至 docs/.swaggo - CHANGELOG 0.4.0,版本段不再记日期;DASH_VERSION v0.4.0
29 lines
921 B
Go
29 lines
921 B
Go
package aiwire
|
|
|
|
// RerankRequest 是 /ai/v1/rerank 请求体(Jina / Cohere 通行风格)。
|
|
type RerankRequest struct {
|
|
Model string `json:"model"`
|
|
Query string `json:"query"`
|
|
Documents []string `json:"documents"`
|
|
TopN *int `json:"top_n,omitempty"`
|
|
ReturnDocuments *bool `json:"return_documents,omitempty"`
|
|
}
|
|
|
|
// RerankDocument 包装原文,仅在 return_documents 时返回。
|
|
type RerankDocument struct {
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// RerankResult 是一条重排结果:index 指向请求 documents 下标。
|
|
type RerankResult struct {
|
|
Index int `json:"index"`
|
|
RelevanceScore float64 `json:"relevance_score"`
|
|
Document *RerankDocument `json:"document,omitempty"`
|
|
}
|
|
|
|
// RerankResponse 是 /ai/v1/rerank 响应体。
|
|
type RerankResponse struct {
|
|
Model string `json:"model"`
|
|
Results []RerankResult `json:"results"`
|
|
}
|