diff --git a/batches.go b/batches.go index d7661f3d..1054f782 100644 --- a/batches.go +++ b/batches.go @@ -744,6 +744,11 @@ func inlinedRequestToMldev(ac *apiClient, fromObject map[string]any, parentObjec func inlinedResponseFromMldev(fromObject map[string]any, parentObject map[string]any, rootObject map[string]any) (toObject map[string]any, err error) { toObject = make(map[string]any) + fromMetadata := getValueByPath(fromObject, []string{"metadata"}) + if fromMetadata != nil { + setValueByPath(toObject, []string{"metadata"}, fromMetadata) + } + fromResponse := getValueByPath(fromObject, []string{"response"}) if fromResponse != nil { fromResponse, err = generateContentResponseFromMldev(fromResponse.(map[string]any), toObject, rootObject) diff --git a/types.go b/types.go index 3a73f440..488664ec 100644 --- a/types.go +++ b/types.go @@ -5371,6 +5371,8 @@ type JobError struct { // Config for `inlined_responses` parameter. type InlinedResponse struct { + // Optional. The metadata associated with the request. + Metadata map[string]any `json:"metadata,omitempty"` // The response to the request. Response *GenerateContentResponse `json:"response,omitempty"` // Optional. The metadata to be associated with the request.