pycoze 0.1.209__tar.gz → 0.1.210__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pycoze-0.1.209 → pycoze-0.1.210}/PKG-INFO +1 -1
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/agent.py +1 -4
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent_chat.py +7 -4
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/bot.py +3 -5
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze.egg-info/PKG-INFO +1 -1
- {pycoze-0.1.209 → pycoze-0.1.210}/setup.py +1 -1
- {pycoze-0.1.209 → pycoze-0.1.210}/LICENSE +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/README.md +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ai/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ai/vram_reserve.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/automation/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/automation/browser/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/automation/browser/edge_driver_manager.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/agent_types/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/agent_types/const.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/assistant.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/bot/agent/chat.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/reference/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/reference/bot.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/reference/lib.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/reference/tool.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/reference/workflow.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ui/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ui/base.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ui/color.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ui/typ.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/ui/ui_def.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/utils/__init__.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/utils/arg.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/utils/env.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze/utils/text_or_file.py +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze.egg-info/SOURCES.txt +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze.egg-info/dependency_links.txt +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/pycoze.egg-info/top_level.txt +0 -0
- {pycoze-0.1.209 → pycoze-0.1.210}/setup.cfg +0 -0
@@ -13,13 +13,10 @@ from langchain_core.agents import AgentFinish
|
|
13
13
|
from .agent_types.const import HumanToolString
|
14
14
|
|
15
15
|
|
16
|
-
async def run_agent(agent, inputs: list, tool_compatibility_mode: bool
|
16
|
+
async def run_agent(agent, inputs: list, tool_compatibility_mode: bool):
|
17
17
|
exist_ids = set()
|
18
18
|
content_list = []
|
19
19
|
async for event in agent.astream_events(inputs, version="v2"):
|
20
|
-
if should_exit.is_set():
|
21
|
-
break
|
22
|
-
|
23
20
|
kind = event["event"]
|
24
21
|
if kind == "on_chain_end":
|
25
22
|
if "data" in event:
|
@@ -34,7 +34,7 @@ def load_abilities(bot_setting_file: str):
|
|
34
34
|
return abilities
|
35
35
|
|
36
36
|
|
37
|
-
async def agent_chat(bot_setting_file, history
|
37
|
+
async def agent_chat(bot_setting_file, history):
|
38
38
|
role_setting = load_role_setting(bot_setting_file)
|
39
39
|
abilities = load_abilities(bot_setting_file)
|
40
40
|
|
@@ -77,6 +77,9 @@ async def agent_chat(bot_setting_file, history, should_exit):
|
|
77
77
|
assistant_message=prompt,
|
78
78
|
tool_compatibility_mode=cfg["toolCompatibilityMode"],
|
79
79
|
)
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
try:
|
81
|
+
result = await run_agent(agent, history, cfg["toolCompatibilityMode"])
|
82
|
+
return result
|
83
|
+
except KeyboardInterrupt:
|
84
|
+
return CHAT_DATA["info"]
|
85
|
+
|
@@ -22,9 +22,8 @@ def chat(bot_setting_file: str):
|
|
22
22
|
raise ValueError("Invalid message")
|
23
23
|
message = json.loads(input_text[len(INPUT_MESSAGE) :])
|
24
24
|
history.append(HumanMessage(message["content"]))
|
25
|
-
|
26
|
-
|
27
|
-
history.append(AIMessage(CHAT_DATA["output"]))
|
25
|
+
result = asyncio.run(agent_chat(bot_setting_file, history))
|
26
|
+
history.append(AIMessage(result))
|
28
27
|
|
29
28
|
|
30
29
|
|
@@ -32,6 +31,5 @@ def chat(bot_setting_file: str):
|
|
32
31
|
def get_chat_response(bot_setting_file: str, input_text: str):
|
33
32
|
history = [HumanMessage(input_text)]
|
34
33
|
clear_chat_data()
|
35
|
-
|
36
|
-
asyncio.run(agent_chat(bot_setting_file, history, should_exit))
|
34
|
+
asyncio.run(agent_chat(bot_setting_file, history))
|
37
35
|
return CHAT_DATA["output"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|