pycoze 0.1.223__tar.gz → 0.1.225__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. {pycoze-0.1.223 → pycoze-0.1.225}/PKG-INFO +1 -1
  2. pycoze-0.1.225/pycoze/ai/__init__.py +2 -0
  3. pycoze-0.1.225/pycoze/ai/llm/__init__.py +2 -0
  4. pycoze-0.1.223/pycoze/ai/llm/think.py → pycoze-0.1.225/pycoze/ai/llm/chat.py +8 -8
  5. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ai/llm/text_to_image_prompt.py +1 -1
  6. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze.egg-info/PKG-INFO +1 -1
  7. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze.egg-info/SOURCES.txt +1 -1
  8. {pycoze-0.1.223 → pycoze-0.1.225}/setup.py +1 -1
  9. pycoze-0.1.223/pycoze/ai/__init__.py +0 -2
  10. pycoze-0.1.223/pycoze/ai/llm/__init__.py +0 -2
  11. {pycoze-0.1.223 → pycoze-0.1.225}/LICENSE +0 -0
  12. {pycoze-0.1.223 → pycoze-0.1.225}/README.md +0 -0
  13. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/__init__.py +0 -0
  14. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ai/vram_reserve.py +0 -0
  15. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/automation/__init__.py +0 -0
  16. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/automation/browser/__init__.py +0 -0
  17. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/automation/browser/edge_driver_manager.py +0 -0
  18. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/__init__.py +0 -0
  19. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/__init__.py +0 -0
  20. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/agent.py +0 -0
  21. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/agent_types/__init__.py +0 -0
  22. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/agent_types/const.py +0 -0
  23. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
  24. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/assistant.py +0 -0
  25. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent/chat.py +0 -0
  26. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/agent_chat.py +0 -0
  27. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/bot/bot.py +0 -0
  28. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/reference/__init__.py +0 -0
  29. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/reference/bot.py +0 -0
  30. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/reference/lib.py +0 -0
  31. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/reference/tool.py +0 -0
  32. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/reference/workflow.py +0 -0
  33. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ui/__init__.py +0 -0
  34. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ui/base.py +0 -0
  35. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ui/color.py +0 -0
  36. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ui/typ.py +0 -0
  37. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/ui/ui_def.py +0 -0
  38. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/utils/__init__.py +0 -0
  39. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/utils/arg.py +0 -0
  40. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/utils/env.py +0 -0
  41. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze/utils/text_or_file.py +0 -0
  42. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze.egg-info/dependency_links.txt +0 -0
  43. {pycoze-0.1.223 → pycoze-0.1.225}/pycoze.egg-info/top_level.txt +0 -0
  44. {pycoze-0.1.223 → pycoze-0.1.225}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.223
3
+ Version: 0.1.225
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -0,0 +1,2 @@
1
+ from .vram_reserve import reserve_vram, reserve_vram_retry, unreserve_vram
2
+ from .llm import chat, chat_stream, extract, yes_or_no, extract_code, text_to_image_prompt
@@ -0,0 +1,2 @@
1
+ from .text_to_image_prompt import text_to_image_prompt
2
+ from .chat import chat, chat_stream, extract, yes_or_no, extract_code
@@ -13,7 +13,7 @@ def never_retry_on_rate_limit_error(exception):
13
13
  return not isinstance(exception, openai.RateLimitError)
14
14
 
15
15
  @retry(retry_on_exception=never_retry_on_rate_limit_error, wait_exponential_multiplier=500, stop_max_attempt_number=5)
16
- def think(user_text, history, temperature=0.2, stop=None, **kwargs):
16
+ def chat(user_text, history, temperature=0.2, stop=None, **kwargs):
17
17
  user_msg = {"role": "user", "content": user_text}
18
18
  cfg = utils.read_json_file("llm.json")
19
19
 
@@ -33,7 +33,7 @@ def think(user_text, history, temperature=0.2, stop=None, **kwargs):
33
33
 
34
34
 
35
35
  @retry(retry_on_exception=never_retry_on_rate_limit_error, wait_exponential_multiplier=500, stop_max_attempt_number=5)
