Skip to content

Commit 47c3b59

Browse files
chore(api): update composite API spec
1 parent fc712b2 commit 47c3b59

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 2033
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbaa54a8cdf9c7f13d7322e3cbe42364b41ff8d08b5d616bab9dcfd1fbda5dc6.yml
3-
openapi_spec_hash: 6a04699dd9c5ed4e5deb8e11b534968c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fbc86ec6804caa535a84b2198abd609995725f02c9142d80f9824213e67617f7.yml
3+
openapi_spec_hash: 4ac5fd5d393f45d236b9e96b86ab931e
44
config_hash: 7a70007089f586cc7b1ebd1808030dd1

ai/ai.go

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ func (r AIRunParamsBodyImageTextToText) implementsAIRunParamsBodyUnion() {}
12471247

12481248
type AIRunParamsBodyImageTextToTextMessage struct {
12491249
// The content of the message as a string.
1250-
Content param.Field[string] `json:"content,required"`
1250+
Content param.Field[AIRunParamsBodyImageTextToTextMessagesContentUnion] `json:"content,required"`
12511251
// The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
12521252
Role param.Field[string] `json:"role,required"`
12531253
}
@@ -1256,6 +1256,42 @@ func (r AIRunParamsBodyImageTextToTextMessage) MarshalJSON() (data []byte, err e
12561256
return apijson.MarshalRoot(r)
12571257
}
12581258

1259+
// The content of the message as a string.
1260+
//
1261+
// Satisfied by [shared.UnionString],
1262+
// [ai.AIRunParamsBodyImageTextToTextMessagesContentArray].
1263+
type AIRunParamsBodyImageTextToTextMessagesContentUnion interface {
1264+
ImplementsAIRunParamsBodyImageTextToTextMessagesContentUnion()
1265+
}
1266+
1267+
type AIRunParamsBodyImageTextToTextMessagesContentArray []AIRunParamsBodyImageTextToTextMessagesContentArrayItem
1268+
1269+
func (r AIRunParamsBodyImageTextToTextMessagesContentArray) ImplementsAIRunParamsBodyImageTextToTextMessagesContentUnion() {
1270+
}
1271+
1272+
type AIRunParamsBodyImageTextToTextMessagesContentArrayItem struct {
1273+
// Type of the content part (e.g. 'text', 'image_url').
1274+
Type param.Field[string] `json:"type,required"`
1275+
// Image URL object (when type is 'image_url').
1276+
ImageURL param.Field[AIRunParamsBodyImageTextToTextMessagesContentArrayImageURL] `json:"image_url"`
1277+
// Text content (when type is 'text').
1278+
Text param.Field[string] `json:"text"`
1279+
}
1280+
1281+
func (r AIRunParamsBodyImageTextToTextMessagesContentArrayItem) MarshalJSON() (data []byte, err error) {
1282+
return apijson.MarshalRoot(r)
1283+
}
1284+
1285+
// Image URL object (when type is 'image_url').
1286+
type AIRunParamsBodyImageTextToTextMessagesContentArrayImageURL struct {
1287+
// Image URI with data (e.g. data:image/jpeg;base64,/9j/...).
1288+
URL param.Field[string] `json:"url,required"`
1289+
}
1290+
1291+
func (r AIRunParamsBodyImageTextToTextMessagesContentArrayImageURL) MarshalJSON() (data []byte, err error) {
1292+
return apijson.MarshalRoot(r)
1293+
}
1294+
12591295
type AIRunParamsBodyMultimodalEmbeddings struct {
12601296
// Image in base64 encoded format.
12611297
Image param.Field[string] `json:"image"`

shared/union.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (UnionString) ImplementsAbuseReportGetResponseEnvelopeErrorsCode()
119119
func (UnionString) ImplementsAIRunResponseUnion() {}
120120
func (UnionString) ImplementsAIRunParamsBodyTextEmbeddingsTextUnion() {}
121121
func (UnionString) ImplementsAIRunParamsBodyTextGenerationMessagesContentUnion() {}
122+
func (UnionString) ImplementsAIRunParamsBodyImageTextToTextMessagesContentUnion() {}
122123
func (UnionString) ImplementsPDFNewParamsBodyObjectPDFOptionsHeightUnion() {}
123124
func (UnionString) ImplementsPDFNewParamsBodyObjectPDFOptionsMarginBottomUnion() {}
124125
func (UnionString) ImplementsPDFNewParamsBodyObjectPDFOptionsMarginLeftUnion() {}

0 commit comments

Comments
 (0)