MeUtils 2025.4.20.23.17.29__py3-none-any.whl → 2025.4.23.16.0.20__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.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/METADATA +262 -262
- {MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/RECORD +26 -23
- examples/_openaisdk/dalle3.py +2 -0
- examples/_openaisdk/openai_google.py +57 -40
- examples/_openaisdk/zhipu_/346/231/272/350/203/275/344/275/223.py +12 -4
- examples/bserver.py +85 -63
- meutils/apis/chatglm/chat.py +127 -0
- meutils/apis/google/chat.py +34 -10
- meutils/apis/google/gemini_sdk.py +25 -3
- meutils/apis/google/upload.py +51 -0
- meutils/apis/jimeng/images.py +1 -1
- meutils/apis/proxy/kdlapi.py +16 -8
- meutils/apis/search/zhipu_web_search.py +5 -2
- meutils/apis/volcengine_apis/images.py +5 -4
- meutils/data/VERSION +1 -1
- meutils/db/redis_db.py +4 -2
- meutils/io/files_utils.py +1 -1
- meutils/llm/completions/assistants/zhipu.py +225 -0
- meutils/llm/completions/chat_spark.py +104 -103
- meutils/llm/openai_polling/chat.py +41 -9
- meutils/schemas/oneapi/common.py +11 -1
- meutils/schemas/openai_types.py +2 -0
- {MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/LICENSE +0 -0
- {MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/WHEEL +0 -0
- {MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/top_level.txt +0 -0
@@ -111,125 +111,126 @@ if __name__ == '__main__':
|
|
111
111
|
# ]
|
112
112
|
# },
|
113
113
|
|
114
|
+
{
|
115
|
+
'role': 'user',
|
116
|
+
# "content": '你好',
|
117
|
+
# "content": [
|
118
|
+
# {"type": "text", "text": "描述第一张图片"},
|
119
|
+
#
|
120
|
+
# {"type": "image_url", "image_url": "https://oss.ffire.cc/files/kling_watermark.png"},
|
121
|
+
# # {"type": "image_url", "image_url": "https://oss.ffire.cc/files/nsfw.jpg"}
|
122
|
+
#
|
123
|
+
# ],
|
124
|
+
|
125
|
+
# 'content': {
|
126
|
+
# "type": "file_url",
|
127
|
+
# "file_url": {"url": "https://mj101-1317487292.cos.ap-shanghai.myqcloud.com/ai/test.pdf", "detai": "auto"}
|
128
|
+
# },
|
129
|
+
# 'content': "https://oss.ffire.cc/files/%E6%8B%9B%E6%A0%87%E6%96%87%E4%BB%B6%E5%A4%87%E6%A1%88%E8%A1%A8%EF%BC%88%E7%AC%AC%E4%BA%8C%E6%AC%A1%EF%BC%89.pdf 这个文件讲了什么?",
|
130
|
+
# 'content': "https://translate.google.com/?sl=zh-CN&tl=en&text=%E6%8F%90%E4%BE%9B%E6%96%B9&op=tr1anslate 这个文件讲了什么?",
|
131
|
+
|
132
|
+
# "content": "https://oss.ffire.cc/files/百炼系列手机产品介绍.docx 总结下"
|
133
|
+
# "content": "https://mj101-1317487292.cos.ap-shanghai.myqcloud.com/ai/test.pdf\n\n总结下"
|
134
|
+
|
135
|
+
# "content": "https://admin.ilovechatgpt.top/file/lunIMYAIzhinengzhushouduishenghuodocx_14905733.docx 总结",
|
136
|
+
"content": "http://admin.ilovechatgpt.top/file/xinjianMicrosoftWordwendangdoc-9052714901036-bGSJLeKbqQdnIZZn.doc 111111234234",
|
137
|
+
|
138
|
+
},
|
139
|
+
#
|
140
|
+
# {'role': 'assistant', 'content': "好的"},
|
141
|
+
#
|
114
142
|
# {
|
115
143
|
# 'role': 'user',
|
116
|
-
# # "content": '
|
144
|
+
# # "content": '描述第一张图片',
|
117
145
|
# "content": [
|
118
146
|
# {"type": "text", "text": "描述第一张图片"},
|
119
147
|
#
|
120
|
-
# {"type": "image_url", "image_url": "https://oss.ffire.cc/files/
|
121
|
-
# # {"type": "image_url", "image_url": "https://oss.ffire.cc/files/nsfw.jpg"}
|
148
|
+
# {"type": "image_url", "image_url": "https://oss.ffire.cc/files/nsfw.jpg"}
|
122
149
|
#
|
123
150
|
# ],
|
124
151
|
#
|
125
|
-
# # 'content': {
|
126
|
-
# # "type": "file_url",
|
127
|
-
# # "file_url": {"url": "https://mj101-1317487292.cos.ap-shanghai.myqcloud.com/ai/test.pdf", "detai": "auto"}
|
128
|
-
# # },
|
129
|
-
# # 'content': "https://oss.ffire.cc/files/%E6%8B%9B%E6%A0%87%E6%96%87%E4%BB%B6%E5%A4%87%E6%A1%88%E8%A1%A8%EF%BC%88%E7%AC%AC%E4%BA%8C%E6%AC%A1%EF%BC%89.pdf 这个文件讲了什么?",
|
130
|
-
# # 'content': "https://translate.google.com/?sl=zh-CN&tl=en&text=%E6%8F%90%E4%BE%9B%E6%96%B9&op=tr1anslate 这个文件讲了什么?",
|
131
|
-
#
|
132
|
-
# # "content": "https://oss.ffire.cc/files/百炼系列手机产品介绍.docx 总结下"
|
133
|
-
# # "content": "https://mj101-1317487292.cos.ap-shanghai.myqcloud.com/ai/test.pdf\n\n总结下"
|
134
|
-
#
|
135
|
-
# # "content": "https://admin.ilovechatgpt.top/file/lunIMYAIzhinengzhushouduishenghuodocx_14905733.docx 总结"
|
136
|
-
#
|
137
152
|
# },
|
153
|
+
# {
|
154
|
+
# 'role': 'user',
|
155
|
+
# 'content': [
|
156
|
+
# {
|
157
|
+
# "type": "text",
|
158
|
+
# "text": "总结下"
|
159
|
+
# },
|
138
160
|
#
|
139
|
-
#
|
140
|
-
#
|
161
|
+
# {
|
162
|
+
# "type": "image_url",
|
163
|
+
# "image_url": "xx"
|
164
|
+
# }
|
165
|
+
# ]
|
166
|
+
# },
|
141
167
|
# {
|
142
168
|
# 'role': 'user',
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
169
|
+
# 'content': [
|
170
|
+
# {
|
171
|
+
# "type": "text",
|
172
|
+
# "text": "总结下"
|
173
|
+
# },
|
146
174
|
#
|
147
|
-
# {
|
175
|
+
# {
|
176
|
+
# "type": "image_url",
|
177
|
+
# "image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
178
|
+
# }
|
179
|
+
# ]
|
180
|
+
# },
|
181
|
+
# {
|
182
|
+
# 'role': 'user',
|
183
|
+
# 'content': [
|
184
|
+
# {
|
185
|
+
# "type": "text",
|
186
|
+
# "text": "总结下"
|
187
|
+
# },
|
148
188
|
#
|
149
|
-
#
|
189
|
+
# {
|
190
|
+
# "type": "image_url",
|
191
|
+
# "image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
192
|
+
# }
|
193
|
+
# ]
|
194
|
+
# },
|
195
|
+
# {
|
196
|
+
# 'role': 'assistant',
|
197
|
+
# 'content': "你好"
|
198
|
+
# },
|
199
|
+
# {
|
200
|
+
# 'role': 'user',
|
201
|
+
# 'content': [
|
202
|
+
# {
|
203
|
+
# "type": "text",
|
204
|
+
# "text": "总结下"
|
205
|
+
# },
|
150
206
|
#
|
207
|
+
# {
|
208
|
+
# "type": "image_url",
|
209
|
+
# "image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
210
|
+
# }
|
211
|
+
# ]
|
212
|
+
# },
|
213
|
+
# {
|
214
|
+
# 'role': 'assistant',
|
215
|
+
# 'content': "1"
|
216
|
+
# },
|
217
|
+
# {
|
218
|
+
# 'role': 'user',
|
219
|
+
# 'content': [
|
220
|
+
# {
|
221
|
+
# "type": "text",
|
222
|
+
# "text": "总结1"
|
223
|
+
# }
|
224
|
+
# ]
|
225
|
+
# },
|
226
|
+
# {
|
227
|
+
# 'role': 'assistant',
|
228
|
+
# 'content': "2"
|
229
|
+
# },
|
230
|
+
# {
|
231
|
+
# 'role': 'user',
|
232
|
+
# 'content': "总结2"
|
151
233
|
# },
|
152
|
-
{
|
153
|
-
'role': 'user',
|
154
|
-
'content': [
|
155
|
-
{
|
156
|
-
"type": "text",
|
157
|
-
"text": "总结下"
|
158
|
-
},
|
159
|
-
|
160
|
-
{
|
161
|
-
"type": "image_url",
|
162
|
-
"image_url": "xx"
|
163
|
-
}
|
164
|
-
]
|
165
|
-
},
|
166
|
-
{
|
167
|
-
'role': 'user',
|
168
|
-
'content': [
|
169
|
-
{
|
170
|
-
"type": "text",
|
171
|
-
"text": "总结下"
|
172
|
-
},
|
173
|
-
|
174
|
-
{
|
175
|
-
"type": "image_url",
|
176
|
-
"image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
177
|
-
}
|
178
|
-
]
|
179
|
-
},
|
180
|
-
{
|
181
|
-
'role': 'user',
|
182
|
-
'content': [
|
183
|
-
{
|
184
|
-
"type": "text",
|
185
|
-
"text": "总结下"
|
186
|
-
},
|
187
|
-
|
188
|
-
{
|
189
|
-
"type": "image_url",
|
190
|
-
"image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
191
|
-
}
|
192
|
-
]
|
193
|
-
},
|
194
|
-
{
|
195
|
-
'role': 'assistant',
|
196
|
-
'content': "你好"
|
197
|
-
},
|
198
|
-
{
|
199
|
-
'role': 'user',
|
200
|
-
'content': [
|
201
|
-
{
|
202
|
-
"type": "text",
|
203
|
-
"text": "总结下"
|
204
|
-
},
|
205
|
-
|
206
|
-
{
|
207
|
-
"type": "image_url",
|
208
|
-
"image_url": "https://oss.ffire.cc/files/招标文件备案表(第二次).pdf"
|
209
|
-
}
|
210
|
-
]
|
211
|
-
},
|
212
|
-
{
|
213
|
-
'role': 'assistant',
|
214
|
-
'content': "1"
|
215
|
-
},
|
216
|
-
{
|
217
|
-
'role': 'user',
|
218
|
-
'content': [
|
219
|
-
{
|
220
|
-
"type": "text",
|
221
|
-
"text": "总结1"
|
222
|
-
}
|
223
|
-
]
|
224
|
-
},
|
225
|
-
{
|
226
|
-
'role': 'assistant',
|
227
|
-
'content': "2"
|
228
|
-
},
|
229
|
-
{
|
230
|
-
'role': 'user',
|
231
|
-
'content': "总结2"
|
232
|
-
},
|
233
234
|
# 'content': [
|
234
235
|
# {
|
235
236
|
# "type": "text",
|
@@ -38,6 +38,10 @@ class Completions(object):
|
|
38
38
|
if not any(i in request.model for i in ["vl", 'vision']) and (urls := request.last_urls.get("image_url")):
|
39
39
|
# logger.debug(request)
|
40
40
|
if request.model.startswith(("gemini",)):
|
41
|
+
|
42
|
+
# request.reasoning_effort
|
43
|
+
# "low", "medium", "high"
|
44
|
+
|
41
45
|
if urls[-1].startswith("http"):
|
42
46
|
base64_list = await to_base64(urls, content_type="image/png")
|
43
47
|
else:
|
@@ -77,6 +81,11 @@ class Completions(object):
|
|
77
81
|
data.pop("frequency_penalty", None)
|
78
82
|
data.pop("extra_body", None)
|
79
83
|
|
84
|
+
if "thinking" in request.model and request.reasoning_effort is None:
|
85
|
+
data['model'] = data['model'].removesuffix("-thinking")
|
86
|
+
data['reasoning_effort'] = None
|
87
|
+
# data['reasoning_effort'] = "low"
|
88
|
+
|
80
89
|
return await self.client.chat.completions.create(**data)
|
81
90
|
|
82
91
|
|
@@ -116,22 +125,44 @@ if __name__ == '__main__':
|
|
116
125
|
max_tokens=None,
|
117
126
|
)
|
118
127
|
# arun(Completions().create(request))
|
128
|
+
# d = {
|
129
|
+
# "model": "gemini-2.5-pro-exp-03-25",
|
130
|
+
# "messages": [
|
131
|
+
# {
|
132
|
+
# "content": [
|
133
|
+
# {
|
134
|
+
# "text": "The following is an open-ended problem from an International Math competition. Please calculate the answer according to the given requirements and the information provided. Please use LaTeX format to represent the variables and formulas used in the solution process and results. Please end your solution with \"So the final answer is \boxed{multiple answers connected with commas}(unit).\" and give the result explicitly, note that the unit of the answer should not be included in \boxed{}.\nConsider the following system of equations in which all logarithms have base 10:\n\n$$\n\begin{aligned}\n(\log x)(\log y)-3 \log 5 y-\log 8 x & =a \\n(\log y)(\log z)-4 \log 5 y-\log 16 z & =b \\n(\log z)(\log x)-4 \log 8 x-3 \log 625 z & =c\n\end{aligned}\n$$\nIf $a=-4, b=4$, and $c=-18$, solve the system of equations.",
|
135
|
+
# "type": "text"
|
136
|
+
# },
|
137
|
+
# {
|
138
|
+
# "image_url": {
|
139
|
+
# "detail": "low",
|
140
|
+
# "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABAAEADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//2Q=="
|
141
|
+
# },
|
142
|
+
# "type": "image_url"
|
143
|
+
# }
|
144
|
+
# ],
|
145
|
+
# "role": "user"
|
146
|
+
# }
|
147
|
+
# ],
|
148
|
+
# "stream": False,
|
149
|
+
# "top_p": 0.7,
|
150
|
+
# "temperature": 0.7,
|
151
|
+
# "n": 1
|
152
|
+
# }
|
153
|
+
|
119
154
|
d = {
|
120
155
|
"model": "gemini-2.5-pro-exp-03-25",
|
156
|
+
# "model": "gemini-2.5-pro-exp-03-25-thinking",
|
157
|
+
|
121
158
|
"messages": [
|
122
159
|
{
|
123
160
|
"content": [
|
124
161
|
{
|
125
|
-
"text": "
|
162
|
+
"text": "9个8如何加减乘除运直得到1000",
|
126
163
|
"type": "text"
|
127
164
|
},
|
128
|
-
|
129
|
-
"image_url": {
|
130
|
-
"detail": "low",
|
131
|
-
"url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABAAEADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//2Q=="
|
132
|
-
},
|
133
|
-
"type": "image_url"
|
134
|
-
}
|
165
|
+
|
135
166
|
],
|
136
167
|
"role": "user"
|
137
168
|
}
|
@@ -139,7 +170,8 @@ if __name__ == '__main__':
|
|
139
170
|
"stream": False,
|
140
171
|
"top_p": 0.7,
|
141
172
|
"temperature": 0.7,
|
142
|
-
"n": 1
|
173
|
+
"n": 1,
|
174
|
+
"reasoning_effort": None
|
143
175
|
}
|
144
176
|
|
145
177
|
# request = request.construct(**d)
|
meutils/schemas/oneapi/common.py
CHANGED
@@ -72,6 +72,10 @@ MODEL_PRICE = {
|
|
72
72
|
"ppt": 0.1,
|
73
73
|
"ppt-islide": 0.1,
|
74
74
|
|
75
|
+
# grok
|
76
|
+
"grok-3": 0.01,
|
77
|
+
"grok-3-image": 0.02,
|
78
|
+
|
75
79
|
# 虚拟换衣fish
|
76
80
|
"api-kolors-virtual-try-on": 0.1,
|
77
81
|
"official-api-kolors-virtual-try-on": 0.8,
|
@@ -252,6 +256,7 @@ MODEL_PRICE = {
|
|
252
256
|
"o3-mini": 0.05,
|
253
257
|
"o3-mini-high": 0.1,
|
254
258
|
|
259
|
+
"o4-mini": 0.05 * 0.8,
|
255
260
|
"o4-mini-high": 0.15 * 0.8,
|
256
261
|
|
257
262
|
"gpt-4-all": 0.1,
|
@@ -849,6 +854,8 @@ MODEL_RATIO = {
|
|
849
854
|
# 临时
|
850
855
|
"ep-20240515073409-dlpqp": 5,
|
851
856
|
"microsoft/phi-4": 0.035 * 5,
|
857
|
+
"mistral-small-3.1-24b-instruct": 0.1,
|
858
|
+
"mistral-small-24b-instruct-2501": 0.1,
|
852
859
|
|
853
860
|
"meta-llama/Llama-3.2-11B-Vision-Instruct": 0.1,
|
854
861
|
|
@@ -1134,7 +1141,10 @@ COMPLETION_RATIO = {
|
|
1134
1141
|
"step-1.5v-mini": 5,
|
1135
1142
|
"step-1o-vision-32k": 5,
|
1136
1143
|
|
1137
|
-
"meta-llama/Llama-3.2-11B-Vision-Instruct": 4
|
1144
|
+
"meta-llama/Llama-3.2-11B-Vision-Instruct": 4,
|
1145
|
+
|
1146
|
+
"mistral-small-3.1-24b-instruct": 0.1,
|
1147
|
+
"mistral-small-24b-instruct-2501": 3
|
1138
1148
|
|
1139
1149
|
}
|
1140
1150
|
|
meutils/schemas/openai_types.py
CHANGED
File without changes
|
File without changes
|
{MeUtils-2025.4.20.23.17.29.dist-info → MeUtils-2025.4.23.16.0.20.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|