pycoze 0.1.271__tar.gz → 0.1.279__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pycoze-0.1.271 → pycoze-0.1.279}/PKG-INFO +6 -1
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/api/lib/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/api/lib/tab_cls.py +7 -8
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/api/lib/view.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/agent.py +9 -5
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/utils/socket.py +3 -3
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze.egg-info/PKG-INFO +6 -1
- {pycoze-0.1.271 → pycoze-0.1.279}/setup.py +1 -1
- {pycoze-0.1.271 → pycoze-0.1.279}/LICENSE +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/README.md +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/llm/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/llm/chat.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/llm/text_to_image_prompt.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/llm/think.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ai/vram_reserve.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/api/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/api/lib/window_cls.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/agent_types/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/agent_types/const.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/assistant.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent/chat.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/agent_chat.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/bot/bot.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/reference/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/reference/bot.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/reference/lib.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/reference/tool.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/reference/workflow.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ui/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ui/base.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ui/color.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ui/typ.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/ui/ui_def.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/utils/__init__.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/utils/arg.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/utils/env.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze/utils/text_or_file.py +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze.egg-info/SOURCES.txt +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze.egg-info/dependency_links.txt +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/pycoze.egg-info/top_level.txt +0 -0
- {pycoze-0.1.271 → pycoze-0.1.279}/setup.cfg +0 -0
@@ -1,9 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pycoze
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.279
|
4
4
|
Summary: Package for pycoze only!
|
5
|
+
Home-page: UNKNOWN
|
5
6
|
Author: Yuan Jie Xiong
|
6
7
|
Author-email: aiqqqqqqq@qq.com
|
8
|
+
License: UNKNOWN
|
9
|
+
Platform: UNKNOWN
|
7
10
|
Classifier: Programming Language :: Python :: 3
|
8
11
|
Classifier: License :: OSI Approved :: MIT License
|
9
12
|
Classifier: Operating System :: OS Independent
|
@@ -25,3 +28,5 @@ Package for pycoze only!
|
|
25
28
|
<!-- python setup.py sdist bdist_wheel -->
|
26
29
|
<!-- twine upload dist/* -->
|
27
30
|
<!-- 修改src\renderer\layout\init\const.ts中的库版本要求 -->
|
31
|
+
|
32
|
+
|
File without changes
|
@@ -9,9 +9,8 @@ socket = utils.socket
|
|
9
9
|
params = utils.params
|
10
10
|
|
11
11
|
class TabCls:
|
12
|
-
|
13
12
|
def open_workflow(self, workflow_id: str, wait_for_open=True) -> WorkflowCls:
|
14
|
-
item_path = os.path.join(params["workspacePath"], 'workflow', workflow_id)
|
13
|
+
item_path = os.path.join(params["workspacePath"], 'User', 'Local', 'workflow', workflow_id)
|
15
14
|
if not os.path.isabs(item_path):
|
16
15
|
item_path = os.path.abspath(item_path)
|
17
16
|
info_path = os.path.join(item_path, "info.json")
|
@@ -23,10 +22,6 @@ class TabCls:
|
|
23
22
|
self._wait_for_tab_open(location)
|
24
23
|
return WorkflowCls(location)
|
25
24
|
|
26
|
-
def get_active(self) -> ViewCls:
|
27
|
-
result = socket.post_and_recv_result("get-active-tab", {})
|
28
|
-
return self._result_to_view(result)
|
29
|
-
|
30
25
|
def _wait_for_tab_open(self, location: list[str] | ViewCls):
|
31
26
|
times = 0
|
32
27
|
while not self.is_tab_open(location):
|
@@ -35,9 +30,13 @@ class TabCls:
|
|
35
30
|
if times > 1000:
|
36
31
|
raise Exception("Tab open timeout")
|
37
32
|
|
38
|
-
def
|
33
|
+
def get_active(self) -> list[str]:
|
34
|
+
result = socket.post_and_recv_result("get-active-tab", {})
|
35
|
+
return result
|
36
|
+
|
37
|
+
def get_all(self) -> list[list[str]]:
|
39
38
|
results = socket.post_and_recv_result("get-all-tabs", {})
|
40
|
-
return
|
39
|
+
return results
|
41
40
|
|
42
41
|
def close_tab(self, location: list[str] | ViewCls):
|
43
42
|
if isinstance(location, ViewCls):
|
File without changes
|
@@ -9,14 +9,13 @@ from langchain_core.messages import (
|
|
9
9
|
AIMessageChunk,
|
10
10
|
SystemMessage,
|
11
11
|
)
|
12
|
-
from langchain_core.agents import AgentFinish
|
13
12
|
from .agent_types.const import HumanToolString
|
14
13
|
|
15
14
|
|
16
15
|
async def run_agent(agent, inputs: list, tool_compatibility_mode: bool):
|
17
16
|
exist_ids = set()
|
18
17
|
content_list = []
|
19
|
-
async for event in agent.astream_events(inputs, version="
|
18
|
+
async for event in agent.astream_events(inputs, version="v1"):
|
20
19
|
kind = event["event"]
|
21
20
|
if kind == "on_chain_end":
|
22
21
|
if "data" in event:
|
@@ -28,8 +27,13 @@ async def run_agent(agent, inputs: list, tool_compatibility_mode: bool):
|
|
28
27
|
):
|
29
28
|
input_list = event["data"]["input"]
|
30
29
|
for msg in input_list:
|
31
|
-
if isinstance(msg, HumanMessage) or isinstance(
|
32
|
-
|
30
|
+
if isinstance(msg, HumanMessage) or isinstance(
|
31
|
+
msg, SystemMessage
|
32
|
+
):
|
33
|
+
if (
|
34
|
+
not tool_compatibility_mode
|
35
|
+
or not msg.content.startswith(HumanToolString)
|
36
|
+
):
|
33
37
|
content_list = [] # 防止内容重复
|
34
38
|
if isinstance(msg, AIMessage) and not isinstance(
|
35
39
|
msg, AIMessageChunk
|
@@ -88,4 +92,4 @@ if __name__ == "__main__":
|
|
88
92
|
)
|
89
93
|
|
90
94
|
inputs = [HumanMessage(content="计算根号7+根号88")]
|
91
|
-
print(asyncio.run(run_agent(agent, inputs, True, threading.Event())))
|
95
|
+
print(asyncio.run(run_agent(agent, inputs, True, threading.Event())))
|
@@ -5,14 +5,14 @@ from pycoze import utils
|
|
5
5
|
|
6
6
|
|
7
7
|
params = utils.params
|
8
|
-
tcp_port = params["tcpPort"]
|
9
8
|
|
10
9
|
|
11
10
|
class TcpSocket:
|
12
11
|
def __init__(self):
|
13
|
-
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
14
|
-
self.socket.connect(("localhost", int(tcp_port)))
|
15
12
|
self.is_connected = True
|
13
|
+
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
14
|
+
if params is not None:
|
15
|
+
self.socket.connect(("localhost", int(params["tcpPort"])))
|
16
16
|
|
17
17
|
def post(self, subject, message):
|
18
18
|
subject = "python-event:" + subject
|
@@ -1,9 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pycoze
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.279
|
4
4
|
Summary: Package for pycoze only!
|
5
|
+
Home-page: UNKNOWN
|
5
6
|
Author: Yuan Jie Xiong
|
6
7
|
Author-email: aiqqqqqqq@qq.com
|
8
|
+
License: UNKNOWN
|
9
|
+
Platform: UNKNOWN
|
7
10
|
Classifier: Programming Language :: Python :: 3
|
8
11
|
Classifier: License :: OSI Approved :: MIT License
|
9
12
|
Classifier: Operating System :: OS Independent
|
@@ -25,3 +28,5 @@ Package for pycoze only!
|
|
25
28
|
<!-- python setup.py sdist bdist_wheel -->
|
26
29
|
<!-- twine upload dist/* -->
|
27
30
|
<!-- 修改src\renderer\layout\init\const.ts中的库版本要求 -->
|
31
|
+
|
32
|
+
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|