MeUtils 2025.2.20.17.30.7__py3-none-any.whl → 2025.2.25.18.30.35__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.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/METADATA +262 -262
- {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/RECORD +37 -31
- examples/_openaisdk/4v.py +3 -2
- examples/_openaisdk/openai_chatfire.py +7 -3
- examples/_openaisdk/openai_files.py +11 -7
- examples/_openaisdk/openai_images.py +15 -10
- examples/_openaisdk/openai_jina.py +58 -0
- meutils/apis/jimeng/images.py +3 -2
- meutils/apis/kling/api.py +1 -1
- meutils/apis/niutrans.py +2 -0
- meutils/apis/oneapi/token.py +0 -2
- meutils/apis/siliconflow/images.py +4 -1
- meutils/apis/sunoai/suno_api.py +42 -0
- meutils/apis/to_image/md.py +24 -2
- meutils/apis/translator/deeplx.py +2 -1
- meutils/caches/acache.py +51 -7
- meutils/data/VERSION +1 -1
- meutils/data/oneapi/FOOTER.md +2 -2
- meutils/data/oneapi/NOTICE.md +1 -151
- meutils/data/oneapi/_NOTICE.md +140 -0
- meutils/files/__init__.py +11 -0
- meutils/files/qwen_files.py +30 -0
- meutils/io/files_utils.py +2 -2
- meutils/llm/check_utils.py +2 -1
- meutils/llm/clients.py +5 -2
- meutils/llm/completions/qwenllm.py +45 -5
- meutils/schemas/oneapi/common.py +26 -2
- meutils/schemas/openai_types.py +4 -3
- meutils/schemas/suno_types.py +1 -1
- meutils/schemas/task_types.py +1 -0
- meutils/schemas/vidu_types.py +4 -4
- meutils/serving/fastapi/dependencies/auth.py +8 -2
- meutils/serving/fastapi/dependencies/headers.py +31 -0
- {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/LICENSE +0 -0
- {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/WHEEL +0 -0
- {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/top_level.txt +0 -0
meutils/schemas/suno_types.py
CHANGED
meutils/schemas/task_types.py
CHANGED
meutils/schemas/vidu_types.py
CHANGED
@@ -92,7 +92,8 @@ class VideoRequest(BaseModel):
|
|
92
92
|
|
93
93
|
class ViduRequest(BaseModel):
|
94
94
|
"""quality 倍率2"""
|
95
|
-
model: Union[
|
95
|
+
model: Union[
|
96
|
+
str, Literal['vidu-2.0', 'vidu-1.5', 'vidu-high-performance', 'vidu-high-quality']] = "vidu-high-performance"
|
96
97
|
|
97
98
|
prompt: Optional[str] = None
|
98
99
|
|
@@ -156,13 +157,12 @@ class ViduRequest(BaseModel):
|
|
156
157
|
}
|
157
158
|
)
|
158
159
|
|
159
|
-
|
160
|
-
if self.model in ("vidu-1.5", "vidu-2.0"):
|
160
|
+
if self.model in ("vidu-2.0",):
|
161
161
|
self.payload = {
|
162
162
|
"input": input,
|
163
163
|
"type": self.type or type,
|
164
164
|
"settings": {
|
165
|
-
"model_version": "2.0",
|
165
|
+
"model_version": "2.0", #######
|
166
166
|
"style": "general",
|
167
167
|
"duration": self.duration,
|
168
168
|
|
@@ -14,6 +14,8 @@ from typing import Optional, Union
|
|
14
14
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
15
15
|
from fastapi import Depends, HTTPException, status
|
16
16
|
|
17
|
+
from meutils.config_utils.lark_utils import get_series, get_next_token
|
18
|
+
|
17
19
|
http_bearer = HTTPBearer()
|
18
20
|
|
19
21
|
|
@@ -32,9 +34,13 @@ async def get_bearer_token(
|
|
32
34
|
|
33
35
|
token = auth.credentials
|
34
36
|
if token.startswith('redis:'): # 初始化吧,太长?
|
35
|
-
|
36
|
-
|
37
|
+
if "feishu.cn" in token:
|
38
|
+
feishu_url = token.removeprefix("redis:")
|
39
|
+
token = await get_next_token(feishu_url) # 初始化redis
|
40
|
+
|
41
|
+
elif ',' in token: # todo: 初始化redis
|
37
42
|
pass
|
43
|
+
|
38
44
|
elif ',' in token: # 分隔符
|
39
45
|
token = np.random.choice(token.split(','))
|
40
46
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# @Project : AI. @by PyCharm
|
4
|
+
# @File : headers
|
5
|
+
# @Time : 2025/2/23 00:20
|
6
|
+
# @Author : betterme
|
7
|
+
# @WeChat : meutils
|
8
|
+
# @Software : PyCharm
|
9
|
+
# @Description :
|
10
|
+
|
11
|
+
|
12
|
+
from fastapi import FastAPI, Request, Depends, HTTPException
|
13
|
+
from typing import Dict, Optional
|
14
|
+
|
15
|
+
|
16
|
+
# 定义一个依赖函数来获取所有请求头
|
17
|
+
# def get_headers(request: Request) -> Dict[str, str]:
|
18
|
+
# return dict(request.headers)
|
19
|
+
|
20
|
+
def get_headers(request: Request):
|
21
|
+
return request.headers
|
22
|
+
|
23
|
+
# lambda request: dict(request.headers)
|
24
|
+
# @app.get("/headers/")
|
25
|
+
# async def read_headers(headers: Dict[str, str] = Depends(get_headers)):
|
26
|
+
# # 在这里你可以使用 headers 字典
|
27
|
+
# if "upstream_api_key" not in headers:
|
28
|
+
# raise HTTPException(status_code=400, detail="API key is required")
|
29
|
+
#
|
30
|
+
# # 返回所有请求头
|
31
|
+
# return {"headers": headers}
|
File without changes
|
File without changes
|
{MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|