oxygent 1.0.8__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.
Files changed (190) hide show
  1. oxygent/__init__.py +20 -0
  2. oxygent/banner.py +54 -0
  3. oxygent/chart/__init__.py +71 -0
  4. oxygent/chart/flow_image_gen_tools.py +984 -0
  5. oxygent/chart/flowchart_api.py +90 -0
  6. oxygent/chart/open_chart_tools.py +53 -0
  7. oxygent/chart/static_files_utils.py +147 -0
  8. oxygent/chart/web/css/style.css +55 -0
  9. oxygent/chart/web/index.html +26 -0
  10. oxygent/chart/web/js/app.js +42 -0
  11. oxygent/config.py +605 -0
  12. oxygent/core_tools/__init__.py +0 -0
  13. oxygent/core_tools/retrieve_tools.py +51 -0
  14. oxygent/databases/__init__.py +0 -0
  15. oxygent/databases/base_db.py +85 -0
  16. oxygent/databases/db_es/__init__.py +7 -0
  17. oxygent/databases/db_es/base_es.py +101 -0
  18. oxygent/databases/db_es/jes_es.py +107 -0
  19. oxygent/databases/db_es/local_es.py +332 -0
  20. oxygent/databases/db_redis/__init__.py +15 -0
  21. oxygent/databases/db_redis/base_redis.py +197 -0
  22. oxygent/databases/db_redis/jimdb_ap_redis.py +362 -0
  23. oxygent/databases/db_redis/local_redis.py +153 -0
  24. oxygent/databases/db_vector/__init__.py +7 -0
  25. oxygent/databases/db_vector/base_vector_db.py +22 -0
  26. oxygent/databases/db_vector/vearch_db.py +959 -0
  27. oxygent/db_factory.py +37 -0
  28. oxygent/embedding_cache.py +204 -0
  29. oxygent/log_setup.py +169 -0
  30. oxygent/mas.py +1109 -0
  31. oxygent/oxy/__init__.py +43 -0
  32. oxygent/oxy/agents/__init__.py +15 -0
  33. oxygent/oxy/agents/base_agent.py +219 -0
  34. oxygent/oxy/agents/chat_agent.py +61 -0
  35. oxygent/oxy/agents/local_agent.py +408 -0
  36. oxygent/oxy/agents/parallel_agent.py +69 -0
  37. oxygent/oxy/agents/rag_agent.py +43 -0
  38. oxygent/oxy/agents/react_agent.py +436 -0
  39. oxygent/oxy/agents/remote_agent.py +43 -0
  40. oxygent/oxy/agents/sse_oxy_agent.py +95 -0
  41. oxygent/oxy/agents/workflow_agent.py +32 -0
  42. oxygent/oxy/api_tools/__init__.py +5 -0
  43. oxygent/oxy/api_tools/http_tool.py +44 -0
  44. oxygent/oxy/base_flow.py +31 -0
  45. oxygent/oxy/base_oxy.py +693 -0
  46. oxygent/oxy/base_tool.py +31 -0
  47. oxygent/oxy/flows/__init__.py +6 -0
  48. oxygent/oxy/flows/parallel_flow.py +38 -0
  49. oxygent/oxy/flows/plan_and_solve.py +194 -0
  50. oxygent/oxy/flows/reflexion.py +321 -0
  51. oxygent/oxy/flows/workflow.py +29 -0
  52. oxygent/oxy/function_tools/__init__.py +7 -0
  53. oxygent/oxy/function_tools/function_hub.py +80 -0
  54. oxygent/oxy/function_tools/function_tool.py +135 -0
  55. oxygent/oxy/llms/__init__.py +7 -0
  56. oxygent/oxy/llms/base_llm.py +232 -0
  57. oxygent/oxy/llms/http_llm.py +177 -0
  58. oxygent/oxy/llms/openai_llm.py +126 -0
  59. oxygent/oxy/llms/remote_llm.py +68 -0
  60. oxygent/oxy/mcp_tools/__init__.py +11 -0
  61. oxygent/oxy/mcp_tools/base_mcp_client.py +174 -0
  62. oxygent/oxy/mcp_tools/mcp_tool.py +36 -0
  63. oxygent/oxy/mcp_tools/sse_mcp_client.py +88 -0
  64. oxygent/oxy/mcp_tools/stdio_mcp_client.py +117 -0
  65. oxygent/oxy/mcp_tools/streamable_mcp_client.py +71 -0
  66. oxygent/oxy_factory.py +38 -0
  67. oxygent/preset_tools/__init__.py +77 -0
  68. oxygent/preset_tools/baidu_search_tools.py +31 -0
  69. oxygent/preset_tools/file_tools.py +134 -0
  70. oxygent/preset_tools/http_tools.py +78 -0
  71. oxygent/preset_tools/image_gen_tools.py +14 -0
  72. oxygent/preset_tools/math_tools.py +144 -0
  73. oxygent/preset_tools/python_tools.py +39 -0
  74. oxygent/preset_tools/shell_tools.py +37 -0
  75. oxygent/preset_tools/sql_tools.py +99 -0
  76. oxygent/preset_tools/string_tools.py +94 -0
  77. oxygent/preset_tools/system_tools.py +95 -0
  78. oxygent/preset_tools/time_tools.py +59 -0
  79. oxygent/preset_tools/train_ticket_tools.py +279 -0
  80. oxygent/prompts.py +102 -0
  81. oxygent/routes.py +365 -0
  82. oxygent/schemas/__init__.py +21 -0
  83. oxygent/schemas/color.py +19 -0
  84. oxygent/schemas/llm.py +22 -0
  85. oxygent/schemas/memory.py +183 -0
  86. oxygent/schemas/observation.py +34 -0
  87. oxygent/schemas/oxy.py +484 -0
  88. oxygent/schemas/web.py +12 -0
  89. oxygent/shortest_path/shortest_path.py +155 -0
  90. oxygent/utils/__init__.py +0 -0
  91. oxygent/utils/common_utils.py +382 -0
  92. oxygent/utils/data_utils.py +103 -0
  93. oxygent/utils/env_utils.py +133 -0
  94. oxygent/utils/llm_pydantic_parser.py +67 -0
  95. oxygent/web/css/agent-list.css +159 -0
  96. oxygent/web/css/cascader.css +108 -0
  97. oxygent/web/css/file.css +142 -0
  98. oxygent/web/css/flowchart_view1.css +170 -0
  99. oxygent/web/css/gantt.css +41 -0
  100. oxygent/web/css/main.css +168 -0
  101. oxygent/web/css/message.css +0 -0
  102. oxygent/web/css/node.css +655 -0
  103. oxygent/web/css/normalize.css +347 -0
  104. oxygent/web/css/select.css +60 -0
  105. oxygent/web/css/style.css +477 -0
  106. oxygent/web/css/style_load1.css +42 -0
  107. oxygent/web/css/style_load2.css +43 -0
  108. oxygent/web/css/tree.css +190 -0
  109. oxygent/web/image/agents/agent_0.png +0 -0
  110. oxygent/web/image/agents/agent_1.png +0 -0
  111. oxygent/web/image/agents/agent_10.png +0 -0
  112. oxygent/web/image/agents/agent_11.png +0 -0
  113. oxygent/web/image/agents/agent_12.png +0 -0
  114. oxygent/web/image/agents/agent_13.png +0 -0
  115. oxygent/web/image/agents/agent_14.png +0 -0
  116. oxygent/web/image/agents/agent_15.png +0 -0
  117. oxygent/web/image/agents/agent_16.png +0 -0
  118. oxygent/web/image/agents/agent_17.png +0 -0
  119. oxygent/web/image/agents/agent_2.png +0 -0
  120. oxygent/web/image/agents/agent_3.png +0 -0
  121. oxygent/web/image/agents/agent_4.png +0 -0
  122. oxygent/web/image/agents/agent_5.png +0 -0
  123. oxygent/web/image/agents/agent_6.png +0 -0
  124. oxygent/web/image/agents/agent_7.png +0 -0
  125. oxygent/web/image/agents/agent_8.png +0 -0
  126. oxygent/web/image/agents/agent_9.png +0 -0
  127. oxygent/web/image/arrow-bottom.svg +1 -0
  128. oxygent/web/image/arrow-left-double.svg +1 -0
  129. oxygent/web/image/arrow-left.svg +1 -0
  130. oxygent/web/image/arrow-right-double.svg +1 -0
  131. oxygent/web/image/arrow-right.svg +1 -0
  132. oxygent/web/image/arrow-top.svg +1 -0
  133. oxygent/web/image/bg-img.svg +1 -0
  134. oxygent/web/image/chat-at-list-bg.svg +1 -0
  135. oxygent/web/image/empty.svg +1 -0
  136. oxygent/web/image/global-language.svg +1 -0
  137. oxygent/web/image/global-theme.svg +1 -0
  138. oxygent/web/image/group-down.svg +1 -0
  139. oxygent/web/image/group-favicon.png +0 -0
  140. oxygent/web/image/group-up.svg +1 -0
  141. oxygent/web/image/group-vector-active.svg +1 -0
  142. oxygent/web/image/group-vector-default.svg +1 -0
  143. oxygent/web/image/group.svg +1 -0
  144. oxygent/web/image/group_add.svg +1 -0
  145. oxygent/web/image/group_addtion.svg +1 -0
  146. oxygent/web/image/group_close.svg +1 -0
  147. oxygent/web/image/group_delete.svg +1 -0
  148. oxygent/web/image/group_export.svg +1 -0
  149. oxygent/web/image/group_open.svg +1 -0
  150. oxygent/web/image/group_recent.svg +1 -0
  151. oxygent/web/image/group_save.svg +1 -0
  152. oxygent/web/image/icon.png +0 -0
  153. oxygent/web/image/llm-icon.svg +1 -0
  154. oxygent/web/image/logo.ico +0 -0
  155. oxygent/web/image/logo.png +0 -0
  156. oxygent/web/image/org_flow.svg +1 -0
  157. oxygent/web/image/org_model.svg +1 -0
  158. oxygent/web/image/org_tool.svg +1 -0
  159. oxygent/web/image/output_icon.svg +2 -0
  160. oxygent/web/image/pause.svg +1 -0
  161. oxygent/web/image/play.svg +1 -0
  162. oxygent/web/image/refresh.svg +1 -0
  163. oxygent/web/image/right-user.png +0 -0
  164. oxygent/web/image/right-user.svg +1 -0
  165. oxygent/web/image/stop-circle.svg +1 -0
  166. oxygent/web/image/tool-icon.svg +1 -0
  167. oxygent/web/image/tool.png +0 -0
  168. oxygent/web/image/up-icon.svg +1 -0
  169. oxygent/web/image/up_arrow.svg +1 -0
  170. oxygent/web/image/user.svg +1 -0
  171. oxygent/web/image/video.svg +1 -0
  172. oxygent/web/index.html +1822 -0
  173. oxygent/web/js/agent_tree.js +143 -0
  174. oxygent/web/js/autosize.js +146 -0
  175. oxygent/web/js/cascader.js +198 -0
  176. oxygent/web/js/flowchart.js +185 -0
  177. oxygent/web/js/marked.min.js +69 -0
  178. oxygent/web/js/mermaid-sdk-flowchart.js +470 -0
  179. oxygent/web/js/mermaid-sdk-gantt.js +81 -0
  180. oxygent/web/js/mermaid-source.js +151979 -0
  181. oxygent/web/js/mermaid.min.js +2659 -0
  182. oxygent/web/js/message.js +50 -0
  183. oxygent/web/js/upload.js +19 -0
  184. oxygent/web/js/utils.js +112 -0
  185. oxygent/web/node.html +705 -0
  186. oxygent-1.0.8.dist-info/LICENSE +67 -0
  187. oxygent-1.0.8.dist-info/METADATA +34 -0
  188. oxygent-1.0.8.dist-info/NOTICE_Third_Party.md +236 -0
  189. oxygent-1.0.8.dist-info/RECORD +190 -0
  190. oxygent-1.0.8.dist-info/WHEEL +4 -0
