Skip to content

Commit b18d890

Browse files
fix: vocab field is required
1 parent f3a6f9f commit b18d890

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
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: 48
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c028a7584d3508f268ce5c5b824b50af88eaa140620dd03a1b35f409f510603c.yml
3-
openapi_spec_hash: f9b780b2398a87678a13355e48cd515f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-84f0d75048a9268981a84800b4190e3691997ce57dcfc0876f38a5b3fce6bacd.yml
3+
openapi_spec_hash: 35607d4e850c8a60524223ff632c83bb
44
config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a

betav2file_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func TestBetaV2FileUploadWithOptionalParams(t *testing.T) {
6363
Tasks: []shared.ExtensionAITasksTaskUnionParam{{
6464
OfSelectTags: &shared.ExtensionAITasksTaskSelectTagsParam{
6565
Instruction: "What types of clothing items are visible in this image?",
66-
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
6766
MaxSelections: imagekit.Int(1),
6867
MinSelections: imagekit.Int(0),
68+
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
6969
},
7070
}, {
7171
OfYesNo: &shared.ExtensionAITasksTaskYesNoParam{

dummy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ func TestDummyNewWithOptionalParams(t *testing.T) {
8585
Tasks: []shared.ExtensionAITasksTaskUnionParam{{
8686
OfSelectTags: &shared.ExtensionAITasksTaskSelectTagsParam{
8787
Instruction: "What types of clothing items are visible in this image?",
88-
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
8988
MaxSelections: imagekit.Int(1),
9089
MinSelections: imagekit.Int(0),
90+
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
9191
},
9292
}, {
9393
OfYesNo: &shared.ExtensionAITasksTaskYesNoParam{

file_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func TestFileUpdateWithOptionalParams(t *testing.T) {
7070
Tasks: []shared.ExtensionAITasksTaskUnionParam{{
7171
OfSelectTags: &shared.ExtensionAITasksTaskSelectTagsParam{
7272
Instruction: "What types of clothing items are visible?",
73-
Vocabulary: []string{"shirt", "dress", "jacket"},
7473
MaxSelections: imagekit.Int(1),
7574
MinSelections: imagekit.Int(0),
75+
Vocabulary: []string{"shirt", "dress", "jacket"},
7676
},
7777
}},
7878
},
@@ -278,9 +278,9 @@ func TestFileUploadWithOptionalParams(t *testing.T) {
278278
Tasks: []shared.ExtensionAITasksTaskUnionParam{{
279279
OfSelectTags: &shared.ExtensionAITasksTaskSelectTagsParam{
280280
Instruction: "What types of clothing items are visible in this image?",
281-
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
282281
MaxSelections: imagekit.Int(1),
283282
MinSelections: imagekit.Int(0),
283+
Vocabulary: []string{"shirt", "tshirt", "dress", "trousers", "jacket"},
284284
},
285285
}, {
286286
OfYesNo: &shared.ExtensionAITasksTaskYesNoParam{

shared/shared.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ func (r *ExtensionConfigAITasks) UnmarshalJSON(data []byte) error {
275275
type ExtensionConfigAITasksTaskUnion struct {
276276
Instruction string `json:"instruction"`
277277
// Any of "select_tags", "select_metadata", "yes_no".
278-
Type string `json:"type"`
278+
Type string `json:"type"`
279+
MaxSelections int64 `json:"max_selections"`
280+
MinSelections int64 `json:"min_selections"`
279281
// This field is a union of [[]string],
280282
// [[]ExtensionConfigAITasksTaskSelectMetadataVocabularyUnion]
281-
Vocabulary ExtensionConfigAITasksTaskUnionVocabulary `json:"vocabulary"`
282-
MaxSelections int64 `json:"max_selections"`
283-
MinSelections int64 `json:"min_selections"`
283+
Vocabulary ExtensionConfigAITasksTaskUnionVocabulary `json:"vocabulary"`
284284
// This field is from variant [ExtensionConfigAITasksTaskSelectMetadata].
285285
Field string `json:"field"`
286286
// This field is from variant [ExtensionConfigAITasksTaskYesNo].
@@ -292,9 +292,9 @@ type ExtensionConfigAITasksTaskUnion struct {
292292
JSON struct {
293293
Instruction respjson.Field
294294
Type respjson.Field
295-
Vocabulary respjson.Field
296295
MaxSelections respjson.Field
297296
MinSelections respjson.Field
297+
Vocabulary respjson.Field
298298
Field respjson.Field
299299
OnNo respjson.Field
300300
OnUnknown respjson.Field
@@ -386,20 +386,20 @@ type ExtensionConfigAITasksTaskSelectTags struct {
386386
Instruction string `json:"instruction,required"`
387387
// Task type that analyzes the image and adds matching tags from a vocabulary.
388388
Type constant.SelectTags `json:"type,required"`
389-
// Array of possible tag values. Combined length of all strings must not exceed 500
390-
// characters. Cannot contain the `%` character.
391-
Vocabulary []string `json:"vocabulary,required"`
392389
// Maximum number of tags to select from the vocabulary.
393390
MaxSelections int64 `json:"max_selections"`
394391
// Minimum number of tags to select from the vocabulary.
395392
MinSelections int64 `json:"min_selections"`
393+
// Array of possible tag values. Combined length of all strings must not exceed 500
394+
// characters. Cannot contain the `%` character.
395+
Vocabulary []string `json:"vocabulary"`
396396
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
397397
JSON struct {
398398
Instruction respjson.Field
399399
Type respjson.Field
400-
Vocabulary respjson.Field
401400
MaxSelections respjson.Field
402401
MinSelections respjson.Field
402+
Vocabulary respjson.Field
403403
ExtraFields map[string]respjson.Field
404404
raw string
405405
} `json:"-"`
@@ -1377,17 +1377,17 @@ func init() {
13771377
)
13781378
}
13791379

1380-
// The properties Instruction, Type, Vocabulary are required.
1380+
// The properties Instruction, Type are required.
13811381
type ExtensionConfigAITasksTaskSelectTagsParam struct {
13821382
// The question or instruction for the AI to analyze the image.
13831383
Instruction string `json:"instruction,required"`
1384-
// Array of possible tag values. Combined length of all strings must not exceed 500
1385-
// characters. Cannot contain the `%` character.
1386-
Vocabulary []string `json:"vocabulary,omitzero,required"`
13871384
// Maximum number of tags to select from the vocabulary.
13881385
MaxSelections param.Opt[int64] `json:"max_selections,omitzero"`
13891386
// Minimum number of tags to select from the vocabulary.
13901387
MinSelections param.Opt[int64] `json:"min_selections,omitzero"`
1388+
// Array of possible tag values. Combined length of all strings must not exceed 500
1389+
// characters. Cannot contain the `%` character.
1390+
Vocabulary []string `json:"vocabulary,omitzero"`
13911391
// Task type that analyzes the image and adds matching tags from a vocabulary.
13921392
//
13931393
// This field can be elided, and will marshal its zero value as "select_tags".
@@ -2181,17 +2181,17 @@ func init() {
21812181
)
21822182
}
21832183

2184-
// The properties Instruction, Type, Vocabulary are required.
2184+
// The properties Instruction, Type are required.
21852185
type ExtensionAITasksTaskSelectTagsParam struct {
21862186
// The question or instruction for the AI to analyze the image.
21872187
Instruction string `json:"instruction,required"`
2188-
// Array of possible tag values. Combined length of all strings must not exceed 500
2189-
// characters. Cannot contain the `%` character.
2190-
Vocabulary []string `json:"vocabulary,omitzero,required"`
21912188
// Maximum number of tags to select from the vocabulary.
21922189
MaxSelections param.Opt[int64] `json:"max_selections,omitzero"`
21932190
// Minimum number of tags to select from the vocabulary.
21942191
MinSelections param.Opt[int64] `json:"min_selections,omitzero"`
2192+
// Array of possible tag values. Combined length of all strings must not exceed 500
2193+
// characters. Cannot contain the `%` character.
2194+
Vocabulary []string `json:"vocabulary,omitzero"`
21952195
// Task type that analyzes the image and adds matching tags from a vocabulary.
21962196
//
21972197
// This field can be elided, and will marshal its zero value as "select_tags".

0 commit comments

Comments
 (0)