add OaiResponsesStreamHandler

This commit is contained in:
creamlike1024
2025-05-03 19:19:19 +08:00
parent 425feb88d8
commit 1236fa8fe4
3 changed files with 70 additions and 2 deletions

View File

@@ -214,7 +214,7 @@ type OpenAIResponsesResponse struct {
Tools []interface{} `json:"tools"`
TopP float64 `json:"top_p"`
Truncation string `json:"truncation"`
Usage Usage `json:"usage"`
Usage *Usage `json:"usage"`
User json.RawMessage `json:"user"`
Metadata json.RawMessage `json:"metadata"`
}
@@ -236,3 +236,9 @@ type ResponsesOutputContent struct {
Text string `json:"text"`
Annotations []interface{} `json:"annotations"`
}
// ResponsesStreamResponse 用于处理 /v1/responses 流式响应
type ResponsesStreamResponse struct {
Type string `json:"type"`
Response *OpenAIResponsesResponse `json:"response"`
}