Skip to content

Commit 96ad1bb

Browse files
refactor: AITags to singular AITag schema with array items pattern
1 parent 823c3b6 commit 96ad1bb

File tree

5 files changed

+31
-32
lines changed

5 files changed

+31
-32
lines changed

.stats.yml

Lines changed: 3 additions & 3 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-7c4c23556be689ded6bcafd05e1645b82239521c9c841c0f7e76336e2eefcffa.yml
3-
openapi_spec_hash: eca5b039a0066c6536296248c3a80854
4-
config_hash: f914ebc9670f6e7c7751660caa4e5556
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-70c42eda2bee929830b2537f758400a58dded1f1ef5686a286e2469c35a041a0.yml
3+
openapi_spec_hash: cdaeed824e91657b45092765cf55eb42
4+
config_hash: e3c2679d25f6235381dfb11962fbf3d9

src/imagekitio/types/beta/v2/file_upload_response.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313

1414
class AITag(BaseModel):
15+
"""AI-generated tag associated with an image.
16+
17+
These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions.
18+
"""
19+
1520
confidence: Optional[float] = None
1621
"""Confidence score of the tag."""
1722

@@ -121,11 +126,7 @@ class FileUploadResponse(BaseModel):
121126
"""Object containing details of a successful upload."""
122127

123128
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
124-
"""Array of `AITags` associated with the image.
125-
126-
If no `AITags` are set, it will be null. These tags can be added using the
127-
`google-auto-tagging` or `aws-auto-tagging` extensions.
128-
"""
129+
"""An array of tags assigned to the uploaded file by auto tagging."""
129130

130131
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
131132
"""The audio codec used in the video (only for video)."""

src/imagekitio/types/file.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313

1414
class AITag(BaseModel):
15+
"""AI-generated tag associated with an image.
16+
17+
These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions.
18+
"""
19+
1520
confidence: Optional[float] = None
1621
"""Confidence score of the tag."""
1722

@@ -93,10 +98,9 @@ class File(BaseModel):
9398
"""Object containing details of a file or file version."""
9499

95100
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
96-
"""Array of `AITags` associated with the image.
101+
"""Array of AI-generated tags associated with the image.
97102
98-
If no `AITags` are set, it will be null. These tags can be added using the
99-
`google-auto-tagging` or `aws-auto-tagging` extensions.
103+
If no AITags are set, it will be null.
100104
"""
101105

102106
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
@@ -115,13 +119,7 @@ class File(BaseModel):
115119
"""An string with custom coordinates of the file."""
116120

117121
custom_metadata: Optional[Dict[str, object]] = FieldInfo(alias="customMetadata", default=None)
118-
"""A key-value data associated with the asset.
119-
120-
Use `responseField` in API request to get `customMetadata` in the upload API
121-
response. Before setting any custom metadata on an asset, you have to create the
122-
field using custom metadata fields API. Send `customMetadata` in
123-
`responseFields` in API request to get the value of this field.
124-
"""
122+
"""An object with custom metadata for the file."""
125123

126124
description: Optional[str] = None
127125
"""Optional text to describe the contents of the file.
@@ -135,9 +133,7 @@ class File(BaseModel):
135133
embedded_metadata: Optional[Dict[str, object]] = FieldInfo(alias="embeddedMetadata", default=None)
136134
"""Consolidated embedded metadata associated with the file.
137135
138-
It includes exif, iptc, and xmp data. Send `embeddedMetadata` in
139-
`responseFields` in API request to get embeddedMetadata in the upload API
140-
response.
136+
It includes exif, iptc, and xmp data.
141137
"""
142138

143139
file_id: Optional[str] = FieldInfo(alias="fileId", default=None)
@@ -213,7 +209,7 @@ class File(BaseModel):
213209
"""URL of the file."""
214210

215211
version_info: Optional[VersionInfo] = FieldInfo(alias="versionInfo", default=None)
216-
"""An object containing the file or file version's `id` (versionId) and `name`."""
212+
"""An object with details of the file version."""
217213

218214
video_codec: Optional[str] = FieldInfo(alias="videoCodec", default=None)
219215
"""The video codec used in the video (only for video)."""

src/imagekitio/types/file_upload_response.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313

1414
class AITag(BaseModel):
15+
"""AI-generated tag associated with an image.
16+
17+
These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions.
18+
"""
19+
1520
confidence: Optional[float] = None
1621
"""Confidence score of the tag."""
1722

@@ -121,11 +126,7 @@ class FileUploadResponse(BaseModel):
121126
"""Object containing details of a successful upload."""
122127

123128
ai_tags: Optional[List[AITag]] = FieldInfo(alias="AITags", default=None)
124-
"""Array of `AITags` associated with the image.
125-
126-
If no `AITags` are set, it will be null. These tags can be added using the
127-
`google-auto-tagging` or `aws-auto-tagging` extensions.
128-
"""
129+
"""An array of tags assigned to the uploaded file by auto tagging."""
129130

130131
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
131132
"""The audio codec used in the video (only for video)."""

src/imagekitio/types/upload_pre_transform_success_event.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323

2424
class UploadPreTransformSuccessEventDataAITag(BaseModel):
25+
"""AI-generated tag associated with an image.
26+
27+
These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions.
28+
"""
29+
2530
confidence: Optional[float] = None
2631
"""Confidence score of the tag."""
2732

@@ -131,11 +136,7 @@ class UploadPreTransformSuccessEventData(BaseModel):
131136
"""Object containing details of a successful upload."""
132137

133138
ai_tags: Optional[List[UploadPreTransformSuccessEventDataAITag]] = FieldInfo(alias="AITags", default=None)
134-
"""Array of `AITags` associated with the image.
135-
136-
If no `AITags` are set, it will be null. These tags can be added using the
137-
`google-auto-tagging` or `aws-auto-tagging` extensions.
138-
"""
139+
"""An array of tags assigned to the uploaded file by auto tagging."""
139140

140141
audio_codec: Optional[str] = FieldInfo(alias="audioCodec", default=None)
141142
"""The audio codec used in the video (only for video)."""

0 commit comments

Comments
 (0)