diff --git a/dto/text_response.go b/dto/text_response.go index 4ef06dd..16deb0d 100644 --- a/dto/text_response.go +++ b/dto/text_response.go @@ -1,8 +1,10 @@ package dto type TextResponseWithError struct { - Choices []OpenAITextResponseChoice `json:"choices"` + Id string `json:"id"` Object string `json:"object"` + Created int64 `json:"created"` + Choices []OpenAITextResponseChoice `json:"choices"` Data []OpenAIEmbeddingResponseItem `json:"data"` Model string `json:"model"` Usage `json:"usage"` @@ -10,6 +12,9 @@ type TextResponseWithError struct { } type TextResponse struct { + Id string `json:"id"` + Object string `json:"object"` + Created int64 `json:"created"` Model string `json:"model"` Choices []OpenAITextResponseChoice `json:"choices"` Usage `json:"usage"` diff --git a/relay/channel/openai/relay-openai.go b/relay/channel/openai/relay-openai.go index 6b31d8b..17efad3 100644 --- a/relay/channel/openai/relay-openai.go +++ b/relay/channel/openai/relay-openai.go @@ -192,6 +192,8 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model } } textResponse := &dto.TextResponse{ + Id: responseWithError.Id, + Object: responseWithError.Object, Choices: responseWithError.Choices, Model: responseWithError.Model, Usage: *usage,