MeUtils 2025.1.17.19.49.29__py3-none-any.whl → 2025.1.27.15.5.31__py3-none-any.whl
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.
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/METADATA +27 -28
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/RECORD +46 -43
- examples/_openaisdk/4v.py +3 -4
- examples/_openaisdk/openai_baichuan.py +7 -3
- examples/_openaisdk/openai_chatfire.py +17 -4
- examples/_openaisdk/openai_deepinfra.py +2 -2
- examples/_openaisdk/openai_deepseek.py +7 -6
- examples/_openaisdk/openai_doubao.py +16 -7
- examples/_openaisdk/openai_embeddings.py +1 -1
- examples/_openaisdk/openai_modelscope.py +2 -1
- examples/_openaisdk/openai_together.py +2 -1
- meutils/apis/jimeng/lip_sync.py → examples/_openaisdk/openai_x.py +3 -2
- examples/_openaisdk/openai_zhipu.py +9 -5
- examples/bserver.py +60 -518
- examples/json_jmespath.py +13 -13
- meutils/apis/fal/videos.py +13 -7
- meutils/apis/hailuoai/videos.py +16 -6
- meutils/apis/hunyuan/image_tools.py +6 -2
- meutils/apis/images/edits.py +74 -6
- meutils/apis/images/recraft.py +5 -5
- meutils/apis/jimeng/common.py +2 -147
- meutils/apis/jimeng/doubao.py +2 -2
- meutils/apis/jimeng/files.py +84 -29
- meutils/apis/jimeng/images.py +177 -11
- meutils/apis/jimeng/videos.py +305 -0
- meutils/apis/oneapi/user.py +3 -1
- meutils/data/VERSION +1 -1
- meutils/io/files_utils.py +9 -3
- meutils/jwt_utils/common.py +46 -0
- meutils/llm/clients.py +4 -1
- meutils/llm/completions/agents/file.py +7 -4
- meutils/llm/completions/agents/search.py +115 -0
- meutils/parsers/fileparser/mineru.py +48 -0
- meutils/schemas/hailuo_types.py +8 -2
- meutils/schemas/image_types.py +19 -5
- meutils/schemas/oneapi/common.py +152 -45
- meutils/schemas/oneapi/models.py +1 -1
- meutils/schemas/openai_types.py +1 -1
- meutils/schemas/task_types.py +2 -0
- meutils/schemas/video_types.py +19 -1
- meutils/str_utils/json_utils.py +29 -1
- meutils/request_utils/jwt_utils/common.py +0 -42
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/LICENSE +0 -0
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/WHEEL +0 -0
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/top_level.txt +0 -0
- /meutils/{request_utils/jwt_utils → jwt_utils}/__init__.py +0 -0
meutils/schemas/image_types.py
CHANGED
@@ -62,10 +62,14 @@ class ImagesResponse(_ImagesResponse):
|
|
62
62
|
# class Config:
|
63
63
|
# extra = "allow"
|
64
64
|
|
65
|
+
|
65
66
|
class ImageRequest(BaseModel): # openai
|
67
|
+
"""
|
68
|
+
图生图 两种方式: prompt + controls
|
69
|
+
"""
|
66
70
|
model: str = ""
|
67
71
|
|
68
|
-
prompt: constr(min_length=1, max_length=
|
72
|
+
prompt: constr(min_length=1, max_length=3000) = ""
|
69
73
|
|
70
74
|
n: Optional[int] = 1
|
71
75
|
|
@@ -78,11 +82,12 @@ class ImageRequest(BaseModel): # openai
|
|
78
82
|
seed: Optional[int] = None
|
79
83
|
|
80
84
|
# oneapi
|
81
|
-
controls: dict = {} # 额外参数
|
82
|
-
|
83
85
|
negative_prompt: Optional[str] = None
|
84
86
|
guidance: Optional[int] = None
|
85
87
|
steps: Optional[int] = None
|
88
|
+
|
89
|
+
controls: dict = {} # 额外参数
|
90
|
+
|
86
91
|
safety_tolerance: Optional[int] = None
|
87
92
|
|
88
93
|
aspect_ratio: Optional[str] = None
|
@@ -454,12 +459,21 @@ class TextinImageProcessRequest(ImageProcessRequest):
|
|
454
459
|
|
455
460
|
|
456
461
|
class ImageProcess(BaseModel):
|
457
|
-
model: Literal[
|
462
|
+
model: Literal[
|
463
|
+
"remove-watermark",
|
464
|
+
"clarity",
|
465
|
+
|
466
|
+
"hunyuan-remove-watermark",
|
467
|
+
"hunyuan-clarity",
|
468
|
+
|
469
|
+
"expand",
|
470
|
+
"rmbg-2.0"
|
471
|
+
]
|
458
472
|
image: str
|
459
473
|
mask: Optional[str] = None
|
460
474
|
|
461
475
|
style: Optional[str] = None
|
462
|
-
aspect_ratio: Union[str, Literal["1:1", "4:3", "3:4"]] = "1:1"
|
476
|
+
aspect_ratio: Union[str, Literal["1:1", "4:3", "3:4"]] = "1:1" # 扩图
|
463
477
|
|
464
478
|
response_format: Literal["url", "b64_json"] = "url"
|
465
479
|
|
meutils/schemas/oneapi/common.py
CHANGED
@@ -14,7 +14,8 @@ from meutils.data.oneapi import NOTICE, FOOTER
|
|
14
14
|
BASE_URL = "https://api.chatfire.cn"
|
15
15
|
# BASE_URL = "https://api-dev.chatfire.cn"
|
16
16
|
FREE = 0.001
|
17
|
-
|
17
|
+
MJ_RELAX = 1
|
18
|
+
STEP = 2
|
18
19
|
|
19
20
|
MODEL_PRICE = {
|
20
21
|
"images": FREE,
|
@@ -22,9 +23,16 @@ MODEL_PRICE = {
|
|
22
23
|
"kling_image": 0.025,
|
23
24
|
"kling_virtual_try_on": 1,
|
24
25
|
|
25
|
-
"kling_video": 1,
|
26
|
-
"kling_extend": 1,
|
27
|
-
"kling_lip_sync": 1,
|
26
|
+
"kling_video": 1.2,
|
27
|
+
"kling_extend": 1.2,
|
28
|
+
"kling_lip_sync": 1.2,
|
29
|
+
|
30
|
+
"minimax_video-01": 1.2,
|
31
|
+
|
32
|
+
"minimax_t2v-01": 1.2,
|
33
|
+
"minimax_i2v-01": 1.2,
|
34
|
+
"minimax_i2v-01-live": 1.2,
|
35
|
+
"minimax_s2v-01": 1.2,
|
28
36
|
|
29
37
|
# chatfire
|
30
38
|
"ppu-0001": 0.0001,
|
@@ -92,8 +100,6 @@ MODEL_PRICE = {
|
|
92
100
|
"api-stt": 0.01,
|
93
101
|
"api-tts": 0.01,
|
94
102
|
|
95
|
-
"step-1x-medium": 0.1,
|
96
|
-
|
97
103
|
"kolors": 0.02,
|
98
104
|
"kling": 0.02,
|
99
105
|
|
@@ -116,6 +122,14 @@ MODEL_PRICE = {
|
|
116
122
|
"api-replicate-stable-diffusion-3.5-large-turbo": 0.040,
|
117
123
|
"api-replicate-stable-diffusion-3.5-medium": 0.035,
|
118
124
|
|
125
|
+
# sd
|
126
|
+
"stable-diffusion-xl-base-1.0": 0.01,
|
127
|
+
"stable-diffusion-2-1": 0.01,
|
128
|
+
"stable-diffusion": 0.01,
|
129
|
+
"stable-diffusion-3-medium": 0.02,
|
130
|
+
"stable-diffusion-3-5-large": 0.05,
|
131
|
+
"chat-stable-diffusion-3-5-large": 0.05,
|
132
|
+
|
119
133
|
"flux": 0.01,
|
120
134
|
"flux-schnell": 0.01,
|
121
135
|
"flux-dev": 0.03,
|
@@ -124,10 +138,8 @@ MODEL_PRICE = {
|
|
124
138
|
"flux.1.1-pro": 0.1,
|
125
139
|
"black-forest-labs/flux.1.1-pro": 0.1,
|
126
140
|
|
127
|
-
"
|
128
|
-
"chat-
|
129
|
-
|
130
|
-
"chat-step-1x-medium": 0.1 / 4,
|
141
|
+
"step-1x-medium": 0.2,
|
142
|
+
"chat-step-1x-medium": 0.2,
|
131
143
|
|
132
144
|
"chat-flux-schnell": 0.01,
|
133
145
|
"chat-flux-dev": 0.03,
|
@@ -146,6 +158,17 @@ MODEL_PRICE = {
|
|
146
158
|
|
147
159
|
# aitools
|
148
160
|
"api-aitools": 0.007,
|
161
|
+
"api-images-edits-remove-watermark": 0.01, # mask
|
162
|
+
"api-images-edits-remove-watermark-hunyuan": 0.01,
|
163
|
+
|
164
|
+
"api-images-edits-remove-watermark-textin": 0.02, # remove-watermark
|
165
|
+
|
166
|
+
"api-images-edits-clarity": 0.01,
|
167
|
+
"api-images-edits-clarity-hunyuan": 0.01,
|
168
|
+
"api-images-edits-clarity-baidu": 0.01, # 官方api
|
169
|
+
|
170
|
+
"api-images-edits-expand": 0.01,
|
171
|
+
"api-images-edits-rmbg-2.0": 0.01,
|
149
172
|
|
150
173
|
# 文档智能
|
151
174
|
"api-textin": 0.02,
|
@@ -169,7 +192,7 @@ MODEL_PRICE = {
|
|
169
192
|
"api-kling-v1.6-pro-10s": 2 * 0.8 * 1.75,
|
170
193
|
|
171
194
|
"api-vidu": 0.09,
|
172
|
-
"api-vidu-vip": 0.
|
195
|
+
"api-vidu-vip": 0.6,
|
173
196
|
|
174
197
|
"api-cogvideox": 0.1,
|
175
198
|
"api-cogvideox-vip": 0.4,
|
@@ -179,10 +202,11 @@ MODEL_PRICE = {
|
|
179
202
|
"api-translator": 0.0001,
|
180
203
|
"api-voice-clone": 0.01,
|
181
204
|
|
182
|
-
"suno_music": 0.
|
205
|
+
"suno_music": 0.25,
|
183
206
|
"suno_lyrics": 0.01,
|
184
|
-
|
185
|
-
"
|
207
|
+
"suno_uploads": 0.01,
|
208
|
+
"suno_upload": 0.01,
|
209
|
+
"suno_concat": 0.01,
|
186
210
|
|
187
211
|
# all
|
188
212
|
"o1-plus": 0.2,
|
@@ -232,22 +256,51 @@ MODEL_PRICE = {
|
|
232
256
|
"ai-search-pro": 0.1,
|
233
257
|
"ai-search-pro:scholar": 0.1,
|
234
258
|
|
235
|
-
|
236
|
-
"
|
237
|
-
|
238
|
-
"
|
239
|
-
"
|
240
|
-
"
|
241
|
-
"
|
242
|
-
"
|
243
|
-
|
244
|
-
"
|
245
|
-
"
|
246
|
-
"
|
247
|
-
"
|
248
|
-
"
|
249
|
-
"
|
250
|
-
"
|
259
|
+
# MJ
|
260
|
+
"mj-chat": 0.3,
|
261
|
+
|
262
|
+
"mj_fast_blend": 0.08,
|
263
|
+
"mj_fast_custom_oom": 0,
|
264
|
+
"mj_fast_describe": 0.04,
|
265
|
+
"mj_fast_high_variation": 0.08,
|
266
|
+
"mj_fast_imagine": 0.08,
|
267
|
+
"mj_fast_inpaint": 0,
|
268
|
+
"mj_fast_low_variation": 0.08,
|
269
|
+
"mj_fast_modal": 0.08,
|
270
|
+
"mj_fast_pan": 0.08,
|
271
|
+
"mj_fast_pic_reader": 0,
|
272
|
+
"mj_fast_prompt_analyzer": 0,
|
273
|
+
"mj_fast_prompt_analyzer_extended": 0,
|
274
|
+
"mj_fast_reroll": 0.08,
|
275
|
+
"mj_fast_shorten": 0.08,
|
276
|
+
"mj_fast_upload": 0.01,
|
277
|
+
"mj_fast_upscale": 0.04,
|
278
|
+
"mj_fast_upscale_creative": 0.08,
|
279
|
+
"mj_fast_upscale_subtle": 0.08,
|
280
|
+
"mj_fast_variation": 0.08,
|
281
|
+
"mj_fast_zoom": 0.08,
|
282
|
+
|
283
|
+
"mj_relax_imagine": 0.08 * 0.5,
|
284
|
+
|
285
|
+
"mj_relax_blend": 0.08,
|
286
|
+
"mj_relax_custom_oom": 0,
|
287
|
+
"mj_relax_describe": 0.04 * MJ_RELAX,
|
288
|
+
"mj_relax_high_variation": 0.08 * MJ_RELAX,
|
289
|
+
"mj_relax_inpaint": 0,
|
290
|
+
"mj_relax_low_variation": 0.08 * MJ_RELAX,
|
291
|
+
"mj_relax_modal": 0.08 * MJ_RELAX,
|
292
|
+
"mj_relax_pan": 0.08 * MJ_RELAX,
|
293
|
+
"mj_relax_pic_reader": 0,
|
294
|
+
"mj_relax_prompt_analyzer": 0,
|
295
|
+
"mj_relax_prompt_analyzer_extended": 0,
|
296
|
+
"mj_relax_reroll": 0.08 * MJ_RELAX,
|
297
|
+
"mj_relax_shorten": 0.08 * MJ_RELAX,
|
298
|
+
"mj_relax_upload": 0.01 * MJ_RELAX,
|
299
|
+
"mj_relax_upscale": 0.04 * 1,
|
300
|
+
"mj_relax_upscale_creative": 0.08 * 1,
|
301
|
+
"mj_relax_upscale_subtle": 0.08 * 1,
|
302
|
+
"mj_relax_variation": 0.08 * 1,
|
303
|
+
"mj_relax_zoom": 0.08 * MJ_RELAX,
|
251
304
|
|
252
305
|
}
|
253
306
|
|
@@ -359,10 +412,20 @@ MODEL_RATIO = {
|
|
359
412
|
'spark-ultra': 50,
|
360
413
|
|
361
414
|
# 阶跃星辰 https://platform.stepfun.com/docs/pricing/details
|
362
|
-
"step-1-
|
363
|
-
|
364
|
-
"step-
|
365
|
-
"step-
|
415
|
+
"step-1-flash": 0.5 * STEP,
|
416
|
+
|
417
|
+
"step-1-8k": 2.5 * STEP,
|
418
|
+
"step-1-32k": 7.5 * STEP,
|
419
|
+
"step-1-256k": 47.5 * STEP,
|
420
|
+
|
421
|
+
"step-2-16k": 19 * STEP,
|
422
|
+
"step-2-mini": 0.5 * STEP,
|
423
|
+
"step-2-16k-exp": 19 * STEP,
|
424
|
+
|
425
|
+
"step-1v-8k": 2.5 * STEP,
|
426
|
+
"step-1.5v-mini": 4 * STEP,
|
427
|
+
"step-1v-32k": 7.5 * STEP,
|
428
|
+
"step-1o-vision-32k": 7.5 * STEP,
|
366
429
|
|
367
430
|
# 零一万物 https://platform.lingyiwanwu.com/docs#%E8%AE%A1%E8%B4%B9%E5%8D%95%E5%85%83
|
368
431
|
"yi-spark": 0.05, # 特价
|
@@ -399,20 +462,29 @@ MODEL_RATIO = {
|
|
399
462
|
"deepseek-ai/DeepSeek-V3": 0.5,
|
400
463
|
"accounts/fireworks/models/deepseek-v3": 0.5,
|
401
464
|
|
402
|
-
|
465
|
+
"deepseek-r1:1.5b": 0.1,
|
466
|
+
"deepseek-r1:7b": 0.2,
|
467
|
+
'deepseek-r1': 2,
|
468
|
+
'deepseek-reasoner': 2,
|
403
469
|
'deepseek-think': 0.5,
|
404
470
|
"deepseek-search": 0.5,
|
405
471
|
|
406
472
|
# 豆包
|
407
473
|
"doubao-lite-128k": 0.4,
|
408
474
|
"doubao-lite-32k": 0.15,
|
475
|
+
"doubao-lite-32k-character": 0.15,
|
409
476
|
"doubao-lite-4k": 0.15,
|
477
|
+
"doubao-1.5-lite-32k": 0.3,
|
410
478
|
|
479
|
+
"doubao-pro-4k": 0.4,
|
480
|
+
"doubao-pro-32k": 0.4,
|
481
|
+
"doubao-pro-32k-character": 0.4,
|
482
|
+
"doubao-pro-128k": 2.5,
|
411
483
|
"doubao-pro-256k": 5,
|
484
|
+
"doubao-1.5-pro-32k": 0.8,
|
485
|
+
"doubao-1.5-pro-256k": 5,
|
412
486
|
|
413
|
-
"doubao-pro-
|
414
|
-
"doubao-pro-32k": 0.4,
|
415
|
-
"doubao-pro-4k": 0.4,
|
487
|
+
"doubao-1.5-vision-pro-32k": 3,
|
416
488
|
"doubao-vision-lite-32k": 0.75,
|
417
489
|
"doubao-vision-pro-32k": 1.5,
|
418
490
|
|
@@ -483,6 +555,7 @@ MODEL_RATIO = {
|
|
483
555
|
"gemini-1.0-pro-latest": 1,
|
484
556
|
"gemini-1.0-pro-vision-001": 1,
|
485
557
|
"gemini-1.0-pro-vision-latest": 1,
|
558
|
+
"gemini-exp-1206": 1,
|
486
559
|
|
487
560
|
"gemini-1.5-flash-002": 0.3, # 重定向到openrouter
|
488
561
|
"google/gemini-flash-1.5-8b": 0.3, # openrouter $0.0375 $0.15
|
@@ -495,6 +568,7 @@ MODEL_RATIO = {
|
|
495
568
|
"gemini-2.0-flash-exp": 0.5,
|
496
569
|
"gemini-2.0-flash-thinking-exp": 1,
|
497
570
|
"gemini-2.0-flash-thinking-exp-1219": 1,
|
571
|
+
"gemini-2.0-flash-thinking-exp-01-21": 1,
|
498
572
|
|
499
573
|
"gemini-1.5-pro-001": 1,
|
500
574
|
"gemini-1.5-pro-002": 1,
|
@@ -584,11 +658,11 @@ MODEL_RATIO = {
|
|
584
658
|
|
585
659
|
"internvl2-8b": 0.35 / 2,
|
586
660
|
"internvl2-26b": 1 / 2,
|
587
|
-
"internvl2-llama3-76b":
|
661
|
+
"internvl2-llama3-76b": 2,
|
588
662
|
|
589
|
-
"qwen2-vl-7b-instruct": 0.
|
590
|
-
"qwen2-vl-72b-instruct":
|
591
|
-
"Qwen/Qwen2-VL-72B-Instruct":
|
663
|
+
"qwen2-vl-7b-instruct": 0.5,
|
664
|
+
"qwen2-vl-72b-instruct": 2,
|
665
|
+
"Qwen/Qwen2-VL-72B-Instruct": 2,
|
592
666
|
|
593
667
|
# 临时
|
594
668
|
"ep-20240515073409-dlpqp": 5
|
@@ -656,10 +730,13 @@ COMPLETION_RATIO = {
|
|
656
730
|
"gemini-1.5-pro-002": 4,
|
657
731
|
"gemini-1.5-flash-002": 4,
|
658
732
|
|
733
|
+
"gemini-exp-1206": 5,
|
734
|
+
|
659
735
|
"gemini-2.0-flash": 5,
|
660
736
|
"gemini-2.0-flash-exp": 5,
|
661
737
|
"gemini-2.0-flash-thinking-exp": 5,
|
662
738
|
"gemini-2.0-flash-thinking-exp-1219": 5,
|
739
|
+
"gemini-2.0-flash-thinking-exp-01-21": 5,
|
663
740
|
|
664
741
|
"hunyuan-a52b-instruct": 5,
|
665
742
|
"qwen2.5-coder-32b-instruct": 3,
|
@@ -674,15 +751,34 @@ COMPLETION_RATIO = {
|
|
674
751
|
"qwen-max": 3,
|
675
752
|
"qwen-vl-max-latest": 3,
|
676
753
|
"qwen-vl-plus-latest": 3,
|
754
|
+
"qwen2-vl-7b-instruct": 5,
|
755
|
+
"qwen2-vl-72b-instruct": 5,
|
677
756
|
|
678
757
|
"deepseek-ai/deepseek-vl2": 3,
|
758
|
+
|
759
|
+
# 豆包
|
760
|
+
"doubao-lite-128k": 3,
|
761
|
+
"doubao-lite-32k": 3,
|
762
|
+
"doubao-lite-32k-character": 3,
|
763
|
+
"doubao-lite-4k": 3,
|
764
|
+
"doubao-1.5-lite-32k": 3,
|
765
|
+
|
766
|
+
"doubao-pro-4k": 3,
|
767
|
+
"doubao-pro-32k": 3,
|
768
|
+
"doubao-pro-32k-character": 3,
|
769
|
+
"doubao-pro-128k": 3,
|
770
|
+
"doubao-pro-256k": 3,
|
771
|
+
"doubao-1.5-pro-32k": 3,
|
772
|
+
"doubao-1.5-pro-256k": 3,
|
773
|
+
|
774
|
+
"doubao-1.5-vision-pro-32k": 3,
|
679
775
|
"doubao-vision-lite-32k": 3,
|
680
776
|
"doubao-vision-pro-32k": 3,
|
681
777
|
|
682
778
|
"deepseek-v3": 1,
|
683
|
-
'deepseek-r1': 1,
|
684
|
-
'deepseek-think': 1,
|
685
779
|
"deepseek-search": 1,
|
780
|
+
'deepseek-r1': 4,
|
781
|
+
'deepseek-reasoner': 4,
|
686
782
|
"deepseek/deepseek-chat": 1,
|
687
783
|
"deepseek-ai/DeepSeek-V3": 1,
|
688
784
|
"accounts/fireworks/models/deepseek-v3": 1,
|
@@ -691,6 +787,18 @@ COMPLETION_RATIO = {
|
|
691
787
|
"glm-zero-preview": 5,
|
692
788
|
"glm-4v-flash": 5,
|
693
789
|
|
790
|
+
"step-1-flash": 5,
|
791
|
+
"step-1-8k": 5,
|
792
|
+
"step-1-32k": 5,
|
793
|
+
"step-1-256k": 5,
|
794
|
+
"step-2-16k": 5,
|
795
|
+
"step-2-mini": 5,
|
796
|
+
"step-2-16k-exp": 5,
|
797
|
+
"step-1v-8k": 5,
|
798
|
+
"step-1v-32k": 5,
|
799
|
+
"step-1.5v-mini": 5,
|
800
|
+
"step-1o-vision-32k": 5,
|
801
|
+
|
694
802
|
}
|
695
803
|
|
696
804
|
REDIRECT_MODEL = {
|
@@ -871,7 +979,6 @@ GROUP_RATIO = {
|
|
871
979
|
|
872
980
|
}
|
873
981
|
|
874
|
-
|
875
982
|
# https://oss.ffire.cc/images/qw.jpeg?x-oss-process=image/format,jpg/resize,w_512
|
876
983
|
if __name__ == '__main__':
|
877
984
|
# print(','.join(REDIRECT_MODEL.keys()))
|
meutils/schemas/oneapi/models.py
CHANGED
meutils/schemas/openai_types.py
CHANGED
@@ -115,7 +115,7 @@ class ChatCompletionRequest(BaseModel):
|
|
115
115
|
stop: Optional[Union[str, List[str]]] = None
|
116
116
|
|
117
117
|
presence_penalty: Optional[float] = 0.0
|
118
|
-
frequency_penalty: Optional[float] =
|
118
|
+
frequency_penalty: Optional[float] = None
|
119
119
|
user: Optional[str] = None
|
120
120
|
|
121
121
|
# tools
|
meutils/schemas/task_types.py
CHANGED
@@ -24,6 +24,7 @@ STATUSES = {
|
|
24
24
|
"started": "QUEUED",
|
25
25
|
"pending": "QUEUED",
|
26
26
|
"PENDING": "QUEUED",
|
27
|
+
"Queueing": "QUEUED",
|
27
28
|
|
28
29
|
"processing": "IN_PROGRESS",
|
29
30
|
"in_progress": "IN_PROGRESS",
|
@@ -34,6 +35,7 @@ STATUSES = {
|
|
34
35
|
"success": "SUCCESS",
|
35
36
|
"succeeded": "SUCCESS",
|
36
37
|
|
38
|
+
"fail": "FAILURE",
|
37
39
|
"failed": "FAILURE",
|
38
40
|
"canceled": "FAILURE",
|
39
41
|
"FAILURE": "FAILURE",
|
meutils/schemas/video_types.py
CHANGED
@@ -54,9 +54,27 @@ class VideoRequest(BaseModel):
|
|
54
54
|
|
55
55
|
|
56
56
|
class FalVideoRequest(BaseModel):
|
57
|
-
model: Union[str, Literal["latentsync", "sync-lipsync",
|
57
|
+
model: Union[str, Literal["latentsync", "sync-lipsync",]] = 'latentsync'
|
58
58
|
video_url: Optional[str] = None
|
59
59
|
audio_url: Optional[str] = None
|
60
60
|
image_url: Optional[str] = None
|
61
61
|
|
62
62
|
sync_mode: Union[str, Literal["cut_off", "loop", "bounce"]] = "cut_off"
|
63
|
+
|
64
|
+
|
65
|
+
class LipsyncVideoRquest(BaseModel):
|
66
|
+
model: Union[str, Literal[
|
67
|
+
"latentsync", "sync-lipsync",
|
68
|
+
"lip_sync_avatar_std", "lip_sync_avatar_lively"
|
69
|
+
]
|
70
|
+
] = 'latentsync'
|
71
|
+
|
72
|
+
video_url: Optional[str] = None
|
73
|
+
audio_url: Optional[str] = None
|
74
|
+
image_url: Optional[str] = None
|
75
|
+
|
76
|
+
sync_mode: Union[str, Literal["cut_off", "loop", "bounce"]] = "cut_off"
|
77
|
+
|
78
|
+
|
79
|
+
if __name__ == '__main__':
|
80
|
+
print(LipsyncVideoRquest())
|
meutils/str_utils/json_utils.py
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
# @WeChat : 313303303
|
8
8
|
# @Software : PyCharm
|
9
9
|
# @Description : pd.io.json.json_normalize
|
10
|
+
|
11
|
+
# https://mangiucugna.github.io/json_repair/
|
12
|
+
# https://jsonpath.com/
|
13
|
+
|
10
14
|
import jsonpath
|
11
15
|
|
12
16
|
# json https://blog.csdn.net/freeking101/article/details/103048514
|
@@ -20,6 +24,7 @@ import jsonpath
|
|
20
24
|
# https://blog.csdn.net/weixin_44799217/article/details/127590589
|
21
25
|
|
22
26
|
from meutils.pipe import *
|
27
|
+
from json_repair import repair_json
|
23
28
|
|
24
29
|
|
25
30
|
def json2class(dic, class_name='Test'):
|
@@ -46,5 +51,28 @@ def json_loads(s):
|
|
46
51
|
return eval(s)
|
47
52
|
|
48
53
|
|
54
|
+
def json_path(obj, expr): # todo: 缓存
|
55
|
+
if isinstance(obj, dict):
|
56
|
+
pass
|
57
|
+
elif isinstance(obj, str):
|
58
|
+
obj = json_repair.loads(obj)
|
59
|
+
elif isinstance(obj, bytes):
|
60
|
+
obj = json_repair.loads(obj.decode())
|
61
|
+
elif isinstance(obj, BaseModel):
|
62
|
+
obj = obj.dict()
|
63
|
+
|
64
|
+
return jsonpath.jsonpath(obj, expr=expr)
|
65
|
+
|
66
|
+
|
49
67
|
if __name__ == '__main__':
|
50
|
-
print(
|
68
|
+
print(json_path({"a": 1}, expr='$.a'))
|
69
|
+
print(json_path("""{"a": 1}""", expr='$.a'))
|
70
|
+
|
71
|
+
json_string = """{"a": 1}"""
|
72
|
+
|
73
|
+
|
74
|
+
class A(BaseModel):
|
75
|
+
a: int = 1
|
76
|
+
|
77
|
+
|
78
|
+
print(json_path(A(), '$.a'))
|
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : common
|
5
|
-
# @Time : 2024/10/28 20:57
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
|
13
|
-
import jwt
|
14
|
-
import time
|
15
|
-
import datetime
|
16
|
-
|
17
|
-
# Header and payload
|
18
|
-
header = {
|
19
|
-
"alg": "HS256",
|
20
|
-
"typ": "JWT"
|
21
|
-
}
|
22
|
-
|
23
|
-
payload = {
|
24
|
-
"exp": int(time.time()) + 3600, # 1 hour from now
|
25
|
-
"user": {
|
26
|
-
"id": "302833867771949058",
|
27
|
-
"name": "me better",
|
28
|
-
"avatar": "https://lh3.googleusercontent.com/a/ACg8ocIgSSChs1D4sTj1STk7PsTm7y53JDX99o8BxpZcV6560AJbRg=s96-c",
|
29
|
-
"deviceID": ""
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
# Your secret key
|
34
|
-
secret = ""
|
35
|
-
|
36
|
-
|
37
|
-
# Create the JWT
|
38
|
-
token = jwt.encode(payload, secret, algorithm="HS256", headers=header)
|
39
|
-
|
40
|
-
print(token)
|
41
|
-
|
42
|
-
jwt.decode(token, secret, algorithms=["HS256"])
|
File without changes
|
File without changes
|
{MeUtils-2025.1.17.19.49.29.dist-info → MeUtils-2025.1.27.15.5.31.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|