alltoken 0.2.26__tar.gz → 0.2.28__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alltoken
3
- Version: 0.2.26
3
+ Version: 0.2.28
4
4
  Summary: Official Python SDK for AllToken — one API for OpenAI, Anthropic, and 100+ models.
5
5
  Project-URL: Homepage, https://alltoken.ai
6
6
  Project-URL: Repository, https://github.com/alltoken-ai/alltoken-python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "alltoken"
7
- version = "0.2.26"
7
+ version = "0.2.28"
8
8
  description = "Official Python SDK for AllToken — one API for OpenAI, Anthropic, and 100+ models."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: anthropic.yml
3
- # timestamp: 2026-06-04T01:37:43+00:00
3
+ # timestamp: 2026-06-10T06:25:25+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: chat.yml
3
- # timestamp: 2026-06-04T01:37:42+00:00
3
+ # timestamp: 2026-06-10T06:25:25+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -1019,42 +1019,6 @@ class Moderation(Enum):
1019
1019
  low = "low"
1020
1020
 
1021
1021
 
1022
- class ImageEditMultipartRequest(BaseModel):
1023
- model: Annotated[str, Field(examples=["gpt-image-2"])]
1024
- image: bytes
1025
- """
1026
- 源图,必填。≤ 25MB,MIME ∈ `image/png` / `image/jpeg` / `image/webp`。
1027
- """
1028
- prompt: Annotated[str, Field(max_length=32000)]
1029
- """
1030
- 编辑提示词,必填。
1031
- """
1032
- mask: bytes | None = None
1033
- """
1034
- 可选 mask 图;提供则按 mask_edit 处理(透明区域为编辑区)。≤ 25MB,同 MIME 约束。
1035
- """
1036
- n: Annotated[int | None, Field(ge=1, le=10)] = 1
1037
- """
1038
- 单次生成张数,1-10。
1039
- """
1040
- size: Annotated[str | None, Field(examples=["1024x1024"])] = "auto"
1041
- """
1042
- `auto` 或 `WIDTHxHEIGHT`;gpt-image-2 起支持任意分辨率(16 整除、最大 3840x2160、比例 1:3 ~ 3:1)。
1043
- """
1044
- quality: Quality | None = "auto"
1045
- output_format: OutputFormat | None = "png"
1046
- output_compression: Annotated[int | None, Field(ge=0, le=100)] = None
1047
- """
1048
- 仅 jpeg / webp 生效,0-100;未传则上游默认 100。
1049
- """
1050
- background: Background | None = "auto"
1051
- moderation: Moderation | None = "auto"
1052
- user: str | None = None
1053
- """
1054
- 透传上游用于滥用监控。
1055
- """
1056
-
1057
-
1058
1022
  class ImageEditUploadIDRequest(BaseModel):
1059
1023
  model: Annotated[str, Field(examples=["gpt-image-2"])]
1060
1024
  image_upload_id: str
@@ -1086,19 +1050,6 @@ class Size(Enum):
1086
1050
  field_1024x1536 = "1024x1536"
1087
1051
 
1088
1052
 
1089
- class ImageVariationMultipartRequest(BaseModel):
1090
- model: Annotated[str, Field(examples=["dall-e-2"])]
1091
- image: bytes
1092
- """
1093
- 源图,必填。≤ 25MB,MIME ∈ `image/png` / `image/jpeg` / `image/webp`。
1094
- """
1095
- size: Size | None = "auto"
1096
- user: str | None = None
1097
- """
1098
- 透传上游用于滥用监控。
1099
- """
1100
-
1101
-
1102
1053
  class ImageVariationUploadIDRequest(BaseModel):
1103
1054
  model: Annotated[str, Field(examples=["dall-e-2"])]
1104
1055
  image_upload_id: str
@@ -1134,6 +1085,10 @@ class ImageGenerationRequest(BaseModel):
1134
1085
  """
1135
1086
  background: Background | None = "auto"
1136
1087
  moderation: Moderation | None = "auto"
1088
+ seed: Annotated[int | None, Field(ge=0, le=2147483647)] = None
1089
+ """
1090
+ 仅 `wan2.7-image` / `wan2.7-image-pro` 生效,透传到 DashScope Wan `parameters.seed`;其它图像模型不保证生效。
1091
+ """
1137
1092
  user: str | None = None
1138
1093
  """
1139
1094
  透传上游用于滥用监控。
@@ -1213,6 +1168,192 @@ class ImageError(BaseModel):
1213
1168
  message: str
1214
1169
 
1215
1170
 
