MeUtils 2025.1.23.10.16.28__py3-none-any.whl → 2025.1.29.10.0.47__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 (35) hide show
  1. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/METADATA +29 -30
  2. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/RECORD +34 -32
  3. examples/_openaisdk/4v.py +3 -4
  4. examples/_openaisdk/openai_baichuan.py +7 -3
  5. examples/_openaisdk/openai_chatfire.py +15 -4
  6. examples/_openaisdk/openai_deepinfra.py +2 -2
  7. examples/_openaisdk/openai_modelscope.py +2 -1
  8. examples/_openaisdk/openai_together.py +2 -1
  9. examples/_openaisdk/openai_zhipu.py +9 -5
  10. examples/json_jmespath.py +13 -13
  11. meutils/apis/hunyuan/image_tools.py +6 -2
  12. meutils/apis/images/edits.py +70 -2
  13. meutils/apis/jimeng/common.py +0 -144
  14. meutils/apis/jimeng/files.py +25 -12
  15. meutils/apis/jimeng/images.py +166 -4
  16. meutils/apis/jimeng/videos.py +176 -107
  17. meutils/apis/vidu/vidu_video.py +3 -3
  18. meutils/data/VERSION +1 -1
  19. meutils/data/oneapi/NOTICE.md +25 -8
  20. meutils/jwt_utils/common.py +46 -0
  21. meutils/llm/clients.py +4 -1
  22. meutils/llm/completions/agents/search.py +115 -0
  23. meutils/parsers/fileparser/mineru.py +48 -0
  24. meutils/schemas/image_types.py +12 -1
  25. meutils/schemas/oneapi/common.py +17 -5
  26. meutils/schemas/oneapi/models.py +1 -1
  27. meutils/schemas/openai_types.py +1 -1
  28. meutils/schemas/video_types.py +9 -1
  29. meutils/schemas/vidu_types.py +1 -1
  30. meutils/request_utils/jwt_utils/common.py +0 -42
  31. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/LICENSE +0 -0
  32. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/WHEEL +0 -0
  33. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/entry_points.txt +0 -0
  34. {MeUtils-2025.1.23.10.16.28.dist-info → MeUtils-2025.1.29.10.0.47.dist-info}/top_level.txt +0 -0
  35. /meutils/{request_utils/jwt_utils → jwt_utils}/__init__.py +0 -0
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # @Project : AI. @by PyCharm
4
+ # @File : mineru
5
+ # @Time : 2025/1/23 13:13
6
+ # @Author : betterme
7
+ # @WeChat : meutils
8
+ # @Software : PyCharm
9
+ # @Description :
10
+
11
+ from meutils.pipe import *
12
+
13
+ import requests
14
+
15
+ token = """
16
+ eyJ0eXBlIjoiSldUIiwiYWxnIjoiSFM1MTIifQ.eyJqdGkiOiI4MDAwNDQ3NyIsInJvbCI6IlJPTEVfUkVHSVNURVIiLCJpc3MiOiJPcGVuWExhYiIsImlhdCI6MTczNzYxMTQ5MiwiY2xpZW50SWQiOiJsa3pkeDU3bnZ5MjJqa3BxOXgydyIsInBob25lIjoiIiwidXVpZCI6IjczNTZjNjY1LTU4MTMtNGQxNC04ZjFiLWM0NWIyZmFhYTBhMCIsImVtYWlsIjoiMzEzMzAzMzAzQHFxLmNvbSIsImV4cCI6MTczODgyMTA5Mn0.i8CwWoRE6j5wAC_hD9z9amkWT56HdOewgXMFV4jMpg17JHB0HOY-K4o9zp06Puav2vxkuC3Lnqm_8ip7-QdxsQ
17
+ """
18
+ url = 'https://mineru.net/api/v4/extract/task'
19
+ header = {
20
+ 'Content-Type': 'application/json',
21
+ "Authorization": f"Bearer {token.strip()}"
22
+ }
23
+ data = {
24
+ 'url': 'https://cdn-mineru.openxlab.org.cn/demo/example.pdf',
25
+ 'is_ocr': True,
26
+ 'enable_formula': False,
27
+ }
28
+
29
+ res = requests.post(url, headers=header, json=data)
30
+ print(res.status_code)
31
+ print(res.json())
32
+ print(res.json()["data"])
33
+
34
+ # {'task_id': 'adb223f6-794b-4950-8d60-d766ebd0bf14'}
35
+
36
+ task_id = 'adb223f6-794b-4950-8d60-d766ebd0bf14'
37
+ import requests
38
+
39
+ url = f'https://mineru.net/api/v4/extract/task/{task_id}'
40
+ header = {
41
+ 'Content-Type':'application/json',
42
+ "Authorization": f"Bearer {token.strip()}"
43
+ }
44
+
45
+ res = requests.get(url, headers=header)
46
+ print(res.status_code)
47
+ print(res.json())
48
+ print(res.json()["data"])
@@ -459,7 +459,18 @@ class TextinImageProcessRequest(ImageProcessRequest):
459
459
 
460
460
 
461
461
  class ImageProcess(BaseModel):
