Skip to content

Commit a47506d

Browse files
committed
fix-comments
Signed-off-by: yxia216 <[email protected]>
1 parent 5e2d15f commit a47506d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

internal/apischema/openai/openai.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,8 @@ type GCPVertexAIGenerationConfig struct {
15831583
// https://cloud.google.com/vertex-ai/docs/reference/rest/v1/GenerationConfig#ThinkingConfig
15841584
ThinkingConfig *genai.ThinkingConfig `json:"thinkingConfig,omitzero"`
15851585

1586-
// Detail here is to set global media resolution in gemini models: https://ai.google.dev/api/caching#MediaResolution
1587-
Detail genai.MediaResolution `json:"detail,omitempty"`
1586+
// MediaResolution is to set global media resolution in gemini models: https://ai.google.dev/api/caching#MediaResolution
1587+
MediaResolution genai.MediaResolution `json:"media_resolution,omitempty"`
15881588
}
15891589

15901590
// AnthropicVendorFields contains Anthropic vendor-specific fields.

internal/apischema/openai/vendor_fields_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestChatCompletionRequest_VendorFieldsExtraction(t *testing.T) {
232232
}
233233
],
234234
"generationConfig": {
235-
"detail": "high"
235+
"media_resolution": "high"
236236
}
237237
}`),
238238
expected: &ChatCompletionRequest{
@@ -247,7 +247,7 @@ func TestChatCompletionRequest_VendorFieldsExtraction(t *testing.T) {
247247
},
248248
GCPVertexAIVendorFields: &GCPVertexAIVendorFields{
249249
GenerationConfig: &GCPVertexAIGenerationConfig{
250-
Detail: "high",
250+
MediaResolution: "high",
251251
},
252252
},
253253
},
@@ -263,7 +263,7 @@ func TestChatCompletionRequest_VendorFieldsExtraction(t *testing.T) {
263263
}
264264
],
265265
"generationConfig": {
266-
"detail": "medium",
266+
"media_resolution": "medium",
267267
"thinkingConfig": {
268268
"includeThoughts": true,
269269
"thinkingBudget": 500
@@ -282,7 +282,7 @@ func TestChatCompletionRequest_VendorFieldsExtraction(t *testing.T) {
282282
},
283283
GCPVertexAIVendorFields: &GCPVertexAIVendorFields{
284284
GenerationConfig: &GCPVertexAIGenerationConfig{
285-
Detail: "medium",
285+
MediaResolution: "medium",
286286
ThinkingConfig: &genai.ThinkingConfig{
287287
IncludeThoughts: true,
288288
ThinkingBudget: ptr.To(int32(500)),

internal/translator/openai_gcpvertexai.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ func (o *openAIToGCPVertexAITranslatorV1ChatCompletion) applyVendorSpecificField
448448
if vendorGenConfig.ThinkingConfig != nil {
449449
gcr.GenerationConfig.ThinkingConfig = vendorGenConfig.ThinkingConfig
450450
}
451-
if vendorGenConfig.Detail != "" {
452-
gcr.GenerationConfig.MediaResolution = vendorGenConfig.Detail
451+
if vendorGenConfig.MediaResolution != "" {
452+
gcr.GenerationConfig.MediaResolution = vendorGenConfig.MediaResolution
453453
}
454454
}
455455
if gcpVendorFields.SafetySettings != nil {

internal/translator/openai_gcpvertexai_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ func TestOpenAIToGCPVertexAITranslatorV1ChatCompletion_RequestBody(t *testing.T)
641641
},
642642
GCPVertexAIVendorFields: &openai.GCPVertexAIVendorFields{
643643
GenerationConfig: &openai.GCPVertexAIGenerationConfig{
644-
Detail: "high",
644+
MediaResolution: "high",
645645
},
646646
},
647647
},

0 commit comments

Comments
 (0)