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.
Files changed (37) hide show
  1. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/METADATA +262 -262
  2. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/RECORD +37 -31
  3. examples/_openaisdk/4v.py +3 -2
  4. examples/_openaisdk/openai_chatfire.py +7 -3
  5. examples/_openaisdk/openai_files.py +11 -7
  6. examples/_openaisdk/openai_images.py +15 -10
  7. examples/_openaisdk/openai_jina.py +58 -0
  8. meutils/apis/jimeng/images.py +3 -2
  9. meutils/apis/kling/api.py +1 -1
  10. meutils/apis/niutrans.py +2 -0
  11. meutils/apis/oneapi/token.py +0 -2
  12. meutils/apis/siliconflow/images.py +4 -1
  13. meutils/apis/sunoai/suno_api.py +42 -0
  14. meutils/apis/to_image/md.py +24 -2
  15. meutils/apis/translator/deeplx.py +2 -1
  16. meutils/caches/acache.py +51 -7
  17. meutils/data/VERSION +1 -1
  18. meutils/data/oneapi/FOOTER.md +2 -2
  19. meutils/data/oneapi/NOTICE.md +1 -151
  20. meutils/data/oneapi/_NOTICE.md +140 -0
  21. meutils/files/__init__.py +11 -0
  22. meutils/files/qwen_files.py +30 -0
  23. meutils/io/files_utils.py +2 -2
  24. meutils/llm/check_utils.py +2 -1
  25. meutils/llm/clients.py +5 -2
  26. meutils/llm/completions/qwenllm.py +45 -5
  27. meutils/schemas/oneapi/common.py +26 -2
  28. meutils/schemas/openai_types.py +4 -3
  29. meutils/schemas/suno_types.py +1 -1
  30. meutils/schemas/task_types.py +1 -0
  31. meutils/schemas/vidu_types.py +4 -4
  32. meutils/serving/fastapi/dependencies/auth.py +8 -2
  33. meutils/serving/fastapi/dependencies/headers.py +31 -0
  34. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/LICENSE +0 -0
  35. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/WHEEL +0 -0
  36. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/entry_points.txt +0 -0
  37. {MeUtils-2025.2.20.17.30.7.dist-info → MeUtils-2025.2.25.18.30.35.dist-info}/top_level.txt +0 -0
@@ -77,7 +77,7 @@ class SunoAIRequest(BaseModel): # 原始请求体
77
77
 
78
78
  make_instrumental: bool = False
79
79
 
80
- mv: str = "chirp-v3-5" # chirp-v3-5-tau
80
+ mv: str = "chirp-v4" # chirp-v3-5-tau
81
81
  generation_type: str = "TEXT"
82
82
 
83
83
  task: Optional[str] = None # "cover"
@@ -105,6 +105,7 @@ class TaskType(str, Enum):
105
105
  file_extract = "file-extract"
106
106
  moonshot_fileparser = "moonshot-fileparser"
107
107
  textin_fileparser = "textin-fileparser"
108
+ qwen = "qwen"
108
109
 
109
110
  watermark_remove = "watermark-remove"
110
111
 
@@ -92,7 +92,8 @@ class VideoRequest(BaseModel):
92
92
 
93
93
  class ViduRequest(BaseModel):
94
94
  """quality 倍率2"""
95
- model: Union[str, Literal['vidu-2.0', 'vidu-1.5', 'vidu-high-performance', 'vidu-high-quality']] = "vidu-high-performance"
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
- pass
36
- if ',' in token: # 初始化redis
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}