36
- def think_stream(user_text, history, temperature=0.2, stop=None, **kwargs):
36
+ def chat_stream(user_text, history, temperature=0.2, stop=None, **kwargs):
37
37
  user_msg = {"role": "user", "content": user_text}
38
38
  cfg = utils.read_json_file("llm.json")
39
39
 
@@ -73,7 +73,7 @@ def extract(response_data, text: str, temperature=0, **kwargs):
73
73
  json_text += f' "{res[0]}": {res[1]}{comma}\n'
74
74
 
75
75
  # Combine the provided text with the formatted JSON schema
76
- think_text = f"""
76
+ chat_text = f"""
77
77
  The output should be a markdown code snippet formatted in the following schema, including the leading and trailing "```json" and "```" tags:
78
78
  ```json
79
79
  {{
@@ -85,7 +85,7 @@ Request:
85
85
  {text}
86
86
  """
87
87
  # text放后面,当翻译等情况时,不会把"The output should"之类翻译了,导致错误
88
- markdown = think(think_text, [], temperature=temperature, **kwargs)
88
+ markdown = chat(chat_text, [], temperature=temperature, **kwargs)
89
89
  pattern = r'```json(.*?)```'
90
90
  matches = re.findall(pattern, markdown, re.DOTALL)
91
91
  if matches:
@@ -109,10 +109,10 @@ def yes_or_no(question, temperature=0, **kwargs):
109
109
  @retry(retry_on_exception=never_retry_on_rate_limit_error, wait_exponential_multiplier=500, stop_max_attempt_number=3)
110
110
  def extract_code(text: str, temperature=0, language="python", markdown_word='python', **kwargs):
111
111
  """print(extract_code("sum 1~100"))"""
112
- think_text = text + f"""
112
+ chat_text = text + f"""
113
113
  The output should be a complete and usable {language} code snippet, including the leading and trailing "```{markdown_word}" and "```":
114
114
  """
115
- markdown = think(think_text, [], temperature=temperature, **kwargs)
115
+ markdown = chat(chat_text, [], temperature=temperature, **kwargs)
116
116
  # 使用正则表达式匹配围绕在```{markdown_word} 和 ```之间的文本
117
117
  pattern = rf'```{markdown_word}(.*?)```'
118
118
  matches = re.findall(pattern, markdown, re.DOTALL)
@@ -124,8 +124,8 @@ The output should be a complete and usable {language} code snippet, including th
124
124
 
125
125
 
126
126
  if __name__ == "__main__":
127
- print(think("你好", []))
128
- for chunk in think_stream("你好", []):
127
+ print(chat("你好", []))
128
+ for chunk in chat_stream("你好", []):
129
129
  print(chunk)
130
130
  print(extract({"name": "lowercase"}, "hello XiaoMing"))
131
131
  print(extract_code("sum 1~100"))
@@ -1,5 +1,5 @@
1
1
  import re
2
- from .think import yes_or_no, extract
2
+ from .chat import yes_or_no, extract
3
3
 
4
4
 
5
5
  def contains_chinese(text):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.223
3
+ Version: 0.1.225
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -9,8 +9,8 @@ pycoze.egg-info/top_level.txt
9
9
  pycoze/ai/__init__.py
10
10
  pycoze/ai/vram_reserve.py
11
11
  pycoze/ai/llm/__init__.py
12
+ pycoze/ai/llm/chat.py
12
13
  pycoze/ai/llm/text_to_image_prompt.py
13
- pycoze/ai/llm/think.py
14
14
  pycoze/automation/__init__.py
15
15
  pycoze/automation/browser/__init__.py
16
16
  pycoze/automation/browser/edge_driver_manager.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pycoze",
5
- version="0.1.223",
5
+ version="0.1.225",
6
6
  packages=find_packages(),
7
7
  install_requires=[],
8
8
  author="Yuan Jie Xiong",
@@ -1,2 +0,0 @@
1
- from .vram_reserve import reserve_vram, reserve_vram_retry, unreserve_vram
2
- from .llm import think, think_stream, extract, yes_or_no, extract_code
@@ -1,2 +0,0 @@
1
- from .text_to_image_prompt import text_to_image_prompt
2
- from .think import think, think_stream, extract, yes_or_no, extract_code
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