pycoze 0.1.174__tar.gz → 0.1.176__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. {pycoze-0.1.174 → pycoze-0.1.176}/PKG-INFO +1 -1
  2. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/chat.py +3 -2
  3. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent_chat.py +2 -1
  4. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/bot.py +4 -5
  5. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze.egg-info/PKG-INFO +1 -1
  6. {pycoze-0.1.174 → pycoze-0.1.176}/setup.py +1 -1
  7. {pycoze-0.1.174 → pycoze-0.1.176}/LICENSE +0 -0
  8. {pycoze-0.1.174 → pycoze-0.1.176}/README.md +0 -0
  9. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/__init__.py +0 -0
  10. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ai/__init__.py +0 -0
  11. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ai/vram_reserve.py +0 -0
  12. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/__init__.py +0 -0
  13. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/__init__.py +0 -0
  14. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/agent.py +0 -0
  15. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/agent_types/__init__.py +0 -0
  16. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/agent_types/const.py +0 -0
  17. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
  18. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/bot/agent/assistant.py +0 -0
  19. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/reference/__init__.py +0 -0
  20. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/reference/bot.py +0 -0
  21. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/reference/lib.py +0 -0
  22. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/reference/tool.py +0 -0
  23. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ui/__init__.py +0 -0
  24. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ui/base.py +0 -0
  25. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ui/color.py +0 -0
  26. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ui/typ.py +0 -0
  27. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/ui/ui_def.py +0 -0
  28. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/utils/__init__.py +0 -0
  29. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/utils/arg.py +0 -0
  30. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze/utils/text_or_file.py +0 -0
  31. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze.egg-info/SOURCES.txt +0 -0
  32. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze.egg-info/dependency_links.txt +0 -0
  33. {pycoze-0.1.174 → pycoze-0.1.176}/pycoze.egg-info/top_level.txt +0 -0
  34. {pycoze-0.1.174 → pycoze-0.1.176}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.174
3
+ Version: 0.1.176
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -9,7 +9,7 @@ _INFOMATION_MESSAGE = "INFOMATION_MESSAGE=>"
9
9
  _LOG = "LOG=>"
10
10
 
11
11
 
12
- CHAT_DATA = {"output":""}
12
+ CHAT_DATA = {"output":"", "info": ""}
13
13
 
14
14
 
15
15
  def log(content, *args, end="\n", **kwargs):
@@ -17,7 +17,7 @@ def log(content, *args, end="\n", **kwargs):
17
17
 
18
18
 
19
19
  def clear_chat_data():
20
- CHAT_DATA = {"output":""}
20
+ CHAT_DATA = {"output":"", "info": ""}
21
21
 
22
22
 
23
23
  def output(role, content):
@@ -26,4 +26,5 @@ def output(role, content):
26
26
  print(_OUTPUT_MESSAGE + json.dumps({"role": role, "content": content}))
27
27
 
28
28
  def info(role, content):
29
+ CHAT_DATA["info"] += content
29
30
  print(_INFOMATION_MESSAGE + json.dumps({"role": role, "content": content}))
@@ -76,4 +76,5 @@ async def agent_chat(bot_setting_file, history, should_exit):
76
76
  tool_compatibility_mode=cfg["toolCompatibilityMode"],
77
77
  )
78
78
  result = await run_agent(agent, history, cfg["toolCompatibilityMode"], should_exit)
79
- output("assistant", result)
79
+ if not should_exit.is_set():
80
+ output("assistant", result)
@@ -49,17 +49,16 @@ def chat(bot_setting_file: str):
49
49
 
50
50
  next_input_text = ""
51
51
  while agent_chat_thread.is_alive():
52
- print("alive")
53
52
  if not input_queue.empty():
54
- print("not input_queue.empty()")
55
53
  next_input_text = input_queue.peek()
56
- print("next_input_text", next_input_text)
57
54
  if next_input_text == INTERRUPT_MESSAGE:
58
- print("should_exit")
55
+ history.append(AIMessage(content=CHAT_DATA["info"]))
59
56
  should_exit.set() # 设置退出标志
60
57
  break
61
58
  time.sleep(0.1) # 每隔 0.1 秒检查一次
62
- history.append(AIMessage(content=CHAT_DATA["output"]))
59
+ if next_input_text != INTERRUPT_MESSAGE:
60
+ history.append(AIMessage(content=CHAT_DATA["output"]))
61
+ print("history", history)
63
62
  except json.JSONDecodeError:
64
63
  print("Invalid JSON format in input message.")
65
64
  except KeyError:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.174
3
+ Version: 0.1.176
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pycoze",
5
- version="0.1.174",
5
+ version="0.1.176",
6
6
  packages=find_packages(),
7
7
  install_requires=[],
8
8
  author="Yuan Jie Xiong",
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