isrpa 0.9.6__py3-none-any.whl → 0.9.7__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.
- isrpa/credentials.py +1 -1
- isrpa/llm_chat.py +24 -0
- {isrpa-0.9.6.dist-info → isrpa-0.9.7.dist-info}/METADATA +1 -1
- {isrpa-0.9.6.dist-info → isrpa-0.9.7.dist-info}/RECORD +6 -5
- {isrpa-0.9.6.dist-info → isrpa-0.9.7.dist-info}/WHEEL +0 -0
- {isrpa-0.9.6.dist-info → isrpa-0.9.7.dist-info}/top_level.txt +0 -0
isrpa/credentials.py
CHANGED
isrpa/llm_chat.py
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
from volcenginesdkarkruntime import Ark
|
2
|
+
#暂不统计消耗的token,后续要统计再改,无法传递token没法用dify的大模型,先保证这个功能能用起来
|
3
|
+
|
4
|
+
def ai_talk(input_str):
|
5
|
+
"""使用方舟SDK调用大模型API"""
|
6
|
+
try:
|
7
|
+
# 初始化客户端
|
8
|
+
client = Ark(api_key="f0f8b460-c4ea-42a4-a951-5e2e454022ee")
|
9
|
+
|
10
|
+
# 调用聊天补全API
|
11
|
+
completion = client.chat.completions.create(
|
12
|
+
model="deepseek-v3-250324",
|
13
|
+
messages=[
|
14
|
+
{"role": "user", "content": input_str}
|
15
|
+
],
|
16
|
+
max_tokens=512, # 最大生成token数
|
17
|
+
temperature=0.5 # 温度参数
|
18
|
+
)
|
19
|
+
|
20
|
+
# 返回AI生成的内容
|
21
|
+
return completion.choices[0].message.content
|
22
|
+
|
23
|
+
except Exception as e:
|
24
|
+
return f"ai_talk调用时出错: {str(e)}"
|
@@ -2,10 +2,11 @@ isrpa/OCR.py,sha256=nSDmVLo_z9GV7GUY57xBh2kumERG5_xtpUPxeF6ziQE,2509
|
|
2
2
|
isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
|
3
3
|
isrpa/Template_Exception.py,sha256=an6eQ1NMB8a9R-J0yyMdwHIZcZeDtdV5f7fWKZQsZ3s,819
|
4
4
|
isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
5
|
-
isrpa/credentials.py,sha256=
|
5
|
+
isrpa/credentials.py,sha256=Qgitrm2pKgA1E_iGPg12Qq2Ka52pgTQCBHnT2U62ZHs,3999
|
6
|
+
isrpa/llm_chat.py,sha256=lrufXl2JnnezXPF3FOMmmQFbqMTLjhCy7ujJTWeu460,863
|
6
7
|
isrpa/message.py,sha256=N0s6hMaC5S-Pi4EhwcSp-ngfBTBQyW6ymU9sI9dUSeE,11329
|
7
8
|
isrpa/utils.py,sha256=uPCb1A1vDB0nTlII2BJz9kS0amk7mvzVA7ilI-UYA8Q,51439
|
8
|
-
isrpa-0.9.
|
9
|
-
isrpa-0.9.
|
10
|
-
isrpa-0.9.
|
11
|
-
isrpa-0.9.
|
9
|
+
isrpa-0.9.7.dist-info/METADATA,sha256=Y_yaHUXMpR5uicuMfDZ1Mh88aQF_ol7-yiDl-lOdHn0,511
|
10
|
+
isrpa-0.9.7.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
11
|
+
isrpa-0.9.7.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
12
|
+
isrpa-0.9.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|