pycoze 0.1.55__py3-none-any.whl → 0.1.56__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.
- pycoze/bot/agent/agent.py +11 -4
- {pycoze-0.1.55.dist-info → pycoze-0.1.56.dist-info}/METADATA +1 -1
- {pycoze-0.1.55.dist-info → pycoze-0.1.56.dist-info}/RECORD +6 -6
- {pycoze-0.1.55.dist-info → pycoze-0.1.56.dist-info}/LICENSE +0 -0
- {pycoze-0.1.55.dist-info → pycoze-0.1.56.dist-info}/WHEEL +0 -0
- {pycoze-0.1.55.dist-info → pycoze-0.1.56.dist-info}/top_level.txt +0 -0
pycoze/bot/agent/agent.py
CHANGED
@@ -3,7 +3,12 @@ import json
|
|
3
3
|
from langchain_openai import ChatOpenAI
|
4
4
|
from .chat import info
|
5
5
|
from .assistant import Runnable
|
6
|
-
from langchain_core.messages import
|
6
|
+
from langchain_core.messages import (
|
7
|
+
HumanMessage,
|
8
|
+
AIMessage,
|
9
|
+
AIMessageChunk,
|
10
|
+
SystemMessage,
|
11
|
+
)
|
7
12
|
from langchain_core.agents import AgentFinish
|
8
13
|
|
9
14
|
|
@@ -22,15 +27,17 @@ async def run_agent(agent, inputs: list):
|
|
22
27
|
and isinstance(event["data"]["input"], list)
|
23
28
|
):
|
24
29
|
input_list = event["data"]["input"]
|
25
|
-
print("input_list", input_list)
|
26
30
|
for msg in input_list:
|
31
|
+
if isinstance(msg, HumanMessage) or isinstance(
|
32
|
+
msg, SystemMessage
|
33
|
+
):
|
34
|
+
content_list = []
|
27
35
|
if isinstance(msg, AIMessage) and not isinstance(
|
28
36
|
msg, AIMessageChunk
|
29
37
|
):
|
30
38
|
content = msg.content
|
31
39
|
if content:
|
32
|
-
|
33
|
-
content_list = [content]
|
40
|
+
content_list.append(content)
|
34
41
|
elif kind == "on_chat_model_stream":
|
35
42
|
content = event["data"]["chunk"].content
|
36
43
|
if content:
|
@@ -5,7 +5,7 @@ pycoze/access/tool_for_bot.py,sha256=Nv6XlxcqaLaMVQNDkpcthlqaSxyfHoOfWiTScQXO22Y
|
|
5
5
|
pycoze/bot/__init__.py,sha256=pciDtfcIXda7iFt9uI5Fpm0JKpGBhdXHmJv4966WTVU,21
|
6
6
|
pycoze/bot/bot.py,sha256=URQYW8mbcsjIsO3pNT-QFzWNwQFtOhUJG62dfxqZTLM,2589
|
7
7
|
pycoze/bot/agent/__init__.py,sha256=IaYqQCJ3uBor92JdOxI_EY4HtYOHgej8lijr3UrN1Vc,161
|
8
|
-
pycoze/bot/agent/agent.py,sha256=
|
8
|
+
pycoze/bot/agent/agent.py,sha256=7xnz4a8LDyAVU0O3tS6n7_jSnr_lukQxfNR2znCWoV4,4611
|
9
9
|
pycoze/bot/agent/assistant.py,sha256=QLeWaPi415P9jruYOm8qcIbC94cXXAhJYmLTkyC9NTQ,1267
|
10
10
|
pycoze/bot/agent/chat.py,sha256=kc0qgcrBSXdiMy49JwThZTV-0PAvzAhiUvbI5ILiSnU,571
|
11
11
|
pycoze/bot/agent/agent_types/__init__.py,sha256=W2jTNMLqUMqgCMG0Tw0d8n7WpsbsnIonqaPR-YLegLU,210
|
@@ -22,8 +22,8 @@ pycoze/ui/ui_def.py,sha256=CNFYH8NC-WYmbceIPpxsRr9H6O006pMKukx7U-BOE1Q,3744
|
|
22
22
|
pycoze/utils/__init__.py,sha256=KExBkotf23dr2NfTEouWke5nJB1q2IuDXgHrmuyd95k,73
|
23
23
|
pycoze/utils/arg.py,sha256=rRujm1zKc0XlnNlpIJ6JAAaFiTzDGmL_RliIpSc5OD8,724
|
24
24
|
pycoze/utils/text_or_file.py,sha256=gpxZVWt2DW6YiEg_MnMuwg36VNf3TX383QD_1oZNB0Y,551
|
25
|
-
pycoze-0.1.
|
26
|
-
pycoze-0.1.
|
27
|
-
pycoze-0.1.
|
28
|
-
pycoze-0.1.
|
29
|
-
pycoze-0.1.
|
25
|
+
pycoze-0.1.56.dist-info/LICENSE,sha256=QStd_Qsd0-kAam_-sOesCIp_uKrGWeoKwt9M49NVkNU,1090
|
26
|
+
pycoze-0.1.56.dist-info/METADATA,sha256=TXSB2hYdFXA9X_7mdE4ru75Q5w7LYhfy_WDrpUEPzwA,719
|
27
|
+
pycoze-0.1.56.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
28
|
+
pycoze-0.1.56.dist-info/top_level.txt,sha256=76dPeDhKvOCleL3ZC5gl1-y4vdS1tT_U1hxWVAn7sFo,7
|
29
|
+
pycoze-0.1.56.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|