1171
+ class ThreedInput(BaseModel):
1172
+ """
1173
+ 三选一互斥(prompt xor image xor images);按模型 capability 校验,跨族错配返 400。
1174
+ """
1175
+
1176
+ prompt: Annotated[str | None, Field(max_length=1024)] = None
1177
+ """
1178
+ 文生 3D 提示词(仅 tripo 支持)
1179
+ """
1180
+ image: AnyUrl | None = None
1181
+ """
1182
+ 单图生 3D 图片 URL(tripo + seed3d 支持;仅 https,禁 base64,SSRF 黑名单校验)
1183
+ """
1184
+ images: list[AnyUrl] | None = None
1185
+ """
1186
+ 多图生 3D(仅 tripo 支持,2-4 张 URL)
1187
+ """
1188
+
1189
+
1190
+ class DetailLevel(Enum):
1191
+ """
1192
+ 公共档位。
1193
+ - seed3d-2.0:直接映射 `--subdivisionlevel low/medium/high`
1194
+ - tripo-h3.1:low/medium → 上游 geometry_quality=standard;high → ultra
1195
+ - tripo-p1.0:仅接受 low/medium(不接 high,上游无 ultra 档位)
1196
+
1197
+ """
1198
+
1199
+ low = "low"
1200
+ medium = "medium"
1201
+ high = "high"
1202
+
1203
+
1204
+ class TextureQuality(Enum):
1205
+ """
1206
+ 仅 tripo 系列;seed3d 传入返 400
1207
+ """
1208
+
1209
+ standard = "standard"
1210
+ detailed = "detailed"
1211
+
1212
+
1213
+ class FileFormat(Enum):
1214
+ """
1215
+ 输出文件格式(仅 seed3d;tripo 固定 glb)
1216
+ """
1217
+
1218
+ glb = "glb"
1219
+ obj = "obj"
1220
+ usd = "usd"
1221
+ usdz = "usdz"
1222
+
1223
+
1224
+ class ThreedParameters(BaseModel):
1225
+ """
1226
+ 公共参数;不在模型 capability 接受集内的字段传入会返 400 `param_not_supported_for_model`(不静默忽略)。
1227
+ """
1228
+
1229
+ detail_level: DetailLevel | None = "medium"
1230
+ """
1231
+ 公共档位。
1232
+ - seed3d-2.0:直接映射 `--subdivisionlevel low/medium/high`
1233
+ - tripo-h3.1:low/medium → 上游 geometry_quality=standard;high → ultra
1234
+ - tripo-p1.0:仅接受 low/medium(不接 high,上游无 ultra 档位)
1235
+
1236
+ """
1237
+ texture_quality: TextureQuality | None = "standard"
1238
+ """
1239
+ 仅 tripo 系列;seed3d 传入返 400
1240
+ """
1241
+ pbr: bool | None = True
1242
+ """
1243
+ 是否生成 PBR 材质(仅 tripo)
1244
+ """
1245
+ texture: bool | None = True
1246
+ """
1247
+ 是否生成贴图(仅 tripo)
1248
+ """
1249
+ file_format: FileFormat | None = "glb"
1250
+ """
1251
+ 输出文件格式(仅 seed3d;tripo 固定 glb)
1252
+ """
1253
+
1254
+
1255
+ class Object6(Enum):
1256
+ threed_generation = "threed.generation"
1257
+
1258
+
1259
+ class Status7(Enum):
1260
+ """
1261
+ 注意:completed 任务过期时 status **保留为 completed**,过期信号通过 `is_expired=true` + HTTP 410 + `error.code=result_expired` 表达。
1262
+
1263
+ """
1264
+
1265
+ queued = "queued"
1266
+ processing = "processing"
1267
+ cancelling = "cancelling"
1268
+ completed = "completed"
1269
+ failed = "failed"
1270
+ cancelled = "cancelled"
1271
+ expired = "expired"
1272
+
1273
+
1274
+ class InputMode(Enum):
1275
+ text = "text"
1276
+ single_image = "single_image"
1277
+ multi_image = "multi_image"
1278
+
1279
+
1280
+ class ThreedAsset(BaseModel):
1281
+ role: str
1282
+ """
1283
+ 资产类型。OpenAPI 用 string 而非 enum(未来供应商可能新增 role)。已知值:
1284
+ - `textured_model`:tripo PBR 带贴图模型
1285
+ - `base_mesh`:tripo 基础几何无贴图
1286
+ - `preview`:tripo 预览渲染图
1287
+ - `archive`:seed3d zip(含 contained_formats[])
1288
+
1289
+ """
1290
+ format: str
1291
+ """
1292
+ 文件格式(glb / png / zip / 未来 fbx / obj 等)
1293
+ """
1294
+ url: AnyUrl
1295
+ """
1296
+ 上游签名 URL 或固定 URL(无签名);按 expires_at 失效
1297
+ """
1298
+ mime_type: str | None = None
1299
+ """
1300
+ MIME 类型(`model/gltf-binary` / `image/png` / `application/zip`)
1301
+ """
1302
+ expires_at: AwareDatetime | None = None
1303
+ """
1304
+ 该 asset 的失效时间
1305
+ """
1306
+ contained_formats: list[str] | None = None
1307
+ """
1308
+ 仅 role=archive 填,描述压缩包内的文件格式(如 `[glb]`)
1309
+ """
1310
+
1311
+
1312
+ class TaskType(Enum):
1313
+ text_to_3d = "text_to_3d"
1314
+ image_to_3d = "image_to_3d"
1315
+
1316
+
1317
+ class DetailLevel1(Enum):
1318
+ """
1319
+ 请求参数回显
1320
+ """
1321
+
1322
+ low = "low"
1323
+ medium = "medium"
1324
+ high = "high"
1325
+
1326
+
1327
+ class ThreedUsage(BaseModel):
1328
+ task_type: TaskType | None = None
1329
+ count: int | None = None
1330
+ """
1331
+ 通常 1
1332
+ """
1333
+ detail_level: DetailLevel1 | None = None
1334
+ """
1335
+ 请求参数回显
1336
+ """
1337
+ texture_quality: str | None = None
1338
+ """
1339
+ 仅 tripo
1340
+ """
1341
+ file_format: str | None = None
1342
+ """
1343
+ 仅 seed3d
1344
+ """
1345
+ completion_tokens: int | None = None
1346
+ """
1347
+ 仅 seed3d;火山按 token 计费的审计字段(v1 chat 侧按任务计费)
1348
+ """
1349
+
1350
+
1351
+ class ThreedError(BaseModel):
1352
+ code: str
1353
+ type: str | None = None
1354
+ message: str
1355
+
1356
+
1216
1357
  class CreateVisualValidateSessionRequest(BaseModel):
