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.
- oxygent/__init__.py +20 -0
- oxygent/banner.py +54 -0
- oxygent/chart/__init__.py +71 -0
- oxygent/chart/flow_image_gen_tools.py +984 -0
- oxygent/chart/flowchart_api.py +90 -0
- oxygent/chart/open_chart_tools.py +53 -0
- oxygent/chart/static_files_utils.py +147 -0
- oxygent/chart/web/css/style.css +55 -0
- oxygent/chart/web/index.html +26 -0
- oxygent/chart/web/js/app.js +42 -0
- oxygent/config.py +605 -0
- oxygent/core_tools/__init__.py +0 -0
- oxygent/core_tools/retrieve_tools.py +51 -0
- oxygent/databases/__init__.py +0 -0
- oxygent/databases/base_db.py +85 -0
- oxygent/databases/db_es/__init__.py +7 -0
- oxygent/databases/db_es/base_es.py +101 -0
- oxygent/databases/db_es/jes_es.py +107 -0
- oxygent/databases/db_es/local_es.py +332 -0
- oxygent/databases/db_redis/__init__.py +15 -0
- oxygent/databases/db_redis/base_redis.py +197 -0
- oxygent/databases/db_redis/jimdb_ap_redis.py +362 -0
- oxygent/databases/db_redis/local_redis.py +153 -0
- oxygent/databases/db_vector/__init__.py +7 -0
- oxygent/databases/db_vector/base_vector_db.py +22 -0
- oxygent/databases/db_vector/vearch_db.py +959 -0
- oxygent/db_factory.py +37 -0
- oxygent/embedding_cache.py +204 -0
- oxygent/log_setup.py +169 -0
- oxygent/mas.py +1109 -0
- oxygent/oxy/__init__.py +43 -0
- oxygent/oxy/agents/__init__.py +15 -0
- oxygent/oxy/agents/base_agent.py +219 -0
- oxygent/oxy/agents/chat_agent.py +61 -0
- oxygent/oxy/agents/local_agent.py +408 -0
- oxygent/oxy/agents/parallel_agent.py +69 -0
- oxygent/oxy/agents/rag_agent.py +43 -0
- oxygent/oxy/agents/react_agent.py +436 -0
- oxygent/oxy/agents/remote_agent.py +43 -0
- oxygent/oxy/agents/sse_oxy_agent.py +95 -0
- oxygent/oxy/agents/workflow_agent.py +32 -0
- oxygent/oxy/api_tools/__init__.py +5 -0
- oxygent/oxy/api_tools/http_tool.py +44 -0
- oxygent/oxy/base_flow.py +31 -0
- oxygent/oxy/base_oxy.py +693 -0
- oxygent/oxy/base_tool.py +31 -0
- oxygent/oxy/flows/__init__.py +6 -0
- oxygent/oxy/flows/parallel_flow.py +38 -0
- oxygent/oxy/flows/plan_and_solve.py +194 -0
- oxygent/oxy/flows/reflexion.py +321 -0
- oxygent/oxy/flows/workflow.py +29 -0
- oxygent/oxy/function_tools/__init__.py +7 -0
- oxygent/oxy/function_tools/function_hub.py +80 -0
- oxygent/oxy/function_tools/function_tool.py +135 -0
- oxygent/oxy/llms/__init__.py +7 -0
- oxygent/oxy/llms/base_llm.py +232 -0
- oxygent/oxy/llms/http_llm.py +177 -0
- oxygent/oxy/llms/openai_llm.py +126 -0
- oxygent/oxy/llms/remote_llm.py +68 -0
- oxygent/oxy/mcp_tools/__init__.py +11 -0
- oxygent/oxy/mcp_tools/base_mcp_client.py +174 -0
- oxygent/oxy/mcp_tools/mcp_tool.py +36 -0
- oxygent/oxy/mcp_tools/sse_mcp_client.py +88 -0
- oxygent/oxy/mcp_tools/stdio_mcp_client.py +117 -0
- oxygent/oxy/mcp_tools/streamable_mcp_client.py +71 -0
- oxygent/oxy_factory.py +38 -0
- oxygent/preset_tools/__init__.py +77 -0
- oxygent/preset_tools/baidu_search_tools.py +31 -0
- oxygent/preset_tools/file_tools.py +134 -0
- oxygent/preset_tools/http_tools.py +78 -0
- oxygent/preset_tools/image_gen_tools.py +14 -0
- oxygent/preset_tools/math_tools.py +144 -0
- oxygent/preset_tools/python_tools.py +39 -0
- oxygent/preset_tools/shell_tools.py +37 -0
- oxygent/preset_tools/sql_tools.py +99 -0
- oxygent/preset_tools/string_tools.py +94 -0
- oxygent/preset_tools/system_tools.py +95 -0
- oxygent/preset_tools/time_tools.py +59 -0
- oxygent/preset_tools/train_ticket_tools.py +279 -0
- oxygent/prompts.py +102 -0
- oxygent/routes.py +365 -0
- oxygent/schemas/__init__.py +21 -0
- oxygent/schemas/color.py +19 -0
- oxygent/schemas/llm.py +22 -0
- oxygent/schemas/memory.py +183 -0
- oxygent/schemas/observation.py +34 -0
- oxygent/schemas/oxy.py +484 -0
- oxygent/schemas/web.py +12 -0
- oxygent/shortest_path/shortest_path.py +155 -0
- oxygent/utils/__init__.py +0 -0
- oxygent/utils/common_utils.py +382 -0
- oxygent/utils/data_utils.py +103 -0
- oxygent/utils/env_utils.py +133 -0
- oxygent/utils/llm_pydantic_parser.py +67 -0
- oxygent/web/css/agent-list.css +159 -0
- oxygent/web/css/cascader.css +108 -0
- oxygent/web/css/file.css +142 -0
- oxygent/web/css/flowchart_view1.css +170 -0
- oxygent/web/css/gantt.css +41 -0
- oxygent/web/css/main.css +168 -0
- oxygent/web/css/message.css +0 -0
- oxygent/web/css/node.css +655 -0
- oxygent/web/css/normalize.css +347 -0
- oxygent/web/css/select.css +60 -0
- oxygent/web/css/style.css +477 -0
- oxygent/web/css/style_load1.css +42 -0
- oxygent/web/css/style_load2.css +43 -0
- oxygent/web/css/tree.css +190 -0
- oxygent/web/image/agents/agent_0.png +0 -0
- oxygent/web/image/agents/agent_1.png +0 -0
- oxygent/web/image/agents/agent_10.png +0 -0
- oxygent/web/image/agents/agent_11.png +0 -0
- oxygent/web/image/agents/agent_12.png +0 -0
- oxygent/web/image/agents/agent_13.png +0 -0
- oxygent/web/image/agents/agent_14.png +0 -0
- oxygent/web/image/agents/agent_15.png +0 -0
- oxygent/web/image/agents/agent_16.png +0 -0
- oxygent/web/image/agents/agent_17.png +0 -0
- oxygent/web/image/agents/agent_2.png +0 -0
- oxygent/web/image/agents/agent_3.png +0 -0
- oxygent/web/image/agents/agent_4.png +0 -0
- oxygent/web/image/agents/agent_5.png +0 -0
- oxygent/web/image/agents/agent_6.png +0 -0
- oxygent/web/image/agents/agent_7.png +0 -0
- oxygent/web/image/agents/agent_8.png +0 -0
- oxygent/web/image/agents/agent_9.png +0 -0
- oxygent/web/image/arrow-bottom.svg +1 -0
- oxygent/web/image/arrow-left-double.svg +1 -0
- oxygent/web/image/arrow-left.svg +1 -0
- oxygent/web/image/arrow-right-double.svg +1 -0
- oxygent/web/image/arrow-right.svg +1 -0
- oxygent/web/image/arrow-top.svg +1 -0
- oxygent/web/image/bg-img.svg +1 -0
- oxygent/web/image/chat-at-list-bg.svg +1 -0
- oxygent/web/image/empty.svg +1 -0
- oxygent/web/image/global-language.svg +1 -0
- oxygent/web/image/global-theme.svg +1 -0
- oxygent/web/image/group-down.svg +1 -0
- oxygent/web/image/group-favicon.png +0 -0
- oxygent/web/image/group-up.svg +1 -0
- oxygent/web/image/group-vector-active.svg +1 -0
- oxygent/web/image/group-vector-default.svg +1 -0
- oxygent/web/image/group.svg +1 -0
- oxygent/web/image/group_add.svg +1 -0
- oxygent/web/image/group_addtion.svg +1 -0
- oxygent/web/image/group_close.svg +1 -0
- oxygent/web/image/group_delete.svg +1 -0
- oxygent/web/image/group_export.svg +1 -0
- oxygent/web/image/group_open.svg +1 -0
- oxygent/web/image/group_recent.svg +1 -0
- oxygent/web/image/group_save.svg +1 -0
- oxygent/web/image/icon.png +0 -0
- oxygent/web/image/llm-icon.svg +1 -0
- oxygent/web/image/logo.ico +0 -0
- oxygent/web/image/logo.png +0 -0
- oxygent/web/image/org_flow.svg +1 -0
- oxygent/web/image/org_model.svg +1 -0
- oxygent/web/image/org_tool.svg +1 -0
- oxygent/web/image/output_icon.svg +2 -0
- oxygent/web/image/pause.svg +1 -0
- oxygent/web/image/play.svg +1 -0
- oxygent/web/image/refresh.svg +1 -0
- oxygent/web/image/right-user.png +0 -0
- oxygent/web/image/right-user.svg +1 -0
- oxygent/web/image/stop-circle.svg +1 -0
- oxygent/web/image/tool-icon.svg +1 -0
- oxygent/web/image/tool.png +0 -0
- oxygent/web/image/up-icon.svg +1 -0
- oxygent/web/image/up_arrow.svg +1 -0
- oxygent/web/image/user.svg +1 -0
- oxygent/web/image/video.svg +1 -0
- oxygent/web/index.html +1822 -0
- oxygent/web/js/agent_tree.js +143 -0
- oxygent/web/js/autosize.js +146 -0
- oxygent/web/js/cascader.js +198 -0
- oxygent/web/js/flowchart.js +185 -0
- oxygent/web/js/marked.min.js +69 -0
- oxygent/web/js/mermaid-sdk-flowchart.js +470 -0
- oxygent/web/js/mermaid-sdk-gantt.js +81 -0
- oxygent/web/js/mermaid-source.js +151979 -0
- oxygent/web/js/mermaid.min.js +2659 -0
- oxygent/web/js/message.js +50 -0
- oxygent/web/js/upload.js +19 -0
- oxygent/web/js/utils.js +112 -0
- oxygent/web/node.html +705 -0
- oxygent-1.0.8.dist-info/LICENSE +67 -0
- oxygent-1.0.8.dist-info/METADATA +34 -0
- oxygent-1.0.8.dist-info/NOTICE_Third_Party.md +236 -0
- oxygent-1.0.8.dist-info/RECORD +190 -0
- 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
|