Skip to content

Commit 3a323e3

Browse files
chore(api): update composite API spec
1 parent 0d05222 commit 3a323e3

File tree

11 files changed

+66
-792
lines changed

11 files changed

+66
-792
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1756
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b079f080cace87a18243c586559e7307e55499171d5cbf440932ad6ee8a0d65e.yml
3-
openapi_spec_hash: 64b0ff31c81d75b8ecb141a233dad48e
1+
configured_endpoints: 1754
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10b3e60b93764f161c5b7a9f250787e96cce6b64f7362ac7b11010230dc94afb.yml
3+
openapi_spec_hash: 66e1a1e665b68d9f52d9a58a7b554ec6
44
config_hash: eda5b3d9487ce675d1fadf88153b457d

ai/ai.go

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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].
8485
type 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

550555
func (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+
552582
type 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].
645676
type 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+
11931236
type AIRunResponseEnvelope struct {
11941237
// An array of classification results for the input text
11951238
Result AIRunResponseUnion `json:"result" format:"binary"`

api.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6663,24 +6663,8 @@ Methods:
66636663

66646664
#### Summary
66656665

6666-
Response Types:
6667-
6668-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AIBotSummaryUserAgentResponse">AIBotSummaryUserAgentResponse</a>
6669-
6670-
Methods:
6671-
6672-
- <code title="get /radar/ai/bots/summary/user_agent">client.Radar.AI.Bots.Summary.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AIBotSummaryService.UserAgent">UserAgent</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AIBotSummaryUserAgentParams">AIBotSummaryUserAgentParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AIBotSummaryUserAgentResponse">AIBotSummaryUserAgentResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
6673-
66746666
### TimeseriesGroups
66756667

6676-
Response Types:
6677-
6678-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AITimeseriesGroupUserAgentResponse">AITimeseriesGroupUserAgentResponse</a>
6679-
6680-
Methods:
6681-
6682-
- <code title="get /radar/ai/bots/timeseries_groups/user_agent">client.Radar.AI.TimeseriesGroups.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AITimeseriesGroupService.UserAgent">UserAgent</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AITimeseriesGroupUserAgentParams">AITimeseriesGroupUserAgentParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar">radar</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/radar#AITimeseriesGroupUserAgentResponse">AITimeseriesGroupUserAgentResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
6683-
66846668
## Annotations
66856669

66866670
Response Types:

0 commit comments

Comments
 (0)