462
- model: Literal["remove-watermark", "clarity", "expand", "rmbg-2.0"]
462
+ model: Literal[
463
+ "remove-watermark",
464
+ "remove-watermark-hunyuan",
465
+ "remove-watermark-textin",
466
+
467
+ "clarity",
468
+ "clarity-hunyuan",
469
+ "clarity-baidu",
470
+
471
+ "expand",
472
+ "rmbg-2.0"
473
+ ]
463
474
  image: str
464
475
  mask: Optional[str] = None
465
476
 
@@ -122,6 +122,14 @@ MODEL_PRICE = {
122
122
  "api-replicate-stable-diffusion-3.5-large-turbo": 0.040,
123
123
  "api-replicate-stable-diffusion-3.5-medium": 0.035,
124
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
+
125
133
  "flux": 0.01,
126
134
  "flux-schnell": 0.01,
127
135
  "flux-dev": 0.03,
@@ -130,9 +138,6 @@ MODEL_PRICE = {
130
138
  "flux.1.1-pro": 0.1,
131
139
  "black-forest-labs/flux.1.1-pro": 0.1,
132
140
 
133
- "stable-diffusion-3-5-large": 0.0001,
134
- "chat-stable-diffusion-3-5-large": 0.1,
135
-
136
141
  "step-1x-medium": 0.2,
137
142
  "chat-step-1x-medium": 0.2,
138
143
 
@@ -154,9 +159,14 @@ MODEL_PRICE = {
154
159
  # aitools
155
160
  "api-aitools": 0.007,
156
161
  "api-images-edits-remove-watermark": 0.01, # mask
157
- "api-images-edits-remove-textin": 0.02, # remove-watermark
162
+ "api-images-edits-remove-watermark-hunyuan": 0.01,
163
+
164
+ "api-images-edits-remove-watermark-textin": 0.02, # remove-watermark
158
165
 
159
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
+
160
170
  "api-images-edits-expand": 0.01,
161
171
  "api-images-edits-rmbg-2.0": 0.01,
162
172
 
@@ -182,7 +192,7 @@ MODEL_PRICE = {
182
192
  "api-kling-v1.6-pro-10s": 2 * 0.8 * 1.75,
183
193
 
184
194
  "api-vidu": 0.09,
185
- "api-vidu-vip": 0.3,
195
+ "api-vidu-vip": 0.6,
186
196
 
187
197
  "api-cogvideox": 0.1,
188
198
  "api-cogvideox-vip": 0.4,
@@ -558,6 +568,7 @@ MODEL_RATIO = {
558
568
  "gemini-2.0-flash-exp": 0.5,
559
569
  "gemini-2.0-flash-thinking-exp": 1,
560
570
  "gemini-2.0-flash-thinking-exp-1219": 1,
571
+ "gemini-2.0-flash-thinking-exp-01-21": 1,
561
572
 
562
573
  "gemini-1.5-pro-001": 1,
563
574
  "gemini-1.5-pro-002": 1,
@@ -725,6 +736,7 @@ COMPLETION_RATIO = {
725
736
  "gemini-2.0-flash-exp": 5,
726
737
  "gemini-2.0-flash-thinking-exp": 5,
727
738
  "gemini-2.0-flash-thinking-exp-1219": 5,
739
+ "gemini-2.0-flash-thinking-exp-01-21": 5,
728
740
 
729
741
  "hunyuan-a52b-instruct": 5,
730
742
  "qwen2.5-coder-32b-instruct": 3,
@@ -17,7 +17,7 @@ BAICHUAN = {
17
17
  'baichuan4': 50,
18
18
  'baichuan3-turbo': 6,
19
19
  'baichuan3-turbo-128k': 12,
20
- 'baichuan2-turbo': 4
20
+ 'baichuan2-turbo': 4,
21
21
  }
22
22
 
23
23
  if __name__ == '__main__':
@@ -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] = 0.0
118
+ frequency_penalty: Optional[float] = None
119
119
  user: Optional[str] = None
120
120
 
121
121
  # tools
@@ -63,10 +63,18 @@ class FalVideoRequest(BaseModel):
63
63
 
64
64
 
65
65
  class LipsyncVideoRquest(BaseModel):
66
- model: Union[str, Literal["latentsync", "sync-lipsync",]] = 'latentsync'
66
+ model: Union[str, Literal[
67
+ "latentsync", "sync-lipsync",
68
+ "lip_sync_avatar_std", "lip_sync_avatar_lively"
69
+ ]
70
+ ] = 'latentsync'
67
71
 
68
72
  video_url: Optional[str] = None
69
73
  audio_url: Optional[str] = None
70
74
  image_url: Optional[str] = None
71
75
 
72
76
  sync_mode: Union[str, Literal["cut_off", "loop", "bounce"]] = "cut_off"
77
+
78
+
79
+ if __name__ == '__main__':
80
+ print(LipsyncVideoRquest())
@@ -147,7 +147,7 @@ class ViduRequest(BaseModel):
147
147
  "input": input,
148
148
  "type": self.type or type,
149
149
  "settings": {
150
- "model_version": "1.5",
150
+ "model_version": "2.0",
151
151
  "style": "general",
152
152
  "duration": self.duration,
153
153
 
@@ -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"])