1217
1358
  callback_url: Annotated[AnyUrl, Field(alias="CallbackURL")]
1218
1359
  """
@@ -1668,6 +1809,51 @@ class ImageGenerationResponse(BaseModel):
1668
1809
  """
1669
1810
 
1670
1811
 
1812
+ class ThreedGenerationRequest(BaseModel):
1813
+ model: Annotated[str, Field(examples=["tripo-h3.1"])]
1814
+ """
1815
+ 网关模型 ID(`tripo-h3.1` / `tripo-p1.0` / `seed3d-2.0`)
1816
+ """
1817
+ input: ThreedInput
1818
+ parameters: ThreedParameters | None = None
1819
+
1820
+
1821
+ class ThreedGenerationResponse(BaseModel):
1822
+ id: Annotated[str, Field(examples=["td3d_a1b2c3d4e5f6a7b8c9d0e1f2"])]
1823
+ """
1824
+ 任务 ID,前缀 `td3d_`
1825
+ """
1826
+ object: Object6
1827
+ status: Status7
1828
+ """
1829
+ 注意:completed 任务过期时 status **保留为 completed**,过期信号通过 `is_expired=true` + HTTP 410 + `error.code=result_expired` 表达。
1830
+
1831
+ """
1832
+ model: str
1833
+ input_mode: InputMode | None = None
1834
+ assets: list[ThreedAsset] | None = None
1835
+ """
1836
+ 仅 status=completed 时填;按 model api_format 投影(tripo 3 资产 / seed3d 单 archive)
1837
+ """
1838
+ expires_at: AwareDatetime | None = None
1839
+ """
1840
+ 顶层 expires_at = min(assets[].expires_at)
1841
+ """
1842
+ expires_in: int | None = None
1843
+ """
1844
+ 距离 expires_at 的剩余秒数
1845
+ """
1846
+ is_expired: bool
1847
+ """
1848
+ 仅 completed 状态有意义;true 时 HTTP 410 + error.code=result_expired
1849
+ """
1850
+ usage: ThreedUsage | None = None
1851
+ error: ThreedError | None = None
1852
+ created_at: AwareDatetime
1853
+ updated_at: AwareDatetime | None = None
1854
+ completed_at: AwareDatetime | None = None
1855
+
1856
+
1671
1857
  class Error1(BaseModel):
1672
1858
  code: Annotated[PortraitErrorCode, Field(alias="Code")]
1673
1859
  message: Annotated[str, Field(alias="Message")]
File without changes
File without changes
File without changes
File without changes