feat: implement OpenAI responses handling and streaming support with built-in tool tracking

This commit is contained in:
CaIon
2025-05-05 00:40:16 +08:00
parent bae57c05c1
commit 18b3300ff1
8 changed files with 173 additions and 109 deletions

View File

@@ -238,8 +238,12 @@ type ResponsesOutputContent struct {
}
const (
BuildInTools_WebSearch = "web_search_preview"
BuildInTools_FileSearch = "file_search"
BuildInToolWebSearchPreview = "web_search_preview"
BuildInToolFileSearch = "file_search"
)
const (
BuildInCallWebSearchCall = "web_search_call"
)
const (
@@ -250,6 +254,7 @@ const (
// ResponsesStreamResponse 用于处理 /v1/responses 流式响应
type ResponsesStreamResponse struct {
Type string `json:"type"`
Response *OpenAIResponsesResponse `json:"response"`
Response *OpenAIResponsesResponse `json:"response,omitempty"`
Delta string `json:"delta,omitempty"`
Item *ResponsesOutput `json:"item,omitempty"`
}