oxygent/__init__.py ADDED
@@ -0,0 +1,20 @@
1
+ from dotenv import load_dotenv
2
+
3
+ from .config import Config
4
+ from .mas import MAS
5
+ from .oxy import Oxy
6
+ from .oxy_factory import OxyFactory
7
+ from .schemas import OxyOutput, OxyRequest, OxyResponse, OxyState
8
+
9
+ load_dotenv(".env")
10
+
11
+ __all__ = [
12
+ "Oxy",
13
+ "MAS",
14
+ "OxyState",
15
+ "OxyRequest",
16
+ "OxyOutput",
17
+ "OxyResponse",
18
+ "OxyFactory",
19
+ "Config",
20
+ ]
oxygent/banner.py ADDED
@@ -0,0 +1,54 @@
1
+ oxygent_larry3d = """
2
+ _____ ____ __
3
+ /\ __`\ /\ _`\ /\ \__
4
+ \ \ \/\ \ __ _ __ __\ \ \L\_\ __ ___\ \ ,_\
5
+ \ \ \ \ \ /\ \/'\/\ \/\ \\ \ \L_L /'__`\/' _ `\ \ \/
6
+ \ \ \_\ \\/> </\ \ \_\ \\ \ \/, \/\ __//\ \/\ \ \ \_
7
+ \ \_____\/\_/\_\\/`____ \\ \____/\ \____\ \_\ \_\ \__\
8
+ \/_____/\//\/_/ `/___/> \\/___/ \/____/\/_/\/_/\/__/
9
+ /\___/
10
+ \/__/
11
+ """
12
+
13
+ oxygent_slant = """
14
+ ____ ______ __
15
+ / __ \_ ____ __/ ____/__ ____ / /_
16
+ / / / / |/_/ / / / / __/ _ \/ __ \/ __/
17
+ / /_/ /> </ /_/ / /_/ / __/ / / / /_
18
+ \____/_/|_|\__, /\____/\___/_/ /_/\__/
19
+ /____/
20
+ """
21
+
22
+ oxygent_standard = """
23
+ ___ ____ _
24
+ / _ \__ ___ _ / ___| ___ _ __ | |_
25
+ | | | \ \/ / | | | | _ / _ \ '_ \| __|
26
+ | |_| |> <| |_| | |_| | __/ | | | |_
27
+ \___//_/\_\\__, |\____|\___|_| |_|\__|
28
+ |___/
29
+ """
30
+
31
+ oxygent_smslant = """
32
+ ____ _____ __
33
+ / __ \__ ____ __/ ___/__ ___ / /_
34
+ / /_/ /\ \ / // / (_ / -_) _ \/ __/
35
+ \____//_\_\\_, /\___/\__/_//_/\__/
36
+ /___/
37
+ """
38
+
39
+ oxygent_speed = """
40
+ _______ _________ _____
41
+ __ __ \___ ______ ___ ____/_____________ /_
42
+ _ / / /_ |/_/_ / / / / __ _ _ \_ __ \ __/
43
+ / /_/ /__> < _ /_/ // /_/ / / __/ / / / /_
44
+ \____/ /_/|_| _\__, / \____/ \___//_/ /_/\__/
45
+ /____/
46
+ """
47
+
48
+ oxygent_chunky = """
49
+ _______ _______ __
50
+ | |.--.--.--.--.| __|.-----.-----.| |_
51
+ | - ||_ _| | || | || -__| || _|
52
+ |_______||__.__|___ ||_______||_____|__|__||____|
53
+ |_____|
54
+ """
@@ -0,0 +1,71 @@
1
+ import importlib
2
+ import os
3
+
4
+ from oxygent.oxy import FunctionHub
5
+
6
+ # List of tool modules to import
7
+ tool_modules = [
8
+ "flow_image_gen_tools",
9
+ "open_chart_tools",
10
+ "flowchart_api"
11
+ ]
12
+
13
+ __all__ = []
14
+
15
+ # Get the current package directory path
16
+ package_dir = os.path.dirname(__file__)
17
+
18
+ for module_name in tool_modules:
19
+ module_path = os.path.join(package_dir, f"{module_name}.py")
20
+
21
+ # First check if the module file exists
22
+ if not os.path.exists(module_path):
23
+ print(
24
+ f"Warning: Failed to import tool '{module_name}': Module file does not exist, please check '{module_path}'"
25
+ )
26
+ globals()[module_name] = None
27
+ continue
28
+
29
+ try:
30
+ # Dynamically import the module
31
+ module = importlib.import_module(f".{module_name}", __package__)
32
+
33
+ # Filter out all non-private attributes that are instances of FunctionHub
34
+ function_hub_instances = [
35
+ attr
36
+ for attr in dir(module)
37
+ if not attr.startswith("_") # Exclude private attributes
38
+ and isinstance(
39
+ getattr(module, attr), FunctionHub
40
+ ) # Only keep FunctionHub instances
41
+ ]
42
+
43
+ if function_hub_instances:
44
+ # Add eligible instances to the current scope and __all__
45
+ for attr_name in function_hub_instances:
46
+ attr_value = getattr(module, attr_name)
47
+ globals()[attr_name] = attr_value
48
+ __all__.append(attr_name)
49
+ else:
50
+ print(f"Warning: No FunctionHub instances found in module '{module_name}'")
51
+
52
+ except ImportError as e:
53
+ # Catch import errors and extract the missing package name
54
+ error_msg = str(e)
55
+ missing_package = None
56
+
57
+ if "No module named" in error_msg:
58
+ parts = error_msg.split("'")
59
+ if len(parts) >= 2:
60
+ missing_package = parts[-2]
61
+
62
+ # Print a clear prompt message
63
+ if missing_package and not missing_package.startswith(__package__):
64
+ print(
65
+ f"Warning: Failed to import tool '{module_name}': Missing dependency package '{missing_package}', please run: pip install {missing_package}"
66
+ )
67
+ else:
68
+ print(f"Warning: Failed to import tool '{module_name}': {error_msg}")
69
+
70
+ # Set the module entry to None to prevent errors in subsequent use
71
+ globals()[module_name] = None