MeUtils 2025.7.28.19.31.30__py3-none-any.whl → 2025.7.30.18.24.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.
- examples/_openaisdk/openai_ffire.py +7 -3
- examples/_openaisdk/openai_modelscope.py +8 -80
- meutils/apis/fal/audio.py +20 -13
- meutils/apis/gitee/image_to_3d.py +62 -10
- meutils/apis/images/generations.py +4 -0
- meutils/apis/models.py +8 -5
- meutils/apis/ppio/__init__.py +0 -1
- meutils/apis/ppio/audio.py +102 -0
- meutils/apis/ppio/videos.py +2 -2
- meutils/data/VERSION +1 -1
- meutils/schemas/image_types.py +2 -2
- meutils/schemas/oneapi/common.py +31 -6
- meutils-2025.7.30.18.24.52.dist-info/METADATA +724 -0
- {MeUtils-2025.7.28.19.31.30.dist-info → meutils-2025.7.30.18.24.52.dist-info}/RECORD +18 -17
- MeUtils-2025.7.28.19.31.30.dist-info/METADATA +0 -708
- {MeUtils-2025.7.28.19.31.30.dist-info → meutils-2025.7.30.18.24.52.dist-info}/WHEEL +0 -0
- {MeUtils-2025.7.28.19.31.30.dist-info → meutils-2025.7.30.18.24.52.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.7.28.19.31.30.dist-info → meutils-2025.7.30.18.24.52.dist-info/licenses}/LICENSE +0 -0
- {MeUtils-2025.7.28.19.31.30.dist-info → meutils-2025.7.30.18.24.52.dist-info}/top_level.txt +0 -0
@@ -15,14 +15,16 @@ from openai import OpenAI, APIStatusError
|
|
15
15
|
|
16
16
|
client = OpenAI(
|
17
17
|
base_url=os.getenv("FFIRE_BASE_URL"),
|
18
|
-
api_key=os.getenv("FFIRE_API_KEY")
|
18
|
+
api_key=os.getenv("FFIRE_API_KEY")#+"-1101"
|
19
19
|
)
|
20
20
|
|
21
21
|
for i in range(10):
|
22
22
|
try:
|
23
23
|
completion = client.chat.completions.create(
|
24
|
-
model="kimi-k2-0711-preview",
|
24
|
+
# model="kimi-k2-0711-preview",
|
25
25
|
# model="deepseek-reasoner",
|
26
|
+
model="xx",
|
27
|
+
|
26
28
|
messages=[
|
27
29
|
{"role": "user", "content": 'hi'}
|
28
30
|
],
|
@@ -30,8 +32,10 @@ for i in range(10):
|
|
30
32
|
top_p=None,
|
31
33
|
temperature=None,
|
32
34
|
# stream=True,
|
33
|
-
max_tokens=1000
|
35
|
+
max_tokens=1000,
|
36
|
+
extra_body={"xx": "xxxxxxxx"}
|
34
37
|
)
|
38
|
+
print(completion)
|
35
39
|
except Exception as e:
|
36
40
|
print(e)
|
37
41
|
|
@@ -52,7 +52,9 @@ def main():
|
|
52
52
|
try:
|
53
53
|
completion = client.chat.completions.create(
|
54
54
|
# model="step-1-8k",
|
55
|
-
model="deepseek-ai/DeepSeek-R1-0528",
|
55
|
+
# model="deepseek-ai/DeepSeek-R1-0528",
|
56
|
+
# model="deepseek-ai/DeepSeek-R1-0528",
|
57
|
+
model="ZhipuAI/GLM-4.5",
|
56
58
|
|
57
59
|
# model="Qwen/QVQ-72B-Preview",
|
58
60
|
# model="qwen/qvq-72b-preview",
|
@@ -64,7 +66,7 @@ def main():
|
|
64
66
|
top_p=None,
|
65
67
|
temperature=None,
|
66
68
|
stream=True,
|
67
|
-
max_tokens=
|
69
|
+
max_tokens=100
|
68
70
|
)
|
69
71
|
except APIStatusError as e:
|
70
72
|
print(e.status_code)
|
@@ -80,81 +82,7 @@ def main():
|
|
80
82
|
print(chunk)
|
81
83
|
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
#
|
86
|
-
|
87
|
-
|
88
|
-
"""
|
89
|
-
|
90
|
-
UPSTREAM_BASE_URL=https://api.chatfire.cn
|
91
|
-
UPSTREAM_API_KEY=
|
92
|
-
|
93
|
-
API_KEY=https://xchatllm.feishu.cn/sheets/MekfsfVuohfUf1tsWV0cCvTmn3c?sheet=305f17[:20]
|
94
|
-
BASE_URL=https://api-inference.modelscope.cn
|
95
|
-
|
96
|
-
|
97
|
-
curl -X 'POST' http://openai-dev.chatfire.cn/oneapi/channel \
|
98
|
-
-H "Authorization: Bearer $API_KEY" \
|
99
|
-
-H "UPSTREAM-BASE-URL: $UPSTREAM_BASE_URL" \
|
100
|
-
-H "UPSTREAM-API-KEY: $UPSTREAM_API_KEY" \
|
101
|
-
-H 'accept: application/json' \
|
102
|
-
-H 'Content-Type: application/json' \
|
103
|
-
-d '{
|
104
|
-
"id": "1:20",
|
105
|
-
"name": "modelscope",
|
106
|
-
"tag": "modelscope",
|
107
|
-
"key": "$KEY",
|
108
|
-
"type": 0,
|
109
|
-
|
110
|
-
"base_url": "'$BASE_URL'",
|
111
|
-
"group": "default,china",
|
112
|
-
|
113
|
-
"models": "deepseek-r1-distill-qwen-14b,deepseek-r1-distill-llama-70b,deepseek-r1,deepseek-r1-0528,deepseek-r1-250528,deepseek-chat,deepseek-v3,deepseek-v3-0324,deepseek-v3-250324,PaddlePaddle/ERNIE-4.5-21B-A3B-PT,PaddlePaddle/ERNIE-4.5-0.3B-PT,PaddlePaddle/ERNIE-4.5-VL-28B-A3B-PT,PaddlePaddle/ERNIE-4.5-300B-A47B-PT,qwen2.5-coder-32b-instruct,qwen2.5-coder-14b-instruct,qwen2.5-coder-7b-instruct,qwen2.5-72b-instruct,qwen2.5-32b-instruct,qwen2.5-14b-instruct,qwen2.5-7b-instruct,qwq-32b-preview,qvq-72b-preview,qwen2-vl-7b-instruct,qwen2.5-14b-instruct-1m,qwen2.5-7b-instruct-1m,qwen2.5-vl-3b-instruct,qwen2.5-vl-7b-instruct,qwen2.5-vl-72b-instruct,qwq-32b,qwen2.5-vl-32b-instruct,qwen3-0.6b,qwen3-1.7b,qwen3-4b,qwen3-8b,qwen3-14b,qwen3-30b-a3b,qwen3-32b,qwen3-235b-a22b",
|
114
|
-
"model_mapping": {
|
115
|
-
"deepseek-reasoner": "deepseek-ai/DeepSeek-R1-0528",
|
116
|
-
"deepseek-r1": "deepseek-ai/DeepSeek-R1-0528",
|
117
|
-
"deepseek-r1-0528": "deepseek-ai/DeepSeek-R1-0528",
|
118
|
-
"deepseek-r1-250528": "deepseek-ai/DeepSeek-R1-0528",
|
119
|
-
|
120
|
-
"deepseek-chat": "deepseek-ai/DeepSeek-V3",
|
121
|
-
"deepseek-v3": "deepseek-ai/DeepSeek-V3",
|
122
|
-
"deepseek-v3-0324": "deepseek-ai/DeepSeek-V3-0324",
|
123
|
-
"deepseek-v3-250324": "deepseek-ai/DeepSeek-V3-0324",
|
124
|
-
|
125
|
-
"deepseek-r1-distill-qwen-14b": "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
|
126
|
-
"deepseek-r1-distill-llama-70b": "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
|
127
|
-
|
128
|
-
"majicflus_v1": "MAILAND/majicflus_v1",
|
129
|
-
|
130
|
-
"qwen2.5-coder-32b-instruct": "Qwen/Qwen2.5-Coder-32B-Instruct",
|
131
|
-
"qwen2.5-coder-14b-instruct": "Qwen/Qwen2.5-Coder-14B-Instruct",
|
132
|
-
"qwen2.5-coder-7b-instruct": "Qwen/Qwen2.5-Coder-7B-Instruct",
|
133
|
-
"qwen2.5-72b-instruct": "Qwen/Qwen2.5-72B-Instruct",
|
134
|
-
"qwen2.5-32b-instruct": "Qwen/Qwen2.5-32B-Instruct",
|
135
|
-
"qwen2.5-14b-instruct": "Qwen/Qwen2.5-14B-Instruct",
|
136
|
-
"qwen2.5-7b-instruct": "Qwen/Qwen2.5-7B-Instruct",
|
137
|
-
"qwq-32b-preview": "Qwen/QwQ-32B-Preview",
|
138
|
-
"qvq-72b-preview": "Qwen/QVQ-72B-Preview",
|
139
|
-
"qwen2-vl-7b-instruct": "Qwen/Qwen2-VL-7B-Instruct",
|
140
|
-
"qwen2.5-14b-instruct-1m": "Qwen/Qwen2.5-14B-Instruct-1M",
|
141
|
-
"qwen2.5-7b-instruct-1m": "Qwen/Qwen2.5-7B-Instruct-1M",
|
142
|
-
"qwen2.5-vl-3b-instruct": "Qwen/Qwen2.5-VL-3B-Instruct",
|
143
|
-
"qwen2.5-vl-7b-instruct": "Qwen/Qwen2.5-VL-7B-Instruct",
|
144
|
-
"qwen2.5-vl-72b-instruct": "Qwen/Qwen2.5-VL-72B-Instruct",
|
145
|
-
"qwq-32b": "Qwen/QwQ-32B",
|
146
|
-
"qwen2.5-vl-32b-instruct": "Qwen/Qwen2.5-VL-32B-Instruct",
|
147
|
-
"qwen3-0.6b": "Qwen/Qwen3-0.6B",
|
148
|
-
"qwen3-1.7b": "Qwen/Qwen3-1.7B",
|
149
|
-
"qwen3-4b": "Qwen/Qwen3-4B",
|
150
|
-
"qwen3-8b": "Qwen/Qwen3-8B",
|
151
|
-
"qwen3-14b": "Qwen/Qwen3-14B",
|
152
|
-
"qwen3-30b-a3b": "Qwen/Qwen3-30B-A3B",
|
153
|
-
"qwen3-32b": "Qwen/Qwen3-32B",
|
154
|
-
"qwen3-235b-a22b": "Qwen/Qwen3-235B-A22B"
|
155
|
-
|
156
|
-
}
|
157
|
-
|
158
|
-
}'
|
159
|
-
|
160
|
-
"""
|
85
|
+
if __name__ == '__main__':
|
86
|
+
for i in tqdm(range(1)):
|
87
|
+
# break
|
88
|
+
main()
|
meutils/apis/fal/audio.py
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
from openai import AsyncOpenAI
|
13
13
|
|
14
14
|
from meutils.pipe import *
|
15
|
-
from meutils.io.files_utils import to_url
|
15
|
+
from meutils.io.files_utils import to_url, to_bytes
|
16
16
|
from meutils.llm.clients import AsyncOpenAI
|
17
17
|
from meutils.llm.openai_utils import to_openai_params
|
18
18
|
from meutils.llm.check_utils import get_valid_token_for_fal
|
@@ -47,21 +47,23 @@ from fal_client.client import AsyncClient, SyncClient, Status, FalClientError
|
|
47
47
|
|
48
48
|
# "fal-ai/minimax/speech-02-turbo"
|
49
49
|
async def text_to_speech(request: TTSRequest, api_key: Optional[str] = None):
|
50
|
+
if isinstance(api_key, str) and api_key.startswith("oneapi:"):
|
51
|
+
api_key = api_key.removeprefix("oneapi:")
|
52
|
+
|
50
53
|
api_key = api_key or await get_valid_token_for_fal()
|
51
54
|
|
55
|
+
payload = request.model_dump(exclude_none=True)
|
52
56
|
payload = {
|
53
|
-
|
54
57
|
"text": request.input,
|
55
|
-
"
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# **request.model_dump(exclude_none=True)
|
58
|
+
"stream": False,
|
59
|
+
"output_format": request.response_format if request.response_format in {"url", "hex"} else "hex",
|
60
|
+
"voice_setting":
|
61
|
+
{
|
62
|
+
"speed": request.speed or 1,
|
63
|
+
"voice_id": request.voice or "wumei_yujie",
|
64
|
+
"emotion": "happy"
|
65
|
+
},
|
66
|
+
**payload
|
65
67
|
}
|
66
68
|
|
67
69
|
try:
|
@@ -70,8 +72,13 @@ async def text_to_speech(request: TTSRequest, api_key: Optional[str] = None):
|
|
70
72
|
application=request.model,
|
71
73
|
arguments=payload,
|
72
74
|
)
|
75
|
+
# {'audio': {'url': 'https://v3.fal.media/files/zebra/wTM2HIdYkQTl0q5qdTDl9_speech.mp3', 'content_type': 'audio/mpeg', 'file_name': 'speech.mp3', 'file_size': 64034}, 'duration_ms': 3888}
|
73
76
|
logger.debug(data)
|
74
77
|
|
78
|
+
if request.response_format not in {"url", "hex"}:
|
79
|
+
_ = await to_bytes(data["audio"]["url"])
|
80
|
+
return _
|
81
|
+
|
75
82
|
except Exception as exc: #
|
76
83
|
logger.error(exc)
|
77
84
|
from fastapi import HTTPException, status
|
@@ -88,7 +95,7 @@ if __name__ == '__main__':
|
|
88
95
|
"input": "根据 prompt audio url克隆音色",
|
89
96
|
# "response_format": "url"
|
90
97
|
|
91
|
-
"voice": "Wise_Woman"
|
98
|
+
# "voice": "Wise_Woman"
|
92
99
|
}
|
93
100
|
|
94
101
|
request = TTSRequest(**data)
|
@@ -10,8 +10,12 @@
|
|
10
10
|
|
11
11
|
from meutils.pipe import *
|
12
12
|
from meutils.db.redis_db import redis_aclient
|
13
|
+
from meutils.io.files_utils import to_bytes
|
14
|
+
|
13
15
|
from meutils.apis.utils import make_request_httpx
|
14
16
|
from meutils.schemas.gitee_types import FEISHU_URL, BASE_URL
|
17
|
+
from meutils.schemas.image_types import ImageRequest, ImagesResponse
|
18
|
+
|
15
19
|
from meutils.config_utils.lark_utils import get_next_token_for_polling
|
16
20
|
|
17
21
|
"""
|
@@ -23,6 +27,9 @@ curl https://ai.gitee.com/v1/async/image-to-3d \
|
|
23
27
|
-F "model=Hi3DGen" \
|
24
28
|
-F "seed=1234" \
|
25
29
|
-F "file_format=glb"
|
30
|
+
|
31
|
+
|
32
|
+
texture=true 带纹理
|
26
33
|
"""
|
27
34
|
|
28
35
|
|
@@ -58,12 +65,7 @@ async def create_task(image, data: Optional[dict] = None, api_key: Optional[str]
|
|
58
65
|
"Authorization": f"Bearer {api_key}",
|
59
66
|
}
|
60
67
|
|
61
|
-
|
62
|
-
"type": "glb",
|
63
|
-
"model": "Hi3DGen",
|
64
|
-
"seed": 1234,
|
65
|
-
"file_format": "glb",
|
66
|
-
}
|
68
|
+
# (filename, file_bytes, mime_type) = image
|
67
69
|
|
68
70
|
response = await make_request_httpx(
|
69
71
|
base_url=BASE_URL,
|
@@ -84,15 +86,65 @@ async def create_task(image, data: Optional[dict] = None, api_key: Optional[str]
|
|
84
86
|
{'task_id': 'GB84DX8LK6NUJ0WHZLUNRCXDBFKMVVFH'}
|
85
87
|
|
86
88
|
"""
|
89
|
+
logger.debug(response)
|
87
90
|
if task_id := response.get("task_id"):
|
88
91
|
await redis_aclient.set(task_id, api_key, ex=24 * 3600)
|
89
92
|
return {"task_id": response.get("task_id")}
|
90
93
|
|
91
94
|
|
92
|
-
async def generate(request):
|
93
|
-
|
95
|
+
async def generate(request: ImageRequest, api_key: Optional[str] = None):
|
96
|
+
payload = request.model_dump(exclude_none=True, exclude={"extra_fields", "controls"})
|
97
|
+
|
98
|
+
payload = {
|
99
|
+
"type": "glb",
|
100
|
+
"model": request.model,
|
101
|
+
"file_format": request.response_format if request.response_format in ["glb", "stl"] else "glb",
|
102
|
+
|
103
|
+
**payload,
|
104
|
+
**(request.extra_fields or {})
|
105
|
+
}
|
106
|
+
|
107
|
+
image = await to_bytes(payload.pop('image'))
|
108
|
+
|
109
|
+
logger.debug(payload)
|
110
|
+
response = await create_task(image=image, data=payload)
|
111
|
+
if response:
|
112
|
+
for i in range(100):
|
113
|
+
await asyncio.sleep(3)
|
114
|
+
_ = await get_task(response['task_id'])
|
115
|
+
logger.debug(bjson(_))
|
116
|
+
if file_url := (_.get("output") or {}).get("file_url"):
|
117
|
+
return ImagesResponse(data=[{"url": file_url}])
|
118
|
+
|
94
119
|
|
95
120
|
if __name__ == '__main__':
|
96
121
|
image = "/Users/betterme/PycharmProjects/AI/test.png"
|
97
|
-
# arun(
|
98
|
-
|
122
|
+
# arun(get_task('GB84DX8LK6NUJ0WHZLUNRCXDBFKMVVFH'))
|
123
|
+
# image = ('x.png', open(image, 'rb').read(), 'image/png')
|
124
|
+
image = open(image, 'rb').read()
|
125
|
+
image = "https://s3.ffire.cc/files/christmas-tree.png"
|
126
|
+
|
127
|
+
# arun(
|
128
|
+
# create_task(
|
129
|
+
# # image=open(image, 'rb'),
|
130
|
+
# image=image,
|
131
|
+
#
|
132
|
+
# data={
|
133
|
+
# "type": "glb",
|
134
|
+
# "model": "Hunyuan3D-2",
|
135
|
+
# "file_format": "glb",
|
136
|
+
# }
|
137
|
+
# ))
|
138
|
+
#
|
139
|
+
arun(generate(
|
140
|
+
ImageRequest(
|
141
|
+
model="Hunyuan3D-2",
|
142
|
+
response_format="glb",
|
143
|
+
extra_fields={
|
144
|
+
"image": image,
|
145
|
+
|
146
|
+
"texture": True,
|
147
|
+
}
|
148
|
+
)
|
149
|
+
)
|
150
|
+
)
|
@@ -16,6 +16,7 @@ from meutils.schemas.image_types import ImageRequest
|
|
16
16
|
|
17
17
|
from meutils.apis.fal.images import generate as fal_generate
|
18
18
|
|
19
|
+
from meutils.apis.gitee.image_to_3d import generate as image_to_3d_generate
|
19
20
|
|
20
21
|
async def generate(
|
21
22
|
request: ImageRequest,
|
@@ -29,6 +30,9 @@ async def generate(
|
|
29
30
|
if request.model.startswith("fal-ai"):
|
30
31
|
return await fal_generate(request, api_key)
|
31
32
|
|
33
|
+
if request.model in {"Hunyuan3D-2", "Hi3DGen", "Step1X-3D"}:
|
34
|
+
return await image_to_3d_generate(request, api_key)
|
35
|
+
|
32
36
|
|
33
37
|
if __name__ == '__main__':
|
34
38
|
arun(generate(ImageRequest(model="flux", prompt="笑起来")))
|
meutils/apis/models.py
CHANGED
@@ -11,14 +11,17 @@
|
|
11
11
|
from meutils.pipe import *
|
12
12
|
|
13
13
|
|
14
|
-
def
|
15
|
-
|
14
|
+
def make_billing_model(model: str, request: dict):
|
15
|
+
_model = model.removeprefix("fal-")
|
16
|
+
if _model.startswith(("pika", "fal-pika")):
|
16
17
|
duration = request.get("duration")
|
17
18
|
resolution = request.get("resolution")
|
18
19
|
|
19
20
|
billing_model = f"{duration}s_{resolution}"
|
20
|
-
return billing_model
|
21
21
|
|
22
|
-
|
22
|
+
return f"{model}_{billing_model}"
|
23
|
+
|
24
|
+
elif _model.startswith(("ideogram", "fal-ideogram")):
|
23
25
|
billing_model = request.get("rendering_speed", "BALANCED").lower()
|
24
|
-
|
26
|
+
|
27
|
+
return f"{model}_{billing_model}"
|
meutils/apis/ppio/__init__.py
CHANGED
@@ -0,0 +1,102 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# @Project : AI. @by PyCharm
|
4
|
+
# @File : ppio_hailuo
|
5
|
+
# @Time : 2025/7/30 09:02
|
6
|
+
# @Author : betterme
|
7
|
+
# @WeChat : meutils
|
8
|
+
# @Software : PyCharm
|
9
|
+
# @Description :
|
10
|
+
|
11
|
+
from meutils.pipe import *
|
12
|
+
from meutils.decorators.retry import retrying
|
13
|
+
from meutils.apis.utils import make_request_httpx
|
14
|
+
from meutils.schemas.openai_types import TTSRequest
|
15
|
+
from meutils.config_utils.lark_utils import get_next_token_for_polling
|
16
|
+
|
17
|
+
from meutils.apis.ppio.videos import base_url, feishu_url
|
18
|
+
|
19
|
+
|
20
|
+
@retrying()
|
21
|
+
async def text_to_speech(request: TTSRequest, api_key: Optional[str] = None):
|
22
|
+
"""
|
23
|
+
调用ppio接口创建语音
|
24
|
+
:param request:
|
25
|
+
:return:
|
26
|
+
"""
|
27
|
+
if isinstance(api_key, str) and api_key.startswith("oneapi:"):
|
28
|
+
api_key = api_key.removeprefix("oneapi:")
|
29
|
+
|
30
|
+
|
31
|
+
api_key = api_key or await get_next_token_for_polling(feishu_url, from_redis=True, ttl=3600) # todo: 优化
|
32
|
+
|
33
|
+
headers = {
|
34
|
+
"Authorization": f"Bearer {api_key}",
|
35
|
+
"Content-Type": "application/json",
|
36
|
+
}
|
37
|
+
|
38
|
+
payload = request.model_dump(exclude_none=True)
|
39
|
+
payload = {
|
40
|
+
"text": request.input,
|
41
|
+
"stream": False,
|
42
|
+
"output_format": request.response_format if request.response_format in {"url", "hex"} else "hex",
|
43
|
+
"voice_setting":
|
44
|
+
{
|
45
|
+
"speed": request.speed or 1,
|
46
|
+
"voice_id": request.voice or "wumei_yujie",
|
47
|
+
"emotion": "happy"
|
48
|
+
},
|
49
|
+
**payload
|
50
|
+
}
|
51
|
+
|
52
|
+
# logger.debug(bjson(payload))
|
53
|
+
|
54
|
+
response = await make_request_httpx(
|
55
|
+
base_url=base_url,
|
56
|
+
path=request.model,
|
57
|
+
payload=payload,
|
58
|
+
|
59
|
+
headers=headers,
|
60
|
+
|
61
|
+
debug=True
|
62
|
+
)
|
63
|
+
|
64
|
+
if request.response_format not in {"url", "hex"}:
|
65
|
+
_ = bytes.fromhex(response["audio"])
|
66
|
+
|
67
|
+
# logger.debug(type(_))
|
68
|
+
|
69
|
+
return _
|
70
|
+
|
71
|
+
return response
|
72
|
+
|
73
|
+
|
74
|
+
if __name__ == '__main__':
|
75
|
+
arun(
|
76
|
+
text_to_speech(
|
77
|
+
TTSRequest(
|
78
|
+
model="minimax-speech-02-turbo",
|
79
|
+
input="你好",
|
80
|
+
|
81
|
+
# response_format='hex',
|
82
|
+
|
83
|
+
)
|
84
|
+
))
|
85
|
+
|
86
|
+
"""
|
87
|
+
curl \
|
88
|
+
-X POST https://api.ppinfra.com/v3/minimax-speech-02-turbo \
|
89
|
+
-H "Authorization: Bearer sk_3W5amR6wiLNSzAyz9wkHBxSf848ZQckbTzZQrxNY1Og" \
|
90
|
+
-H "Content-Type: application/json" \
|
91
|
+
-d '{
|
92
|
+
"text": "近年来,人工智能在国内迎来高速发展期,技术创新与产业应用齐头并进。从基础的大模型研发到语音识别、图像处理、自然语言理解等关键技术突破,AI 正在深度赋能医疗、金融、制造、交通等多个领域。同时,政策支持和资本推动加速了技术落地,众多科技企业、创业团队和科研机构持续投入,形成了活跃的创新生态。AI 正逐步从实验室走向实际生产力,成为推动数字中国建设和经济高质量发展的重要引擎,未来发展潜力巨大。",
|
93
|
+
"stream": false,
|
94
|
+
"output_format": "url",
|
95
|
+
"voice_setting": {
|
96
|
+
"speed": 1.1,
|
97
|
+
"voice_id": "male-qn-jingying",
|
98
|
+
"emotion": "happy"
|
99
|
+
}
|
100
|
+
}'
|
101
|
+
|
102
|
+
"""
|
meutils/apis/ppio/videos.py
CHANGED
@@ -21,8 +21,8 @@ base_url = "https://api.ppinfra.com/v3"
|
|
21
21
|
feishu_url = "https://xchatllm.feishu.cn/sheets/Z59Js10DbhT8wdt72LachSDlnlf?sheet=b0e241"
|
22
22
|
|
23
23
|
|
24
|
-
async def get_valid_token():
|
25
|
-
_ = await get_next_token(feishu_url, check_token, min_points=
|
24
|
+
async def get_valid_token(min_points=18000):
|
25
|
+
_ = await get_next_token(feishu_url, check_token, min_points=min_points, ttl=600)
|
26
26
|
logger.debug(_)
|
27
27
|
return _
|
28
28
|
|
meutils/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2025.07.
|
1
|
+
2025.07.30.18.24.52
|
meutils/schemas/image_types.py
CHANGED
@@ -97,7 +97,7 @@ class ImageRequest(BaseModel): # openai
|
|
97
97
|
# 测试默认值 Optional[Literal["256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"]]
|
98
98
|
size: Optional[str] = '1024x1024' # null auto
|
99
99
|
|
100
|
-
response_format: Optional[Literal["oss_url", "
|
100
|
+
response_format: Optional[Literal["url", "b64_json", "oss_url", "glb", "stl"]] = "url"
|
101
101
|
|
102
102
|
seed: Optional[int] = None
|
103
103
|
|
@@ -108,7 +108,7 @@ class ImageRequest(BaseModel): # openai
|
|
108
108
|
guidance: Optional[float] = None
|
109
109
|
steps: Optional[int] = None
|
110
110
|
|
111
|
-
controls: Optional[dict] =
|
111
|
+
controls: Optional[dict] = None # 额外参数
|
112
112
|
|
113
113
|
safety_tolerance: Optional[int] = None
|
114
114
|
|
meutils/schemas/oneapi/common.py
CHANGED
@@ -221,10 +221,12 @@ MODEL_PRICE = {
|
|
221
221
|
|
222
222
|
"tts-pro": 0.03,
|
223
223
|
|
224
|
-
# 官方
|
224
|
+
# 官方apit todo 免费模型
|
225
225
|
"cogvideox-flash": 0.05,
|
226
226
|
"cogvideox": 0.1,
|
227
227
|
"cogvideox-2": 0.2,
|
228
|
+
"cogvideox-3": 0.5,
|
229
|
+
"cogvideox-3-flash": 0.1,
|
228
230
|
|
229
231
|
"official-api-cogvideox": 0.1,
|
230
232
|
"official-api-kling-video": 0.5,
|
@@ -261,6 +263,8 @@ MODEL_PRICE = {
|
|
261
263
|
"ideogram-ai/ideogram-v2": 0.2,
|
262
264
|
"ideogram-ai/ideogram-v2-turbo": 0.1,
|
263
265
|
|
266
|
+
"imagen3": 0.05 * 3,
|
267
|
+
"imagen3-fast": 0.025 * 3,
|
264
268
|
"imagen4": 0.05 * 3,
|
265
269
|
"imagen4-fast": 0.02 * 3,
|
266
270
|
"imagen4-ultra": 0.075 * 3,
|
@@ -548,9 +552,9 @@ MODEL_RATIO = {
|
|
548
552
|
"bge-large-en-v1.5": 0.1,
|
549
553
|
"BAAI/bge-large-en-v1.5": 0.1,
|
550
554
|
|
551
|
-
"text-embedding-3-large": 0.
|
552
|
-
"text-embedding-3-small": 0.
|
553
|
-
"text-embedding-ada-002": 0.
|
555
|
+
"text-embedding-3-large": 0.1,
|
556
|
+
"text-embedding-3-small": 0.1,
|
557
|
+
"text-embedding-ada-002": 0.1,
|
554
558
|
|
555
559
|
# 百川
|
556
560
|
'baichuan4-turbo': 7.5,
|
@@ -625,6 +629,12 @@ MODEL_RATIO = {
|
|
625
629
|
"glm-4.1v-thinking-flash": 0.1,
|
626
630
|
"glm-4.1v-thinking-flashx": 1,
|
627
631
|
|
632
|
+
"glm-4.5-flash": 0.1,
|
633
|
+
"glm-4.5-air": 0.2,
|
634
|
+
"glm-4.5-airx": 1,
|
635
|
+
"glm-4.5": 0.5,
|
636
|
+
"glm-4.5-x": 2,
|
637
|
+
|
628
638
|
# 阿里千问 https://dashscope.console.aliyun.com/billing
|
629
639
|
"qwen-long": 0.25,
|
630
640
|
"qwen-turbo": 0.05,
|
@@ -644,8 +654,6 @@ MODEL_RATIO = {
|
|
644
654
|
"qwen2.5-vl-32b-instruct": 0.5,
|
645
655
|
"qwen2.5-vl-72b-instruct": 1.5,
|
646
656
|
|
647
|
-
|
648
|
-
|
649
657
|
"qwen2.5-coder-7b-instruct": 0.05,
|
650
658
|
"qwen2.5-7b-instruct": 0.05,
|
651
659
|
"qwen2.5-14b-instruct": 0.25,
|
@@ -661,10 +669,13 @@ MODEL_RATIO = {
|
|
661
669
|
"qwen3-14b": 0.5,
|
662
670
|
"qwen3-32b": 2,
|
663
671
|
"qwen3-30b-a3b": 0.75,
|
672
|
+
"qwen3-30b-a3b-instruct-2507": 0.75,
|
664
673
|
"qwen3-235b-a22b": 1,
|
665
674
|
"qwen-math-plus": 2,
|
666
675
|
"qwen3-coder-480b-a35b-instruct": 3,
|
667
676
|
"qwen3-235b-a22b-instruct-2507": 1,
|
677
|
+
"qwen3-235b-a22b-thinking-2507": 3,
|
678
|
+
|
668
679
|
"qwen3-coder-plus": 2,
|
669
680
|
"qwen3-coder-plus-2025-07-22": 2,
|
670
681
|
|
@@ -1091,6 +1102,7 @@ MODEL_RATIO = {
|
|
1091
1102
|
"meta-llama/Llama-4-Scout-17B-16E-Instruct": 0.1,
|
1092
1103
|
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 0.2,
|
1093
1104
|
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-Turbo": 0.2,
|
1105
|
+
"llama-4-maverick": 0.5,
|
1094
1106
|
|
1095
1107
|
# groq https://console.groq.com/docs/models
|
1096
1108
|
"llama3-8b-8192": 0.01,
|
@@ -1246,6 +1258,7 @@ COMPLETION_RATIO = {
|
|
1246
1258
|
"meta-llama/Llama-4-Scout-17B-16E-Instruct": 4,
|
1247
1259
|
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 4,
|
1248
1260
|
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-Turbo": 4,
|
1261
|
+
"llama-4-maverick": 4,
|
1249
1262
|
|
1250
1263
|
"llama-3.1-8b-instruct": 3,
|
1251
1264
|
"meta-llama/Meta-Llama-3.1-8B-Instruct": 3,
|
@@ -1383,11 +1396,14 @@ COMPLETION_RATIO = {
|
|
1383
1396
|
"qwen3-14b": 4,
|
1384
1397
|
"qwen3-32b": 4,
|
1385
1398
|
"qwen3-30b-a3b": 4,
|
1399
|
+
"qwen3-30b-a3b-instruct-2507": 4,
|
1386
1400
|
"qwen3-235b-a22b": 4,
|
1387
1401
|
"qwenlong-l1-32b": 4,
|
1388
1402
|
"qwen3-235b-a22b-instruct-2507": 4,
|
1403
|
+
"qwen3-235b-a22b-thinking-2507": 4,
|
1389
1404
|
"qwen3-coder-480b-a35b-instruct": 4,
|
1390
1405
|
|
1406
|
+
|
1391
1407
|
"qwen3-coder-plus": 4,
|
1392
1408
|
"qwen3-coder-plus-2025-07-22": 4,
|
1393
1409
|
|
@@ -1508,6 +1524,12 @@ COMPLETION_RATIO = {
|
|
1508
1524
|
"glm-4.1v-thinking-flash": 2,
|
1509
1525
|
"glm-4.1v-thinking-flashx": 4,
|
1510
1526
|
|
1527
|
+
"glm-4.5-flash": 3,
|
1528
|
+
"glm-4.5-air": 3,
|
1529
|
+
"glm-4.5-airx": 3,
|
1530
|
+
"glm-4.5": 4,
|
1531
|
+
"glm-4.5-x": 4,
|
1532
|
+
|
1511
1533
|
"step-1-flash": 5,
|
1512
1534
|
"step-1-8k": 5,
|
1513
1535
|
"step-1-32k": 5,
|
@@ -1724,6 +1746,9 @@ if __name__ == '__main__':
|
|
1724
1746
|
|
1725
1747
|
print([k for k in MODEL_RATIO if k.startswith(('deepseek', 'doubao', 'moon'))] | xjoin(","))
|
1726
1748
|
|
1749
|
+
print('\n\n')
|
1750
|
+
print([k for k in MODEL_RATIO if k.startswith(('glm-4.'))] | xjoin(","))
|
1751
|
+
|
1727
1752
|
print([k for k in MODEL_PRICE if k.startswith(('chat-',))] | xjoin(","))
|
1728
1753
|
|
1729
1754
|
print("FAL按次")
|