MeUtils 2025.3.3.18.41.24__py3-none-any.whl → 2025.3.5.19.55.22__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.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/METADATA +264 -264
- {MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/RECORD +61 -33
- examples/_openaisdk/open_router.py +2 -1
- examples/_openaisdk/openai_files.py +16 -5
- examples/_openaisdk/openai_images.py +1 -0
- examples/_openaisdk/openai_moon.py +22 -19
- examples/sh/__init__.py +11 -0
- meutils/apis/baidu/bdaitpzs.py +9 -17
- meutils/apis/chatglm/glm_video_api.py +2 -2
- meutils/apis/images/edits.py +7 -2
- meutils/apis/jimeng/common.py +1 -1
- meutils/apis/oneapi/common.py +4 -4
- meutils/apis/proxy/ips.py +2 -0
- meutils/caches/common.py +4 -0
- meutils/data/VERSION +1 -1
- meutils/data/oneapi/NOTICE.html +12 -0
- meutils/data/oneapi/__init__.py +1 -1
- meutils/data/oneapi/index.html +275 -0
- meutils/io/_openai_files.py +31 -0
- meutils/io/openai_files.py +138 -0
- meutils/io/parsers/__init__.py +10 -0
- meutils/io/parsers/fileparser/PDF/346/212/275/345/217/226.py +58 -0
- meutils/io/parsers/fileparser/__init__.py +11 -0
- meutils/io/parsers/fileparser/common.py +91 -0
- meutils/io/parsers/fileparser/demo.py +41 -0
- meutils/io/parsers/fileparser/filetype/__init__.py +10 -0
- meutils/io/parsers/fileparser/filetype/__main__.py +37 -0
- meutils/io/parsers/fileparser/filetype/filetype.py +98 -0
- meutils/io/parsers/fileparser/filetype/helpers.py +140 -0
- meutils/io/parsers/fileparser/filetype/match.py +155 -0
- meutils/io/parsers/fileparser/filetype/types/__init__.py +118 -0
- meutils/io/parsers/fileparser/filetype/types/application.py +22 -0
- meutils/io/parsers/fileparser/filetype/types/archive.py +687 -0
- meutils/io/parsers/fileparser/filetype/types/audio.py +212 -0
- meutils/io/parsers/fileparser/filetype/types/base.py +29 -0
- meutils/io/parsers/fileparser/filetype/types/document.py +256 -0
- meutils/io/parsers/fileparser/filetype/types/font.py +115 -0
- meutils/io/parsers/fileparser/filetype/types/image.py +383 -0
- meutils/io/parsers/fileparser/filetype/types/isobmff.py +33 -0
- meutils/io/parsers/fileparser/filetype/types/video.py +223 -0
- meutils/io/parsers/fileparser/filetype/utils.py +84 -0
- meutils/io/parsers/fileparser/filetype.py +41 -0
- meutils/io/parsers/fileparser/mineru.py +48 -0
- meutils/io/parsers/fileparser/pdf.py +30 -0
- meutils/io/parsers/fileparser//350/241/250/346/240/274/346/212/275/345/217/226.py +118 -0
- meutils/llm/check_utils.py +33 -2
- meutils/llm/clients.py +1 -0
- meutils/llm/completions/chat_gemini.py +72 -0
- meutils/llm/completions/chat_plus.py +78 -0
- meutils/llm/completions/{agents/file.py → chat_spark.py} +46 -26
- meutils/llm/completions/qwenllm.py +57 -16
- meutils/llm/completions/yuanbao.py +29 -3
- meutils/llm/openai_utils/common.py +2 -2
- meutils/schemas/oneapi/common.py +22 -19
- meutils/schemas/openai_types.py +65 -29
- meutils/schemas/yuanbao_types.py +6 -7
- meutils/types.py +2 -0
- meutils/data/oneapi/NOTICE.md +0 -1
- meutils/data/oneapi/_NOTICE.md +0 -140
- meutils/llm/completions/gemini.py +0 -69
- {MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/LICENSE +0 -0
- {MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/WHEEL +0 -0
- {MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/top_level.txt +0 -0
@@ -1,69 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : gemini
|
5
|
-
# @Time : 2025/2/14 17:36
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
|
12
|
-
from meutils.pipe import *
|
13
|
-
from meutils.llm.openai_utils import to_openai_params
|
14
|
-
from meutils.llm.clients import chatfire_client
|
15
|
-
|
16
|
-
from meutils.schemas.openai_types import chat_completion, chat_completion_chunk, ChatCompletionRequest, CompletionUsage
|
17
|
-
|
18
|
-
"""
|
19
|
-
image => file
|
20
|
-
|
21
|
-
"type": "image_url",
|
22
|
-
"image_url": {
|
23
|
-
|
24
|
-
|
25
|
-
"""
|
26
|
-
|
27
|
-
|
28
|
-
async def create(request: ChatCompletionRequest):
|
29
|
-
data = to_openai_params(request)
|
30
|
-
|
31
|
-
if request.stream:
|
32
|
-
_chunk = ""
|
33
|
-
async for chunk in await chatfire_client.chat.completions.create(**data):
|
34
|
-
chunk = chunk.choices[0].delta.content or ""
|
35
|
-
yield chunk.removeprefix(_chunk)
|
36
|
-
_chunk = chunk
|
37
|
-
|
38
|
-
else:
|
39
|
-
response = await client.chat.completions.create(**data)
|
40
|
-
# logger.info(response)
|
41
|
-
yield response.choices[0].message.content
|
42
|
-
|
43
|
-
|
44
|
-
if __name__ == '__main__':
|
45
|
-
# [
|
46
|
-
# "qwen-plus-latest",
|
47
|
-
# "qvq-72b-preview",
|
48
|
-
# "qwq-32b-preview",
|
49
|
-
# "qwen2.5-coder-32b-instruct",
|
50
|
-
# "qwen-vl-max-latest",
|
51
|
-
# "qwen-turbo-latest",
|
52
|
-
# "qwen2.5-72b-instruct",
|
53
|
-
# "qwen2.5-32b-instruct"
|
54
|
-
# ]
|
55
|
-
request = ChatCompletionRequest(
|
56
|
-
# model="qwen-turbo-2024-11-01",
|
57
|
-
model="qwen-max-latest",
|
58
|
-
# model="qwen-plus-latest",
|
59
|
-
|
60
|
-
messages=[
|
61
|
-
{
|
62
|
-
'role': 'user',
|
63
|
-
'content': 'hi'
|
64
|
-
},
|
65
|
-
|
66
|
-
],
|
67
|
-
stream=False,
|
68
|
-
)
|
69
|
-
arun(create(request))
|
File without changes
|
File without changes
|
{MeUtils-2025.3.3.18.41.24.dist-info → MeUtils-2025.3.5.19.55.22.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|