MeUtils 2024.12.9.11.53.50__py3-none-any.whl → 2024.12.9.17.20.54__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-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/METADATA +28 -28
- {MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/RECORD +14 -11
- examples/ann/__init__.py +11 -0
- examples/ann/main.py +31 -0
- meutils/apis/kuaishou/klingai.py +2 -2
- meutils/apis/kuaishou/klingai_video.py +2 -2
- meutils/apis/search/metaso.py +8 -8
- meutils/data/VERSION +1 -1
- meutils/llm/completions/kimi.py +47 -0
- meutils/llm/completions/xx.py +46 -2
- {MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/LICENSE +0 -0
- {MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/WHEEL +0 -0
- {MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/entry_points.txt +0 -0
- {MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: MeUtils
|
3
|
-
Version: 2024.12.9.
|
3
|
+
Version: 2024.12.9.17.20.54
|
4
4
|
Summary: description
|
5
5
|
Home-page: https://github.com/yuanjie-ai/MeUtils
|
6
6
|
Author: yuanjie
|
@@ -61,42 +61,42 @@ Requires-Dist: sse-starlette ; extra == 'ai'
|
|
61
61
|
Requires-Dist: openai ; extra == 'ai'
|
62
62
|
Requires-Dist: langchain ; extra == 'ai'
|
63
63
|
Provides-Extra: all
|
64
|
-
Requires-Dist:
|
65
|
-
Requires-Dist: seaborn ; extra == 'all'
|
64
|
+
Requires-Dist: jieba ; extra == 'all'
|
66
65
|
Requires-Dist: uvicorn ; extra == 'all'
|
66
|
+
Requires-Dist: openai ; extra == 'all'
|
67
|
+
Requires-Dist: sse-starlette ; extra == 'all'
|
68
|
+
Requires-Dist: langchain ; extra == 'all'
|
69
|
+
Requires-Dist: reportlab ; extra == 'all'
|
70
|
+
Requires-Dist: redis-py-cluster ; extra == 'all'
|
71
|
+
Requires-Dist: pretty-errors ; extra == 'all'
|
67
72
|
Requires-Dist: jmespath ; extra == 'all'
|
73
|
+
Requires-Dist: streamlit ; extra == 'all'
|
74
|
+
Requires-Dist: cachetools ; extra == 'all'
|
75
|
+
Requires-Dist: pymilvus ; extra == 'all'
|
76
|
+
Requires-Dist: filetype ; extra == 'all'
|
77
|
+
Requires-Dist: pymupd ; extra == 'all'
|
78
|
+
Requires-Dist: gunicorn ; extra == 'all'
|
68
79
|
Requires-Dist: asyncmy ; extra == 'all'
|
69
|
-
Requires-Dist:
|
80
|
+
Requires-Dist: pymongo ; extra == 'all'
|
81
|
+
Requires-Dist: simplejson ; extra == 'all'
|
82
|
+
Requires-Dist: pyarrow ; extra == 'all'
|
70
83
|
Requires-Dist: pandas-profiling[notebook] ; extra == 'all'
|
71
|
-
Requires-Dist:
|
72
|
-
Requires-Dist:
|
73
|
-
Requires-Dist:
|
74
|
-
Requires-Dist:
|
84
|
+
Requires-Dist: fastapi ; extra == 'all'
|
85
|
+
Requires-Dist: geopy ; extra == 'all'
|
86
|
+
Requires-Dist: schedule ; extra == 'all'
|
87
|
+
Requires-Dist: seaborn ; extra == 'all'
|
75
88
|
Requires-Dist: polars ; extra == 'all'
|
89
|
+
Requires-Dist: iteration-utilities ; extra == 'all'
|
90
|
+
Requires-Dist: dataframe-image ; extra == 'all'
|
76
91
|
Requires-Dist: thriftpy2 ; extra == 'all'
|
92
|
+
Requires-Dist: pymysql ; extra == 'all'
|
77
93
|
Requires-Dist: sqlalchemy ; extra == 'all'
|
78
|
-
Requires-Dist: simplejson ; extra == 'all'
|
79
|
-
Requires-Dist: fastapi ; extra == 'all'
|
80
|
-
Requires-Dist: jieba ; extra == 'all'
|
81
|
-
Requires-Dist: fastapi[all] ; extra == 'all'
|
82
|
-
Requires-Dist: pyarrow ; extra == 'all'
|
83
|
-
Requires-Dist: iteration-utilities ; extra == 'all'
|
84
|
-
Requires-Dist: jinja2 ; extra == 'all'
|
85
|
-
Requires-Dist: langchain ; extra == 'all'
|
86
|
-
Requires-Dist: schedule ; extra == 'all'
|
87
|
-
Requires-Dist: filetype ; extra == 'all'
|
88
|
-
Requires-Dist: streamlit ; extra == 'all'
|
89
|
-
Requires-Dist: pretty-errors ; extra == 'all'
|
90
|
-
Requires-Dist: geopy ; extra == 'all'
|
91
94
|
Requires-Dist: faiss-cpu ; extra == 'all'
|
92
|
-
Requires-Dist: openai ; extra == 'all'
|
93
95
|
Requires-Dist: missingno ; extra == 'all'
|
94
|
-
Requires-Dist:
|
95
|
-
Requires-Dist:
|
96
|
-
Requires-Dist:
|
97
|
-
Requires-Dist:
|
98
|
-
Requires-Dist: redis-py-cluster ; extra == 'all'
|
99
|
-
Requires-Dist: pymilvus ; extra == 'all'
|
96
|
+
Requires-Dist: pandas-summary ; extra == 'all'
|
97
|
+
Requires-Dist: thefuck ; extra == 'all'
|
98
|
+
Requires-Dist: jinja2 ; extra == 'all'
|
99
|
+
Requires-Dist: fastapi[all] ; extra == 'all'
|
100
100
|
Provides-Extra: ann
|
101
101
|
Requires-Dist: pymilvus ; extra == 'ann'
|
102
102
|
Requires-Dist: faiss-cpu ; extra == 'ann'
|
@@ -122,6 +122,8 @@ examples/_openaisdk/文件问答.py,sha256=jreGx6n4o6pJZ29sME3tRRCzbok0UNBvgj-en
|
|
122
122
|
examples/_openaisdk/文档解析.py,sha256=EvhJJ5VzOM9jDdw02LVaN05JJFcB1sbeLbmcsvzYUeI,804
|
123
123
|
examples/_openaisdk/模型测试.py,sha256=Nrq7WQp_v3Vz93dzilB3b7qydBft95Ak507hDoNZCVY,4142
|
124
124
|
examples/_openaisdk/阿里.py,sha256=dHALUUlLtC35IgzqPeN7dPHQqL4MIlwklSQvRbk_Nz0,2215
|
125
|
+
examples/ann/__init__.py,sha256=fWJ5mgZ9p8cPPdh0YwcAak55TeVeriDYyYYBYp3nrJk,271
|
126
|
+
examples/ann/main.py,sha256=53yNdEmdVRK3Vd11qzSOkAzS2DnGkENU9dRNPA7BN94,720
|
125
127
|
examples/apis/__init__.py,sha256=vExwEpOHXx4DeBFUt1TaH0lpZaTVazYtq9l8bcuUnZM,271
|
126
128
|
examples/apis/kl.py,sha256=HW9nQijAtwZh3YfsHgOpo7I9MLJONYogJXbKrrRj034,683
|
127
129
|
examples/apis/main.py,sha256=Zwks156ylkCsP-ufv4HJip4Ltb3-hmwvJarMISYPms4,459
|
@@ -359,8 +361,8 @@ meutils/apis/kling/kolors_virtual_try_on_web.py,sha256=UNjr-T9waujh2Gg8SSmnlfP3w
|
|
359
361
|
meutils/apis/kling/videos.py,sha256=6z3w0gQHPe3BQNid4ZO2DfYSqvry44EMehG9U0qSB3E,2115
|
360
362
|
meutils/apis/kling/鉴权.py,sha256=1kR67Mb0PxEo4ZxLVJZys4Iru9BUnS_Qqo2cbpLZNCU,842
|
361
363
|
meutils/apis/kuaishou/__init__.py,sha256=fDzJvVQl_CxHyiL3bCPH9x7gOLYfK6QuW2iQ33eez7c,243
|
362
|
-
meutils/apis/kuaishou/klingai.py,sha256=
|
363
|
-
meutils/apis/kuaishou/klingai_video.py,sha256=
|
364
|
+
meutils/apis/kuaishou/klingai.py,sha256=met1N4cWo6rSSNgMTStjYMhkjLPnQyuL8k3L0OiY2rE,21262
|
365
|
+
meutils/apis/kuaishou/klingai_video.py,sha256=5-f-H0QR8Mo5LR2d7VRm2_-mAmT_1DxrIrTDfyUKeTY,10061
|
364
366
|
meutils/apis/kuaishou/kolors.py,sha256=mjPOFeM1n5FrXfs50SJYlZSHqYk-mQ1wRFs-R-LRsa0,7203
|
365
367
|
meutils/apis/luma/__init__.py,sha256=51W483rgmMqFlRIHlkIIcKYMqggH4eY_bmV_mD3p7QI,271
|
366
368
|
meutils/apis/luma/luma.py,sha256=dAWZj2Q4t5eJNJbbtCfmUNDb1wx_OKxxtrZr0szI6tw,6026
|
@@ -388,7 +390,7 @@ meutils/apis/runwayml/__init__.py,sha256=90oL_3o8YkFPYm4R4PCxd3m9hgnHpOCLr0u-X4B
|
|
388
390
|
meutils/apis/runwayml/gen.py,sha256=JrfegC4pI2r7DprDLGMi5px0K1C1pSgopnz0lcJU5RY,5194
|
389
391
|
meutils/apis/search/__init__.py,sha256=TWEHzb_O2hKDpjfThEWOz1EI1bJeiN20IAvC8wYONQ4,271
|
390
392
|
meutils/apis/search/baichuan.py,sha256=OUD0TH7KzqSxtuRJgjJPWO8XRQIoUwW5RX7lWMo7BXw,268
|
391
|
-
meutils/apis/search/metaso.py,sha256=
|
393
|
+
meutils/apis/search/metaso.py,sha256=9aE3ZVuTMn_dZOD5F4XJMg344-4UCLMLYekY3yF-LE8,8557
|
392
394
|
meutils/apis/search/metaso_.py,sha256=PqMX3FLYbbAcc9qpqrPZ58LuSF29h0asZO1XMYmXbes,3144
|
393
395
|
meutils/apis/search/n.py,sha256=o7jzNoR5v_nAjgdUvWgebL3nvvo3ECpq2KCj9YhUNr4,4337
|
394
396
|
meutils/apis/search/searxng.py,sha256=RBPeq-AYj5D42gROrZNg0SxIWwWEW0oqrbQ3wEDH9k8,951
|
@@ -472,7 +474,7 @@ meutils/config_utils/lark_utils/demo.py,sha256=3g0Fs7oLaeW75T60gYWMLgyNg1OnfOjfH
|
|
472
474
|
meutils/config_utils/lark_utils/x.py,sha256=MlMQGhehP9xMEgetxVCX68XFaosfKoW1JA5cZ3JqN2w,1857
|
473
475
|
meutils/crawlers/__init__.py,sha256=TBU4xA-IOsHV-0yIkW7YXxn_QT7TT8NncqxO7IykEfs,271
|
474
476
|
meutils/data/SimHei.ttf,sha256=-XEnekS5yHP_URkT4XBI2w22ylV-KxudhkeIYFbrILA,10062565
|
475
|
-
meutils/data/VERSION,sha256=
|
477
|
+
meutils/data/VERSION,sha256=B6NDAXjxgBEWLQuaTjKwsvUn3byVQSjq8rN661bPf2A,19
|
476
478
|
meutils/data/_FLAG,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
477
479
|
meutils/data/_SUCCESS,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
478
480
|
meutils/data/__init__.py,sha256=Hfwkkxs4zHqKhxht0YrhS566a9P5axtmgNvM5wF8ceQ,243
|
@@ -554,11 +556,12 @@ meutils/llm/completions/__init__.py,sha256=Z9b0uVj0DuprlPVvLqb-jYf5hk7C1rD-c3fMI
|
|
554
556
|
meutils/llm/completions/cp.py,sha256=tGf3umHKXDH0KuTfN7BLr8yAvN6MYWLYR5UVaJkJs0c,4172
|
555
557
|
meutils/llm/completions/delilegal.py,sha256=mr53ps7I33SC8Fjy4rma-xoNF-mLgwdZfHgdSOyLtQY,5131
|
556
558
|
meutils/llm/completions/dify.py,sha256=dqL_8uxAp2d8M00pkyh2I30tflwi4pUyX-V6pwe3_BA,3048
|
559
|
+
meutils/llm/completions/kimi.py,sha256=TSkLObebIAb_oivOMq3aKx9qoXcMy611_g2yIKex9eo,1541
|
557
560
|
meutils/llm/completions/rag.py,sha256=cpQ1aZX2QI1QDfFpODTxWHPYglK6_3qrlUM_KHLBNhc,1112
|
558
561
|
meutils/llm/completions/tryblend.py,sha256=NfVRktn1QiE2k60PzEI-LmKuxZCc7mtL_KlsrVcZg4k,8957
|
559
562
|
meutils/llm/completions/tune.py,sha256=FypfUgsB34t-E9xI6WydJYEk_-phscrLOX1iUCeKb_E,10138
|
560
563
|
meutils/llm/completions/x.py,sha256=XE8aCyuhkpYq0nho1mq9lAdRU1yOPc8BpvCpNYYMYqM,630
|
561
|
-
meutils/llm/completions/xx.py,sha256=
|
564
|
+
meutils/llm/completions/xx.py,sha256=pPfVRczvXZFUvAUOAFr0MMHMb5kVPNfKVhOLKugq52M,1646
|
562
565
|
meutils/llm/completions/yuanbao.py,sha256=aN3MwR6yORFv5pGA1ODiLqlNKCfAKQslIfpruAD6m08,5468
|
563
566
|
meutils/llm/completions/rag/__init__.py,sha256=VH4g9H0pqMM1Rkjc1xefQb4Uh8f9vlTt6tjdD6G6Wc0,272
|
564
567
|
meutils/llm/completions/rag/fire.py,sha256=iScBYodmhPMPhYW10LhNBi9KREEIM8jBQvX8nBCYzv0,4479
|
@@ -807,9 +810,9 @@ meutils/tools/seize.py,sha256=nOKAS63w-Lbi48I0m2MPhdsokUTwxco0laPxYVmW4Mw,1064
|
|
807
810
|
meutils/tools/service_monitor.py,sha256=ibsLtBN2g2DL7ZnLJ8vhiZOiOcqTAyx711djDdBK-3M,1255
|
808
811
|
meutils/tools/sys_monitor.py,sha256=6MoyzrItqDUOSjfHcMJmMofQkEPTW36CT_aKui0rg84,429
|
809
812
|
meutils/tools/token_monitor.py,sha256=Np-YK-R4P4IPAXyZvMxwvXI4sFmNJQAQK1lSegNaYpA,997
|
810
|
-
MeUtils-2024.12.9.
|
811
|
-
MeUtils-2024.12.9.
|
812
|
-
MeUtils-2024.12.9.
|
813
|
-
MeUtils-2024.12.9.
|
814
|
-
MeUtils-2024.12.9.
|
815
|
-
MeUtils-2024.12.9.
|
813
|
+
MeUtils-2024.12.9.17.20.54.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
814
|
+
MeUtils-2024.12.9.17.20.54.dist-info/METADATA,sha256=E4Lynxs2jAurYuOVq_u_xRqTYUgAgw33wT07NWNCiBE,6143
|
815
|
+
MeUtils-2024.12.9.17.20.54.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
816
|
+
MeUtils-2024.12.9.17.20.54.dist-info/entry_points.txt,sha256=lufZlBHRqqZKdY-ZQJ4CSZb0qhV5hQC37egZna9M7ug,357
|
817
|
+
MeUtils-2024.12.9.17.20.54.dist-info/top_level.txt,sha256=cInfxMmkgNOskurdjwP5unau4rA7Uw48nu07tYhS7KY,22
|
818
|
+
MeUtils-2024.12.9.17.20.54.dist-info/RECORD,,
|
examples/ann/__init__.py
ADDED
examples/ann/main.py
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# @Project : AI. @by PyCharm
|
4
|
+
# @File : main
|
5
|
+
# @Time : 2024/12/9 16:53
|
6
|
+
# @Author : betterme
|
7
|
+
# @WeChat : meutils
|
8
|
+
# @Software : PyCharm
|
9
|
+
# @Description :
|
10
|
+
import pandas as pd
|
11
|
+
|
12
|
+
from meutils.pipe import *
|
13
|
+
from openai import OpenAI
|
14
|
+
|
15
|
+
openai = OpenAI()
|
16
|
+
|
17
|
+
df = pd.read_json('tbInfo2.txt', lines=True)
|
18
|
+
texts = df["表字段信息"].map(lambda d: d.values() | xjoin('\n'))
|
19
|
+
|
20
|
+
# 表字段信息
|
21
|
+
|
22
|
+
@diskcache
|
23
|
+
def create_embeddings(text):
|
24
|
+
return openai.embeddings.create(input=text, model="BAAI/bge-m3").data[0].embedding
|
25
|
+
|
26
|
+
|
27
|
+
if __name__ == '__main__':
|
28
|
+
pass
|
29
|
+
|
30
|
+
# for text in tqdm(df['表字段信息']):
|
31
|
+
# r = create_embeddings(str(text))
|
meutils/apis/kuaishou/klingai.py
CHANGED
@@ -141,7 +141,7 @@ async def create_task(request: KlingaiImageRequest, token: Optional[str] = None,
|
|
141
141
|
send_message(f"{data}\n\n{cookie}")
|
142
142
|
# 走代理
|
143
143
|
request_kwargs = {
|
144
|
-
"
|
144
|
+
"proxy": await get_one_proxy(from_redis=True),
|
145
145
|
# "proxies": proxies,
|
146
146
|
}
|
147
147
|
return
|
@@ -202,7 +202,7 @@ async def create_task_plus(request: KlingaiImageRequest, token: Optional[str] =
|
|
202
202
|
|
203
203
|
# 走代理
|
204
204
|
request_kwargs = {
|
205
|
-
"
|
205
|
+
"proxy": await get_one_proxy(from_redis=True),
|
206
206
|
# "proxies": proxies,
|
207
207
|
}
|
208
208
|
|
@@ -61,7 +61,7 @@ async def create_task(request: KlingaiVideoRequest, cookie: Optional[str] = None
|
|
61
61
|
|
62
62
|
# 走代理
|
63
63
|
request_kwargs = {
|
64
|
-
"
|
64
|
+
"proxy": await get_one_proxy(from_redis=True),
|
65
65
|
# "proxies": proxies,
|
66
66
|
}
|
67
67
|
|
@@ -106,7 +106,7 @@ async def create_task_plus(request: KlingaiVideoRequest, token: Optional[str] =
|
|
106
106
|
|
107
107
|
# 走代理
|
108
108
|
request_kwargs = {
|
109
|
-
"
|
109
|
+
"proxy": await get_one_proxy(from_redis=True),
|
110
110
|
# "proxies": proxies,
|
111
111
|
}
|
112
112
|
|
meutils/apis/search/metaso.py
CHANGED
@@ -28,9 +28,9 @@ MODELS = {
|
|
28
28
|
}
|
29
29
|
|
30
30
|
|
31
|
-
async def get_session_id(request: MetasoRequest, headers: Optional[dict] = None,
|
32
|
-
if
|
33
|
-
logger.debug(
|
31
|
+
async def get_session_id(request: MetasoRequest, headers: Optional[dict] = None, proxy: Optional[str] = None):
|
32
|
+
if proxy:
|
33
|
+
logger.debug(proxy)
|
34
34
|
|
35
35
|
headers = headers or {
|
36
36
|
# "cookie": "uid=65fe812a09727c19a54b0328; sid=eb6f4fe9034b4c9497fceca7ff6bafdd",
|
@@ -42,7 +42,7 @@ async def get_session_id(request: MetasoRequest, headers: Optional[dict] = None,
|
|
42
42
|
}
|
43
43
|
|
44
44
|
payload = request.model_dump(exclude_none=True)
|
45
|
-
async with httpx.AsyncClient(base_url=BASE_URL, headers=headers, timeout=30,
|
45
|
+
async with httpx.AsyncClient(base_url=BASE_URL, headers=headers, timeout=30, proxy=proxy) as client:
|
46
46
|
response = await client.post("/api/session", json=payload)
|
47
47
|
response.raise_for_status()
|
48
48
|
data = response.json()
|
@@ -100,9 +100,9 @@ async def create(request: ChatCompletionRequest, response_format: Optional[str]
|
|
100
100
|
cookie = await get_next_token_for_polling(FEISHU_URL)
|
101
101
|
headers["cookie"] = cookie
|
102
102
|
|
103
|
-
|
103
|
+
proxy = None
|
104
104
|
# proxies = await get_proxies()
|
105
|
-
session_id = await get_session_id(request, headers=headers,
|
105
|
+
session_id = await get_session_id(request, headers=headers, proxy=proxy)
|
106
106
|
# session_id = None
|
107
107
|
if session_id is None: # 走代理: 随机轮询
|
108
108
|
# ip = "121.196.183.67"
|
@@ -110,8 +110,8 @@ async def create(request: ChatCompletionRequest, response_format: Optional[str]
|
|
110
110
|
# "http://": f"http://{ip}:8443", # 自建 8443
|
111
111
|
# "https://": f"http://{ip}:8443",
|
112
112
|
# }
|
113
|
-
|
114
|
-
session_id = await get_session_id(request, headers=headers,
|
113
|
+
proxy = await get_one_proxy(feishu_url=FEISHU_URL_METASO)
|
114
|
+
session_id = await get_session_id(request, headers=headers, proxy=proxy)
|
115
115
|
|
116
116
|
token = await get_access_token(session_id)
|
117
117
|
params = {
|
meutils/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2024.12.09.
|
1
|
+
2024.12.09.17.20.54
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# @Project : AI. @by PyCharm
|
4
|
+
# @File : kimi
|
5
|
+
# @Time : 2024/12/9 13:14
|
6
|
+
# @Author : betterme
|
7
|
+
# @WeChat : meutils
|
8
|
+
# @Software : PyCharm
|
9
|
+
# @Description :
|
10
|
+
|
11
|
+
from meutils.pipe import *
|
12
|
+
import requests
|
13
|
+
import json
|
14
|
+
|
15
|
+
url = "https://kimi.moonshot.cn/api/chat/ctb5lpaflk1f1dda5mv0/completion/stream"
|
16
|
+
|
17
|
+
payload = json.dumps({
|
18
|
+
"messages": [
|
19
|
+
{
|
20
|
+
"role": "user",
|
21
|
+
"content": "hi"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"use_search": False,
|
25
|
+
"extend": {
|
26
|
+
"sidebar": True
|
27
|
+
},
|
28
|
+
"kimiplus_id": "kimi",
|
29
|
+
"use_research": False,
|
30
|
+
"use_math": False,
|
31
|
+
"refs": [],
|
32
|
+
"refs_file": []
|
33
|
+
})
|
34
|
+
headers = {
|
35
|
+
'x-msh-session-id': '1729958401005741781',
|
36
|
+
'Authorization': 'Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyLWNlbnRlciIsImV4cCI6MTczOTY4NDk3NywiaWF0IjoxNzMxOTA4OTc3LCJqdGkiOiJjc3RkYXNmZDBwODBpaGtkNTY4ZyIsInR5cCI6ImFjY2VzcyIsImFwcF9pZCI6ImtpbWkiLCJzdWIiOiJja2kwOTRiM2Flc2xnbGo2Zm8zMCIsInNwYWNlX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMmciLCJhYnN0cmFjdF91c2VyX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMzAifQ.uhEQ3sB6SJLR_Duuu4w-WilRsvllI611flQ_uQoI5ufm_GWtLLJfHZ8rE9-RS2YtkprtYovvEf1U1E6ybcL1Jg',
|
37
|
+
'x-msh-platform': 'web',
|
38
|
+
'x-msh-device-id': '7311290930975344143',
|
39
|
+
'R-Timezone': 'Asia/Shanghai',
|
40
|
+
'X-Traffic-Id': 'cki094b3aeslglj6fo30',
|
41
|
+
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
|
42
|
+
'Content-Type': 'application/json'
|
43
|
+
}
|
44
|
+
|
45
|
+
response = requests.request("POST", url, headers=headers, data=payload)
|
46
|
+
|
47
|
+
print(response.text)
|
meutils/llm/completions/xx.py
CHANGED
@@ -10,8 +10,52 @@
|
|
10
10
|
|
11
11
|
from meutils.pipe import *
|
12
12
|
|
13
|
-
|
13
|
+
# ResponseT = TypeVar(
|
14
|
+
# "ResponseT",
|
15
|
+
# bound=Union[
|
16
|
+
# object,
|
17
|
+
# str,
|
18
|
+
# None,
|
19
|
+
# "BaseModel",
|
20
|
+
# List[Any],
|
21
|
+
# Dict[str, Any],
|
22
|
+
# Response,
|
23
|
+
# ModelBuilderProtocol,
|
24
|
+
# "APIResponse[Any]",
|
25
|
+
# "AsyncAPIResponse[Any]",
|
26
|
+
# "HttpxBinaryResponseContent",
|
27
|
+
# ],
|
28
|
+
# )
|
14
29
|
|
30
|
+
payload = {
|
31
|
+
"messages": [
|
32
|
+
{
|
33
|
+
"role": "user",
|
34
|
+
"content": "hi"
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"use_search": False,
|
38
|
+
"extend": {
|
39
|
+
"sidebar": True
|
40
|
+
},
|
41
|
+
"kimiplus_id": "kimi",
|
42
|
+
"use_research": False,
|
43
|
+
"use_math": False,
|
44
|
+
"refs": [],
|
45
|
+
"refs_file": []
|
46
|
+
}
|
15
47
|
|
48
|
+
from openai import OpenAI
|
49
|
+
|
50
|
+
client = OpenAI(
|
51
|
+
base_url="https://kimi.moonshot.cn",
|
52
|
+
api_key="eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyLWNlbnRlciIsImV4cCI6MTczOTY4NDk3NywiaWF0IjoxNzMxOTA4OTc3LCJqdGkiOiJjc3RkYXNmZDBwODBpaGtkNTY4ZyIsInR5cCI6ImFjY2VzcyIsImFwcF9pZCI6ImtpbWkiLCJzdWIiOiJja2kwOTRiM2Flc2xnbGo2Zm8zMCIsInNwYWNlX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMmciLCJhYnN0cmFjdF91c2VyX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMzAifQ.uhEQ3sB6SJLR_Duuu4w-WilRsvllI611flQ_uQoI5ufm_GWtLLJfHZ8rE9-RS2YtkprtYovvEf1U1E6ybcL1Jg"
|
53
|
+
)
|
54
|
+
# "https://kimi.moonshot.cn/api/chat/ctb5lpaflk1f1dda5mv0/completion/stream"
|
55
|
+
resp = client.post(
|
56
|
+
"/api/chat/ctb5lpaflk1f1dda5mv0/completion/stream",
|
57
|
+
cast_to=object,
|
58
|
+
body=payload,
|
59
|
+
stream=True
|
60
|
+
)
|
16
61
|
|
17
|
-
s = httpx.get(url).text.split(',A=(0,a.$)("')[1][:40]
|
File without changes
|
File without changes
|
{MeUtils-2024.12.9.11.53.50.dist-info → MeUtils-2024.12.9.17.20.54.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|