agentnova 0.0__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.
- agentnova/__init__.py +198 -0
- agentnova/__main__.py +27 -0
- agentnova/acp_plugin.py +2353 -0
- agentnova/agent_mode.py +802 -0
- agentnova/bitnet_client.py +151 -0
- agentnova/bitnet_setup.py +30 -0
- agentnova/cli.py +2590 -0
- agentnova/config.py +99 -0
- agentnova/core/agent.py +1925 -0
- agentnova/core/math_prompts.py +396 -0
- agentnova/core/memory.py +191 -0
- agentnova/core/ollama_client.py +532 -0
- agentnova/core/orchestrator.py +191 -0
- agentnova/core/orchestrator_enhanced.py +393 -0
- agentnova/core/tools.py +275 -0
- agentnova/examples/00_backend_demo.py +211 -0
- agentnova/examples/01_basic_agent.py +182 -0
- agentnova/examples/02_tool_agent.py +276 -0
- agentnova/examples/03_orchestrator.py +209 -0
- agentnova/examples/04_comprehensive_test.py +258 -0
- agentnova/examples/05_tool_tests.py +475 -0
- agentnova/examples/06_interactive_chat.py +216 -0
- agentnova/examples/07_model_comparison.py +444 -0
- agentnova/examples/08_robust_comparison.py +444 -0
- agentnova/examples/09_expanded_benchmark.py +367 -0
- agentnova/examples/10_skills_demo.py +366 -0
- agentnova/examples/11_skill_creator_test.py +525 -0
- agentnova/examples/12_batch_operations.py +214 -0
- agentnova/examples/13_shutdown_demo.py +191 -0
- agentnova/examples/14_gsm8k_benchmark.py +427 -0
- agentnova/model_discovery.py +341 -0
- agentnova/shared_args.py +146 -0
- agentnova/skills/__init__.py +24 -0
- agentnova/skills/acp/SKILL.md +328 -0
- agentnova/skills/datetime/SKILL.md +25 -0
- agentnova/skills/loader.py +445 -0
- agentnova/skills/skill-creator/SKILL.md +111 -0
- agentnova/skills/skill-creator/scripts/__init__.py +0 -0
- agentnova/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- agentnova/skills/skill-creator/scripts/generate_report.py +326 -0
- agentnova/skills/skill-creator/scripts/improve_description.py +247 -0
- agentnova/skills/skill-creator/scripts/init_skill.py +378 -0
- agentnova/skills/skill-creator/scripts/package_skill.py +139 -0
- agentnova/skills/skill-creator/scripts/quick_validate.py +159 -0
- agentnova/skills/skill-creator/scripts/run_eval.py +310 -0
- agentnova/skills/skill-creator/scripts/run_loop.py +328 -0
- agentnova/skills/skill-creator/scripts/security_scan.py +144 -0
- agentnova/skills/skill-creator/scripts/test_package_skill.py +160 -0
- agentnova/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- agentnova/skills/skill-creator/scripts/utils.py +47 -0
- agentnova/skills/skill-creator/scripts/validate.py +147 -0
- agentnova/skills/web_search/SKILL.md +138 -0
- agentnova/tools/builtins.py +667 -0
- agentnova-0.0.dist-info/METADATA +351 -0
- agentnova-0.0.dist-info/RECORD +61 -0
- agentnova-0.0.dist-info/WHEEL +5 -0
- agentnova-0.0.dist-info/entry_points.txt +6 -0
- agentnova-0.0.dist-info/licenses/LICENSE +21 -0
- agentnova-0.0.dist-info/top_level.txt +2 -0
- localclaw/__init__.py +115 -0
- localclaw/__main__.py +23 -0
agentnova/__init__.py
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"""
|
|
2
|
+
⚛️ AgentNova R00 - A minimal, hackable agentic framework for Ollama and BitNet
|
|
3
|
+
|
|
4
|
+
Written by VTSTech
|
|
5
|
+
https://www.vts-tech.org
|
|
6
|
+
https://github.com/VTSTech/AgentNova
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
from .core.agent import Agent, AgentRun, StepResult
|
|
12
|
+
from .core.memory import Memory
|
|
13
|
+
from .core.tools import Tool, ToolRegistry, ToolParam
|
|
14
|
+
from .core.ollama_client import OllamaClient
|
|
15
|
+
from .core.orchestrator import Orchestrator, AgentCard
|
|
16
|
+
from .skills import SkillLoader, Skill, SkillRegistry
|
|
17
|
+
from .acp_plugin import ACPPlugin, create_acp_agent
|
|
18
|
+
|
|
19
|
+
# Config exports
|
|
20
|
+
from .config import (
|
|
21
|
+
OLLAMA_BASE_URL,
|
|
22
|
+
BITNET_BASE_URL,
|
|
23
|
+
ACP_BASE_URL,
|
|
24
|
+
ACP_USER,
|
|
25
|
+
ACP_PASS,
|
|
26
|
+
DEFAULT_MODEL,
|
|
27
|
+
AGENTNOVA_BACKEND,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# R00: BitNet backend support
|
|
31
|
+
try:
|
|
32
|
+
from .bitnet_client import BitnetClient, KNOWN_MODELS
|
|
33
|
+
_BITNET_AVAILABLE = True
|
|
34
|
+
except ImportError:
|
|
35
|
+
_BITNET_AVAILABLE = False
|
|
36
|
+
BitnetClient = None
|
|
37
|
+
KNOWN_MODELS = []
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_default_client():
|
|
41
|
+
"""
|
|
42
|
+
Get the default client based on AGENTNOVA_BACKEND setting.
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
OllamaClient or BitnetClient
|
|
47
|
+
The appropriate client for the configured backend.
|
|
48
|
+
|
|
49
|
+
Examples
|
|
50
|
+
--------
|
|
51
|
+
>>> # With AGENTNOVA_BACKEND=ollama (default)
|
|
52
|
+
>>> client = get_default_client() # Returns OllamaClient
|
|
53
|
+
|
|
54
|
+
>>> # With AGENTNOVA_BACKEND=bitnet
|
|
55
|
+
>>> client = get_default_client() # Returns BitnetClient
|
|
56
|
+
"""
|
|
57
|
+
if AGENTNOVA_BACKEND == "bitnet":
|
|
58
|
+
if not _BITNET_AVAILABLE:
|
|
59
|
+
raise ImportError("BitNet backend requested but bitnet_client not available")
|
|
60
|
+
return BitnetClient()
|
|
61
|
+
else:
|
|
62
|
+
return OllamaClient()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def get_available_models(client=None):
|
|
66
|
+
"""
|
|
67
|
+
Get list of available models from the configured backend.
|
|
68
|
+
|
|
69
|
+
Parameters
|
|
70
|
+
----------
|
|
71
|
+
client : OllamaClient or BitnetClient, optional
|
|
72
|
+
Client to use. Creates one via get_default_client() if not provided.
|
|
73
|
+
|
|
74
|
+
Returns
|
|
75
|
+
-------
|
|
76
|
+
list[str]
|
|
77
|
+
List of model names available on the backend.
|
|
78
|
+
"""
|
|
79
|
+
if client is None:
|
|
80
|
+
client = get_default_client()
|
|
81
|
+
|
|
82
|
+
if not client.is_running():
|
|
83
|
+
return []
|
|
84
|
+
|
|
85
|
+
return client.list_models() or []
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def get_system_prompt(model: str, client=None, default_prompt: str = None):
|
|
89
|
+
"""
|
|
90
|
+
Get the system prompt based on AGENTNOVA_USE_MF_SYS environment variable.
|
|
91
|
+
|
|
92
|
+
If AGENTNOVA_USE_MF_SYS=1, returns the Modelfile's system prompt for the model.
|
|
93
|
+
Otherwise returns the provided default_prompt.
|
|
94
|
+
|
|
95
|
+
Parameters
|
|
96
|
+
----------
|
|
97
|
+
model : str
|
|
98
|
+
Model name to get system prompt for.
|
|
99
|
+
client : OllamaClient or BitnetClient, optional
|
|
100
|
+
Client to use. Creates one via get_default_client() if not provided.
|
|
101
|
+
default_prompt : str, optional
|
|
102
|
+
Default system prompt to use if AGENTNOVA_USE_MF_SYS is not set.
|
|
103
|
+
If None and AGENTNOVA_USE_MF_SYS=1 but no Modelfile system prompt,
|
|
104
|
+
returns None (agent will use its own default).
|
|
105
|
+
|
|
106
|
+
Returns
|
|
107
|
+
-------
|
|
108
|
+
str or None
|
|
109
|
+
The system prompt to use, or None.
|
|
110
|
+
|
|
111
|
+
Examples
|
|
112
|
+
--------
|
|
113
|
+
>>> # Without AGENTNOVA_USE_MF_SYS set
|
|
114
|
+
>>> sys_prompt = get_system_prompt("llama3.2", default_prompt="You are helpful.")
|
|
115
|
+
>>> print(sys_prompt) # "You are helpful."
|
|
116
|
+
|
|
117
|
+
>>> # With AGENTNOVA_USE_MF_SYS=1
|
|
118
|
+
>>> sys_prompt = get_system_prompt("qwen2.5-coder", default_prompt="You are helpful.")
|
|
119
|
+
>>> print(sys_prompt) # Modelfile's system prompt, e.g., "You are Qwen..."
|
|
120
|
+
"""
|
|
121
|
+
use_mf_sys = os.environ.get("AGENTNOVA_USE_MF_SYS", "0") == "1"
|
|
122
|
+
|
|
123
|
+
if use_mf_sys:
|
|
124
|
+
if client is None:
|
|
125
|
+
client = get_default_client()
|
|
126
|
+
|
|
127
|
+
# Only OllamaClient has get_modelfile_system_prompt
|
|
128
|
+
if hasattr(client, "get_modelfile_system_prompt"):
|
|
129
|
+
mf_sys = client.get_modelfile_system_prompt(model)
|
|
130
|
+
if mf_sys:
|
|
131
|
+
print(f" 📜 Using Modelfile system prompt ({len(mf_sys)} chars)")
|
|
132
|
+
return mf_sys
|
|
133
|
+
else:
|
|
134
|
+
print(f" ⚠ No SYSTEM prompt in Modelfile for '{model}', using default")
|
|
135
|
+
return default_prompt
|
|
136
|
+
|
|
137
|
+
return default_prompt
|
|
138
|
+
|
|
139
|
+
# R00 Enhancements
|
|
140
|
+
from .core.orchestrator_enhanced import Orchestrator as EnhancedOrchestrator, AgentCard as EnhancedAgentCard
|
|
141
|
+
|
|
142
|
+
# Tool support detection
|
|
143
|
+
from .cli import get_tool_support
|
|
144
|
+
|
|
145
|
+
# Shared args for test scripts
|
|
146
|
+
from .shared_args import add_shared_args, parse_shared_args, SharedConfig
|
|
147
|
+
|
|
148
|
+
# R00: Agent Mode
|
|
149
|
+
from .agent_mode import (
|
|
150
|
+
AgentMode, AgentState, TaskPlan, Step, Action,
|
|
151
|
+
create_file_write_action, create_file_delete_action,
|
|
152
|
+
create_mkdir_action, create_shell_action,
|
|
153
|
+
format_status, format_progress,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
__all__ = [
|
|
157
|
+
# Core
|
|
158
|
+
"Agent", "AgentRun", "StepResult",
|
|
159
|
+
"Memory", "Tool", "ToolRegistry", "ToolParam",
|
|
160
|
+
"OllamaClient", "Orchestrator", "AgentCard",
|
|
161
|
+
# Skills
|
|
162
|
+
"SkillLoader", "Skill", "SkillRegistry",
|
|
163
|
+
# R00 Enhancements
|
|
164
|
+
"EnhancedOrchestrator", "EnhancedAgentCard",
|
|
165
|
+
"ACPPlugin",
|
|
166
|
+
# R00: Backend-agnostic helpers
|
|
167
|
+
"get_default_client",
|
|
168
|
+
"get_available_models",
|
|
169
|
+
"get_system_prompt",
|
|
170
|
+
"get_tool_support", # Tool support detection
|
|
171
|
+
"model_discovery",
|
|
172
|
+
"add_shared_args", # Shared CLI args for test scripts
|
|
173
|
+
"parse_shared_args",
|
|
174
|
+
"SharedConfig",
|
|
175
|
+
# R00: Agent Mode
|
|
176
|
+
"AgentMode", "AgentState", "TaskPlan", "Step", "Action",
|
|
177
|
+
"create_file_write_action", "create_file_delete_action",
|
|
178
|
+
"create_mkdir_action", "create_shell_action",
|
|
179
|
+
"format_status", "format_progress",
|
|
180
|
+
# Config exports
|
|
181
|
+
"OLLAMA_BASE_URL",
|
|
182
|
+
"BITNET_BASE_URL",
|
|
183
|
+
"ACP_BASE_URL",
|
|
184
|
+
"ACP_USER",
|
|
185
|
+
"ACP_PASS",
|
|
186
|
+
"DEFAULT_MODEL",
|
|
187
|
+
"AGENTNOVA_BACKEND",
|
|
188
|
+
]
|
|
189
|
+
|
|
190
|
+
# Conditionally export BitNet
|
|
191
|
+
if _BITNET_AVAILABLE:
|
|
192
|
+
__all__.extend(["BitnetClient", "KNOWN_MODELS"])
|
|
193
|
+
|
|
194
|
+
__version__ = "0.0"
|
|
195
|
+
__author__ = "VTSTech"
|
|
196
|
+
__author_email__ = "contact@vts-tech.org"
|
|
197
|
+
__url__ = "https://github.com/VTSTech/AgentNova"
|
|
198
|
+
__website__ = "https://www.vts-tech.org"
|
agentnova/__main__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
🦞 AgentNova R04 — Command Line Interface
|
|
4
|
+
|
|
5
|
+
Entry point for: python -m agentnova [command] [options]
|
|
6
|
+
|
|
7
|
+
Commands:
|
|
8
|
+
run Run the agent on a single prompt and exit
|
|
9
|
+
chat Interactive multi-turn conversation with memory
|
|
10
|
+
models List models available in Ollama
|
|
11
|
+
tools List available built-in tools
|
|
12
|
+
skills List available Agent Skills
|
|
13
|
+
|
|
14
|
+
Examples:
|
|
15
|
+
python -m agentnova run "What is the capital of France?"
|
|
16
|
+
python -m agentnova chat --model llama3.1:8b --tools calculator,shell
|
|
17
|
+
python -m agentnova models
|
|
18
|
+
python -m agentnova tools
|
|
19
|
+
python -m agentnova skills
|
|
20
|
+
|
|
21
|
+
Written by VTSTech · https://www.vts-tech.org · https://github.com/VTSTech/AgentNova
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from agentnova.cli import main
|
|
25
|
+
|
|
26
|
+
if __name__ == "__main__":
|
|
27
|
+
main()
|