feat: enhance OaiResponsesStreamHandler to handle output text and improve response streaming

This commit is contained in:
CaIon
2025-05-04 17:09:37 +08:00
parent 1236fa8fe4
commit fe3232bf23
3 changed files with 40 additions and 32 deletions

View File

@@ -237,8 +237,19 @@ type ResponsesOutputContent struct {
Annotations []interface{} `json:"annotations"`
}
const (
BuildInTools_WebSearch = "web_search_preview"
BuildInTools_FileSearch = "file_search"
)
const (
ResponsesOutputTypeItemAdded = "response.output_item.added"
ResponsesOutputTypeItemDone = "response.output_item.done"
)
// ResponsesStreamResponse 用于处理 /v1/responses 流式响应
type ResponsesStreamResponse struct {
Type string `json:"type"`
Response *OpenAIResponsesResponse `json:"response"`
Delta string `json:"delta,omitempty"`
}