@@ -80,7 +80,8 @@ func (r *AIService) Run(ctx context.Context, modelName string, params AIRunParam
8080// [AIRunResponseAutomaticSpeechRecognition], [AIRunResponseImageClassification],
8181// [AIRunResponseObjectDetection], [AIRunResponseObject],
8282// [AIRunResponseTranslation], [AIRunResponseSummarization],
83- // [AIRunResponseImageToText] or [AIRunResponseImageTextToText].
83+ // [AIRunResponseImageToText], [AIRunResponseImageTextToText] or
84+ // [AIRunResponseMultimodalEmbeddings].
8485type AIRunResponseUnion interface {
8586 ImplementsAIRunResponseUnion ()
8687}
@@ -137,6 +138,10 @@ func init() {
137138 TypeFilter : gjson .JSON ,
138139 Type : reflect .TypeOf (AIRunResponseImageTextToText {}),
139140 },
141+ apijson.UnionVariant {
142+ TypeFilter : gjson .JSON ,
143+ Type : reflect .TypeOf (AIRunResponseMultimodalEmbeddings {}),
144+ },
140145 )
141146}
142147
@@ -549,6 +554,31 @@ func (r aiRunResponseImageTextToTextJSON) RawJSON() string {
549554
550555func (r AIRunResponseImageTextToText ) ImplementsAIRunResponseUnion () {}
551556
557+ type AIRunResponseMultimodalEmbeddings struct {
558+ Data [][]float64 `json:"data"`
559+ Shape []float64 `json:"shape"`
560+ JSON aiRunResponseMultimodalEmbeddingsJSON `json:"-"`
561+ }
562+
563+ // aiRunResponseMultimodalEmbeddingsJSON contains the JSON metadata for the struct
564+ // [AIRunResponseMultimodalEmbeddings]
565+ type aiRunResponseMultimodalEmbeddingsJSON struct {
566+ Data apijson.Field
567+ Shape apijson.Field
568+ raw string
569+ ExtraFields map [string ]apijson.Field
570+ }
571+
572+ func (r * AIRunResponseMultimodalEmbeddings ) UnmarshalJSON (data []byte ) (err error ) {
573+ return apijson .UnmarshalRoot (data , r )
574+ }
575+
576+ func (r aiRunResponseMultimodalEmbeddingsJSON ) RawJSON () string {
577+ return r .raw
578+ }
579+
580+ func (r AIRunResponseMultimodalEmbeddings ) ImplementsAIRunResponseUnion () {}
581+
552582type AIRunParams struct {
553583 AccountID param.Field [string ] `path:"account_id,required"`
554584 Body AIRunParamsBodyUnion `json:"body"`
@@ -641,7 +671,8 @@ func (r AIRunParamsBody) implementsAIRunParamsBodyUnion() {}
641671// [ai.AIRunParamsBodyPrompt], [ai.AIRunParamsBodyTextGeneration],
642672// [ai.AIRunParamsBodyTranslation], [ai.AIRunParamsBodySummarization],
643673// [ai.AIRunParamsBodyImageToText], [ai.AIRunParamsBodyObject],
644- // [ai.AIRunParamsBodyImageTextToText], [AIRunParamsBody].
674+ // [ai.AIRunParamsBodyImageTextToText], [ai.AIRunParamsBodyMultimodalEmbeddings],
675+ // [AIRunParamsBody].
645676type AIRunParamsBodyUnion interface {
646677 implementsAIRunParamsBodyUnion ()
647678}
@@ -1190,6 +1221,18 @@ func (r AIRunParamsBodyImageTextToTextMessage) MarshalJSON() (data []byte, err e
11901221 return apijson .MarshalRoot (r )
11911222}
11921223
1224+ type AIRunParamsBodyMultimodalEmbeddings struct {
1225+ // Image in base64 encoded format.
1226+ Image param.Field [string ] `json:"image"`
1227+ Text param.Field [[]string ] `json:"text"`
1228+ }
1229+
1230+ func (r AIRunParamsBodyMultimodalEmbeddings ) MarshalJSON () (data []byte , err error ) {
1231+ return apijson .MarshalRoot (r )
1232+ }
1233+
1234+ func (r AIRunParamsBodyMultimodalEmbeddings ) implementsAIRunParamsBodyUnion () {}
1235+
11931236type AIRunResponseEnvelope struct {
11941237 // An array of classification results for the input text
11951238 Result AIRunResponseUnion `json:"result" format:"binary"`
0 commit comments