MeUtils 2025.5.1.20.22.23__py3-none-any.whl → 2025.5.7.20.22.52__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.
@@ -48,7 +48,7 @@ async def edit_channel(models, token: Optional[str] = None):
48
48
  "auto_ban": 0,
49
49
  "other_info": "",
50
50
 
51
- "group": "default,openai,china,chatfire,enterprise", # ','.join(GROUP_RATIO),
51
+ "group": "default,openai,chatfire,enterprise", # ','.join(GROUP_RATIO),
52
52
  "groups": ['default']
53
53
  }
54
54
  headers = {
@@ -159,3 +159,45 @@ if __name__ == '__main__':
159
159
  # arun(create_or_update_channel(tokens))
160
160
  # # arun(delete_channel(range(10000, 20000)))
161
161
 
162
+
163
+ """
164
+ API_KEY=6c255307-7b4d-4be8-984b-5440a3e867eb
165
+ curl --location --request POST 'https://api.ffire.cc/api/channel/' \
166
+ --header 'new-api-user: 1' \
167
+ --header 'Authorization: Bearer 20ff7099a62f441287f47c86431a7f12' \
168
+ --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
169
+ --header 'content-type: application/json' \
170
+ --data-raw '{
171
+ "type": 8,
172
+ "key": "${API_KEY}",
173
+ "openai_organization": "",
174
+ "test_model": "",
175
+ "status": 1,
176
+ "name": "火山-超刷",
177
+ "weight": 0,
178
+ "created_time": 1746166915,
179
+ "test_time": 1746156171,
180
+ "response_time": 878,
181
+ "base_url": "https://ark.cn-beijing.volces.com/api/v3/chat/completions",
182
+ "other": "",
183
+ "balance": 0,
184
+ "balance_updated_time": 0,
185
+ "models": "doubao-1.5-vision-pro-250328,deepseek-v3,deepseek-v3-0324,deepseek-v3-250324,deepseek-v3-8k,deepseek-v3-128k,deepseek-chat,deepseek-chat-8k,deepseek-chat-64k,deepseek-chat-164k,deepseek-chat:function,deepseek-vl2,deepseek-ai/deepseek-vl2,deepseek-r1,deepseek-r1-8k,deepseek-reasoner,deepseek-reasoner-8k,deepseek-r1-250120,deepseek-search,deepseek-r1-search,deepseek-reasoner-search,deepseek-r1-think,deepseek-reasoner-think,deepseek-r1-plus,deepseek-r1:1.5b,deepseek-r1-lite,deepseek-r1-distill-qwen-1.5b,deepseek-r1:7b,deepseek-r1-distill-qwen-7b,deepseek-r1:8b,deepseek-r1-distill-llama-8b,deepseek-r1:14b,deepseek-r1-distill-qwen-14b,deepseek-r1:32b,deepseek-r1-distill-qwen-32b,deepseek-r1:70b,deepseek-r1-distill-llama-70b,deepseek-r1-metasearch,doubao-1-5-pro-32k,doubao-1-5-pro-32k-250115,doubao-1-5-pro-256k,doubao-1-5-pro-256k-250115,doubao-1-5-vision-pro-32k,doubao-1-5-vision-pro-32k-250115,doubao-lite-128k,doubao-lite-32k,doubao-lite-32k-character,doubao-lite-4k,doubao-1.5-lite-32k,doubao-pro-4k,doubao-pro-32k,doubao-pro-32k-character,doubao-pro-128k,doubao-pro-256k,doubao-1.5-pro-32k,doubao-1.5-pro-256k,doubao-1.5-vision-pro-32k,doubao-vision-lite-32k,doubao-vision-pro-32k,doubao-1-5-pro-thinking,doubao-1-5-vision-thinking,doubao-1-5-thinking-pro-250415,doubao-1-5-thinking-pro-vision,doubao-1-5-thinking-pro-vision-250415,doubao-1-5-thinking-pro-m-250415,moonshot-v1-8k,moonshot-v1-32k,moonshot-v1-128k",
186
+ "group": "default,deepseek,volcengine",
187
+ "used_quota": 0,
188
+ "model_mapping": "{\n \"deepseek-r1\": \"deepseek-r1-250120\",\n \"deepseek-reasoner\": \"deepseek-r1-250120\",\n \"deepseek-v3-0324\": \"deepseek-v3-250324\",\n \"deepseek-v3\": \"deepseek-v3-250324\",\n \"deepseek-chat\": \"deepseek-v3-250324\",\n \"doubao-1-5-vision-pro-32k\": \"doubao-1-5-vision-pro-32k-250115\",\n \"doubao-1.5-vision-pro-32k\": \"doubao-1-5-vision-pro-32k-250115\",\n \"doubao-pro-32k\": \"doubao-1-5-pro-32k-250115\",\n \"doubao-pro-256k\": \"doubao-1-5-pro-256k-250115\",\n \"doubao-1.5-lite-32k\": \"doubao-1-5-lite-32k-250115\",\n \"doubao-lite-4k\": \"doubao-1-5-lite-32k-250115\",\n \"doubao-lite-32k\": \"doubao-1-5-lite-32k-250115\",\n \"doubao-lite-128k\": \"doubao-lite-128k-240828\",\n \"doubao-pro-128k\": \"doubao-1-5-pro-256k-250115\",\n \"doubao-1.5-lite\": \"doubao-1-5-lite-32k-250115\",\n \"doubao-vision-lite-32k\": \"doubao-vision-lite-32k-241015\",\n \"doubao-vision-pro-32k\": \"doubao-1-5-vision-pro-32k-250115\",\n \"doubao-1.5-pro-32k\": \"doubao-1-5-pro-32k-250115\",\n \"doubao-1.5-pro-256k\": \"doubao-1-5-pro-256k-250115\",\n \"doubao-1-5-thinking-pro\": \"doubao-1-5-thinking-pro-250415\",\n \"doubao-1-5-thinking-pro-vision\": \"doubao-1-5-thinking-pro-vision-250415\"\n}",
189
+ "status_code_mapping": "",
190
+ "priority": 999,
191
+ "auto_ban": 1,
192
+ "other_info": "",
193
+ "settings": "",
194
+ "tag": "火山",
195
+ "setting": null,
196
+ "param_override": null,
197
+ "groups": [
198
+ "default",
199
+ "deepseek",
200
+ "volcengine"
201
+ ]
202
+ }'
203
+ """
@@ -15,12 +15,15 @@ https://www.volcengine.com/docs/6791/1384311
15
15
  import os
16
16
 
17
17
  from meutils.pipe import *
18
+ from meutils.decorators.retry import retrying
19
+
18
20
  from meutils.io.files_utils import to_url
19
21
  from meutils.schemas.image_types import ImageRequest, ImagesResponse
20
22
 
21
23
  from volcengine.visual.VisualService import VisualService
22
24
 
23
25
 
26
+ @retrying(min=3, max=5)
24
27
  async def generate(request: ImageRequest, token: Optional[str] = None):
25
28
  """
26
29
 
meutils/data/VERSION CHANGED
@@ -1 +1 @@
1
- 2025.05.01.20.22.23
1
+ 2025.05.07.20.22.52
@@ -85,12 +85,9 @@ class Completions(object):
85
85
  if not request.reasoning_effort: # 默认关闭思考
86
86
  data['reasoning_effort'] = "none"
87
87
 
88
- if "gemini-2.5-pro" in request.model: ####### 关闭失效
89
- data['reasoning_effort'] = "low"
90
-
91
88
  if "thinking" in request.model:
92
89
  data['model'] = data['model'].removesuffix("-thinking") # 开启思考
93
- data['reasoning_effort'] = None
90
+ data['reasoning_effort'] = 'low'
94
91
 
95
92
  logger.debug(data)
96
93
  return await self.client.chat.completions.create(**data)
@@ -106,6 +106,11 @@ MODEL_PRICE = {
106
106
  "official-api-hailuo-video": 0.5,
107
107
  "api-hailuo-video": 0.3,
108
108
 
109
+ "api-videos-seedream-3.0": 0.5,
110
+
111
+ "api-kling-video/v2/master/text-to-video": 5,
112
+ "api-kling-video/v2/master/image-to-video": 5,
113
+
109
114
  # delle3
110
115
  "api-images-kling": 0.04,
111
116
  "api-images-hunyuan": 0.04,
@@ -647,6 +652,8 @@ MODEL_RATIO = {
647
652
  "doubao-1.5-pro-256k": 5 / 2,
648
653
 
649
654
  "doubao-1.5-vision-pro-32k": 1.5,
655
+ "doubao-1.5-vision-pro-250328": 1.5,
656
+
650
657
  "doubao-vision-lite-32k": 0.75,
651
658
  "doubao-vision-pro-32k": 1.5,
652
659
 
@@ -759,13 +766,14 @@ MODEL_RATIO = {
759
766
  "gemini-2.0-flash-thinking-exp-1219": 1,
760
767
  "gemini-2.0-flash-thinking-exp-01-21": 1,
761
768
 
762
- "gemini-2.5-flash-preview-04-17": 0.15,
769
+ "gemini-2.5-flash-preview-04-17": 0.075,
763
770
 
764
771
  "gemini-2.0-pro": 0.625,
765
772
  "gemini-2.0-pro-exp": 0.625,
766
773
  "gemini-2.0-pro-exp-02-05": 0.625,
767
774
  "gemini-2.5-pro-exp-03-25": 0.625,
768
775
  "gemini-2.5-pro-preview-03-25": 0.625,
776
+ "gemini-2.5-pro-preview-05-06": 0.625,
769
777
 
770
778
  "gemini-1.5-pro-001": 1.25,
771
779
  "gemini-1.5-pro-002": 1.25,
@@ -778,7 +786,7 @@ MODEL_RATIO = {
778
786
  "gemini-pro-vision": 1,
779
787
  "gemini-ultra": 1,
780
788
 
781
- "gemini-2.5-flash-thinking": 0.15 * 2,
789
+ "gemini-2.5-flash-thinking": 0.15,
782
790
  "gemini-2.5-flash-preview-04-17-thinking": 0.15 * 2,
783
791
  "gemini-2.5-pro-thinking": 0.625 * 2,
784
792
  "gemini-2.5-pro-exp-03-25-thinking": 0.625 * 2,
@@ -888,8 +896,9 @@ MODEL_RATIO = {
888
896
  "Qwen/Qwen2-VL-72B-Instruct": 2,
889
897
 
890
898
  # 临时
891
- "ep-20240515073409-dlpqp": 5,
892
- "microsoft/phi-4": 0.035 * 5,
899
+ "microsoft/phi-4": 0.035,
900
+ "microsoft/phi-4-reasoning": 0.035,
901
+ "microsoft/phi-4-reasoning-plus": 0.035 * 2,
893
902
  "mistral-small-3.1-24b-instruct": 0.1,
894
903
  "mistral-small-24b-instruct-2501": 0.1,
895
904
 
@@ -1033,6 +1042,7 @@ COMPLETION_RATIO = {
1033
1042
  "gemini-2.0-pro-exp-02-05": 5,
1034
1043
  "gemini-2.5-pro-exp-03-25": 8,
1035
1044
  "gemini-2.5-pro-preview-03-25": 8,
1045
+ "gemini-2.5-pro-preview-05-06": 8,
1036
1046
 
1037
1047
  "gemma2-9b-it": 4,
1038
1048
  "gemma2-27b-it": 4,
@@ -1114,6 +1124,8 @@ COMPLETION_RATIO = {
1114
1124
  "doubao-1.5-pro-256k": 3,
1115
1125
 
1116
1126
  "doubao-1.5-vision-pro-32k": 3,
1127
+ "doubao-1.5-vision-pro-250328": 3,
1128
+
1117
1129
  "doubao-1-5-vision-pro-32k": 3,
1118
1130
  "doubao-1-5-vision-pro-32k-250115": 3,
1119
1131
 
@@ -1362,7 +1374,9 @@ REDIRECT_MODEL = {
1362
1374
  "tune-mythomax-l2-13b": "rohan/tune-mythomax-l2-13b",
1363
1375
  "tune-wizardlm-2-8x22b": "rohan/tune-wizardlm-2-8x22b",
1364
1376
 
1365
- "microsoft/phi-4": 2,
1377
+ "microsoft/phi-4": 5,
1378
+ "microsoft/phi-4-reasoning": 5,
1379
+ "microsoft/phi-4-reasoning-plus": 5,
1366
1380
 
1367
1381
  }
1368
1382
 
@@ -1401,5 +1415,4 @@ if __name__ == '__main__':
1401
1415
  print([k for k in MODEL_RATIO if k.startswith('gpt-4.1')] | xjoin(","))
1402
1416
  print([k for k in MODEL_RATIO if k.startswith('qwen3')] | xjoin(","))
1403
1417
 
1404
- print([k for k in MODEL_RATIO if k.startswith(('deepseek', 'doubao'))] | xjoin(","))
1405
-
1418
+ print([k for k in MODEL_RATIO if k.startswith(('deepseek', 'doubao', 'moon'))] | xjoin(","))
@@ -12,15 +12,17 @@ from meutils.pipe import *
12
12
 
13
13
 
14
14
  class VideoRequest(BaseModel):
15
- model: Literal["cogvideox-flash", "cogvideox"] = "cogvideox-flash"
15
+ model: Union[str, Literal["cogvideox-flash", "cogvideox"]] = "cogvideox-flash"
16
16
 
17
17
  prompt: str = "比得兔开小汽车,游走在马路上,脸上的表情充满开心喜悦。"
18
+ negative_prompt: Optional[str] = None
18
19
 
19
20
  """
20
21
  提供基于其生成内容的图像。如果传入此参数,系统将以该图像为基础进行操作。支持通过URL或Base64编码传入图片。
21
22
  图片要求如下:图片支持.png、jpeg、.jpg 格式、图片大小:不超过5M。image_url和prompt二选一或者同时传入。
22
23
  """
23
24
  image_url: Optional[str] = None
25
+ tail_image_url: Optional[str] = None
24
26
 
25
27
  """
26
28
  输出模式,默认为 "quality"。 "quality":质量优先,生成质量高。 "speed":速度优先,生成时间更快,质量相对降低。
@@ -31,10 +33,14 @@ class VideoRequest(BaseModel):
31
33
  """是否生成 AI 音效。默认值: False(不生成音效)。"""
32
34
  with_audio: bool = True
33
35
 
36
+ cfg_scale: Optional[float] = None
37
+
34
38
  """
35
39
  默认值: 若不指定,默认生成视频的短边为 1080,长边根据原图片比例缩放。最高支持 4K 分辨率。
36
40
  分辨率选项:720x480、1024x1024、1280x960、960x1280、1920x1080、1080x1920、2048x1080、3840x2160
37
41
  """
42
+ aspect_ratio: Union[str, Literal["1:1", "21:9", "16:9", "9:16", "4:3", "3:4"]] = "16:9"
43
+
38
44
  size: Literal[
39
45
  '720x480',
40
46
  '1024x1024',
@@ -62,7 +68,20 @@ class FalVideoRequest(BaseModel):
62
68
  sync_mode: Union[str, Literal["cut_off", "loop", "bounce"]] = "cut_off"
63
69
 
64
70
 
65
- class LipsyncVideoRquest(BaseModel):
71
+ class FalKlingVideoRequest(BaseModel):
72
+ model: Union[
73
+ str, Literal["fal-ai/kling-video/v1/standard/text-to-video",]] = 'fal-ai/kling-video/v1/standard/text-to-video'
74
+
75
+ prompt: Optional[str] = None
76
+ duration: Optional[float] = 5.0
77
+ video_url: Optional[str] = None
78
+ audio_url: Optional[str] = None
79
+ image_url: Optional[str] = None
80
+
81
+ sync_mode: Union[str, Literal["cut_off", "loop", "bounce"]] = "cut_off"
82
+
83
+
84
+ class LipsyncVideoRequest(BaseModel):
66
85
  model: Union[str, Literal[
67
86
  "latentsync", "sync-lipsync",
68
87
  "lip_sync_avatar_std", "lip_sync_avatar_lively"
@@ -77,4 +96,4 @@ class LipsyncVideoRquest(BaseModel):
77
96
 
78
97
 
79
98
  if __name__ == '__main__':
80
- print(LipsyncVideoRquest())
99
+ print(LipsyncVideoRequest())