agentnova 0.2.4__tar.gz → 0.2.5__tar.gz

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 (80) hide show
  1. {agentnova-0.2.4 → agentnova-0.2.5}/PKG-INFO +17 -17
  2. {agentnova-0.2.4 → agentnova-0.2.5}/README.md +16 -16
  3. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/__init__.py +212 -211
  4. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/__main__.py +27 -27
  5. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/acp_plugin.py +2353 -2353
  6. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/agent_mode.py +831 -831
  7. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/bitnet_client.py +151 -151
  8. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/bitnet_setup.py +30 -30
  9. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/cli.py +2699 -2699
  10. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/config.py +99 -99
  11. agentnova-0.2.5/agentnova/core/agent.py +1284 -0
  12. agentnova-0.2.5/agentnova/core/args_normal.py +324 -0
  13. agentnova-0.2.5/agentnova/core/helpers.py +250 -0
  14. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/math_prompts.py +396 -396
  15. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/memory.py +191 -191
  16. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/model_family_config.py +485 -485
  17. agentnova-0.2.5/agentnova/core/models.py +47 -0
  18. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/ollama_client.py +553 -553
  19. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/orchestrator.py +191 -191
  20. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/orchestrator_enhanced.py +393 -393
  21. agentnova-0.2.5/agentnova/core/prompts.py +180 -0
  22. agentnova-0.2.5/agentnova/core/tool_parse.py +413 -0
  23. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/core/tools.py +304 -304
  24. agentnova-0.2.5/agentnova/core/types.py +11 -0
  25. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/00_backend_demo.py +211 -211
  26. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/01_basic_agent.py +182 -182
  27. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/02_tool_agent.py +276 -276
  28. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/03_orchestrator.py +209 -209
  29. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/04_comprehensive_test.py +267 -267
  30. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/05_tool_tests.py +494 -494
  31. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/06_interactive_chat.py +216 -216
  32. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/07_model_comparison.py +534 -534
  33. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/08_robust_comparison.py +531 -531
  34. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/09_expanded_benchmark.py +412 -412
  35. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/10_skills_demo.py +366 -366
  36. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/11_skill_creator_test.py +525 -525
  37. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/12_batch_operations.py +214 -214
  38. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/13_shutdown_demo.py +191 -191
  39. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/14_gsm8k_benchmark.py +428 -428
  40. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/examples/15_quick_diagnostic.py +296 -296
  41. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/model_discovery.py +341 -341
  42. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/shared_args.py +146 -146
  43. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/__init__.py +24 -24
  44. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/loader.py +445 -445
  45. agentnova-0.2.5/agentnova/skills/skill-creator/scripts/__init__.py +1 -0
  46. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
  47. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/generate_report.py +326 -326
  48. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/improve_description.py +247 -247
  49. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/init_skill.py +378 -378
  50. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/package_skill.py +139 -139
  51. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/quick_validate.py +159 -159
  52. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/run_eval.py +310 -310
  53. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/run_loop.py +328 -328
  54. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/security_scan.py +144 -144
  55. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/test_package_skill.py +160 -160
  56. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/test_quick_validate.py +72 -72
  57. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/utils.py +47 -47
  58. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/scripts/validate.py +147 -147
  59. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/tools/builtins.py +702 -702
  60. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/tools/sandboxed_repl.py +523 -523
  61. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/PKG-INFO +17 -17
  62. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/SOURCES.txt +6 -0
  63. {agentnova-0.2.4 → agentnova-0.2.5}/localclaw/__init__.py +115 -115
  64. {agentnova-0.2.4 → agentnova-0.2.5}/localclaw/__main__.py +23 -23
  65. {agentnova-0.2.4 → agentnova-0.2.5}/pyproject.toml +1 -1
  66. {agentnova-0.2.4 → agentnova-0.2.5}/tests/test_acp_integration.py +217 -217
  67. {agentnova-0.2.4 → agentnova-0.2.5}/tests/test_acp_subagents.py +310 -310
  68. {agentnova-0.2.4 → agentnova-0.2.5}/tests/test_agent.py +266 -266
  69. agentnova-0.2.4/agentnova/core/agent.py +0 -2770
  70. agentnova-0.2.4/agentnova/skills/skill-creator/scripts/__init__.py +0 -0
  71. {agentnova-0.2.4 → agentnova-0.2.5}/LICENSE +0 -0
  72. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/acp/SKILL.md +0 -0
  73. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/datetime/SKILL.md +0 -0
  74. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/skill-creator/SKILL.md +0 -0
  75. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova/skills/web_search/SKILL.md +0 -0
  76. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/dependency_links.txt +0 -0
  77. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/entry_points.txt +0 -0
  78. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/requires.txt +0 -0
  79. {agentnova-0.2.4 → agentnova-0.2.5}/agentnova.egg-info/top_level.txt +0 -0
  80. {agentnova-0.2.4 → agentnova-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentnova
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: A minimal, hackable agentic framework for Ollama and BitNet - local-first AI agent toolkit
5
5
  Author-email: VTSTech <veritas@vts-tech.org>
6
6
  Maintainer-email: VTSTech <veritas@vts-tech.org>
@@ -34,7 +34,7 @@ Requires-Dist: black>=23.0; extra == "dev"
34
34
  Requires-Dist: ruff>=0.1.0; extra == "dev"
35
35
  Dynamic: license-file
36
36
 
37
- # ⚛️ AgentNova R02.4
37
+ # ⚛️ AgentNova R02.5
38
38
 
39
39
  A minimal, hackable agentic framework engineered to run **entirely locally** with [Ollama](https://ollama.com) or [BitNet](https://github.com/microsoft/BitNet).
40
40
 
@@ -45,7 +45,7 @@ Inspired by the architecture of OpenClaw, rebuilt from scratch for local-first o
45
45
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VTSTech/AgentNova/blob/main/AgentNova.ipynb)
46
46
  [![GitHub commits](https://badgen.net/github/commits/VTSTech/AgentNova)](https://GitHub.com/VTSTech/AgentNova/commit/) [![GitHub latest commit](https://badgen.net/github/last-commit/VTSTech/AgentNova)](https://GitHub.com/VTSTech/AgentNova/commit/)
47
47
 
48
- [![pip - agentnova](https://img.shields.io/badge/pip-agentnova-2ea44f?logo=PyPi)](https://pypi.org/project/agentnova/) [![PyPI version fury.io](https://badge.fury.io/py/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download month](https://img.shields.io/pypi/dm/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download day](https://img.shields.io/pypi/dd/agentnova.svg)](https://pypi.python.org/pypi/agentnova/)
48
+ [![pip - agentnova](https://img.shields.io/badge/pip-agentnova-2ea44f?logo=PyPi)](https://pypi.org/project/agentnova/) [![PyPI version fury.io](https://badge.fury.io/py/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download month](https://img.shields.io/pypi/dm/agentnova.svg)](https://pypi.org/project/agentnova/) [![PyPI download day](https://img.shields.io/pypi/dd/agentnova.svg)](https://pypi.python.org/pypi/agentnova/)
49
49
 
50
50
  [![License](https://img.shields.io/badge/License-MIT-blue)](#license) [![Go to Python website](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FVTSTech%2FAgentNova%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&query=project.requires-python&label=python&logo=python&logoColor=white)](https://python.org)
51
51
 
@@ -201,7 +201,7 @@ agentnova models --tool_support
201
201
 
202
202
  ### Performance by Tool Support
203
203
 
204
- R02.3 benchmark results (15-test suite):
204
+ R02.5 benchmark results (15-test suite):
205
205
 
206
206
  | Model | Params | Tool Support | Score | Time |
207
207
  |-------|--------|--------------|-------|------|
@@ -213,19 +213,19 @@ R02.3 benchmark results (15-test suite):
213
213
 
214
214
  **Quick Diagnostic (Test 15 - 5 questions, ~30s/model):**
215
215
 
216
- | Model | Score | Tool Support |
217
- |-------|-------|--------------|
218
- | **`qwen3.5:0.8b`** | **100%** | native |
219
- | **`qwen2.5:0.5b`** | **100%** | react |
220
- | `functiongemma:270m` | 80% | native |
221
- | `granite4:350m` | 80% | native |
222
- | `qwen3:0.6b` | 60% | react |
216
+ | Model | Score | Time | Tool Support |
217
+ |-------|-------|------|--------------|
218
+ | **`dolphin3.0-llama3:1b`** | **100%** | 48.7s | native |
219
+ | **`granite4:350m`** | **100%** | 75.2s | native |
220
+ | **`qwen2.5-coder:0.5b`** | **100%** | 76.0s | react |
221
+ | **`qwen3:0.6b`** | **100%** | 151.0s | react |
222
+ | `functiongemma:270m` | 80% | 28.5s | native |
223
+ | `dolphin3.0-qwen2.5:0.5b` | 80% | 38.4s | none |
223
224
 
224
- **Key improvements in R02.3**:
225
- - **+13%** for granite3.1-moe:1b (80% → 93%) from few-shot fix
226
- - **+20%** for llama3.2:1b (67% → 87%) from observation role fix
227
- - **qwen3:0.6b restored** from 0% (broken) with `think=False` API fix
228
- - **qwen3.5:0.8b** new sub-1B champion with 100% on quick diagnostic
225
+ **Key improvements in R02.5**:
226
+ - **4 models achieve 100%** on quick diagnostic (dolphin3.0-llama3:1b fastest at 48.7s)
227
+ - **Module refactoring** - agent.py split into 6 focused modules (~1550 lines from ~2770)
228
+ - **All tests passing** after module separation, backward compatibility maintained
229
229
 
230
230
  ---
231
231
 
@@ -276,7 +276,7 @@ Output shows:
276
276
  - **Tool Support** - `✓ native`, `ReAct`, `○ none`, or `untested`
277
277
 
278
278
  ```
279
- ⚛️ AgentNova R02.3 Models
279
+ ⚛️ AgentNova R02.5 Models
280
280
  Model Family Context Tool Support
281
281
  ──────────────────────────────────────────────────────────────────────────────
282
282
  gemma3:270m gemma3 32K ○ none
@@ -1,4 +1,4 @@
1
- # ⚛️ AgentNova R02.4
1
+ # ⚛️ AgentNova R02.5
2
2
 
3
3
  A minimal, hackable agentic framework engineered to run **entirely locally** with [Ollama](https://ollama.com) or [BitNet](https://github.com/microsoft/BitNet).
4
4
 
@@ -9,7 +9,7 @@ Inspired by the architecture of OpenClaw, rebuilt from scratch for local-first o
9
9
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VTSTech/AgentNova/blob/main/AgentNova.ipynb)
10
10
  [![GitHub commits](https://badgen.net/github/commits/VTSTech/AgentNova)](https://GitHub.com/VTSTech/AgentNova/commit/) [![GitHub latest commit](https://badgen.net/github/last-commit/VTSTech/AgentNova)](https://GitHub.com/VTSTech/AgentNova/commit/)
11
11
 
12
- [![pip - agentnova](https://img.shields.io/badge/pip-agentnova-2ea44f?logo=PyPi)](https://pypi.org/project/agentnova/) [![PyPI version fury.io](https://badge.fury.io/py/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download month](https://img.shields.io/pypi/dm/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download day](https://img.shields.io/pypi/dd/agentnova.svg)](https://pypi.python.org/pypi/agentnova/)
12
+ [![pip - agentnova](https://img.shields.io/badge/pip-agentnova-2ea44f?logo=PyPi)](https://pypi.org/project/agentnova/) [![PyPI version fury.io](https://badge.fury.io/py/agentnova.svg)](https://pypi.python.org/pypi/agentnova/) [![PyPI download month](https://img.shields.io/pypi/dm/agentnova.svg)](https://pypi.org/project/agentnova/) [![PyPI download day](https://img.shields.io/pypi/dd/agentnova.svg)](https://pypi.python.org/pypi/agentnova/)
13
13
 
14
14
  [![License](https://img.shields.io/badge/License-MIT-blue)](#license) [![Go to Python website](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FVTSTech%2FAgentNova%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&query=project.requires-python&label=python&logo=python&logoColor=white)](https://python.org)
15
15
 
@@ -165,7 +165,7 @@ agentnova models --tool_support
165
165
 
166
166
  ### Performance by Tool Support
167
167
 
168
- R02.3 benchmark results (15-test suite):
168
+ R02.5 benchmark results (15-test suite):
169
169
 
170
170
  | Model | Params | Tool Support | Score | Time |
171
171
  |-------|--------|--------------|-------|------|
@@ -177,19 +177,19 @@ R02.3 benchmark results (15-test suite):
177
177
 
178
178
  **Quick Diagnostic (Test 15 - 5 questions, ~30s/model):**
179
179
 
180
- | Model | Score | Tool Support |
181
- |-------|-------|--------------|
182
- | **`qwen3.5:0.8b`** | **100%** | native |
183
- | **`qwen2.5:0.5b`** | **100%** | react |
184
- | `functiongemma:270m` | 80% | native |
185
- | `granite4:350m` | 80% | native |
186
- | `qwen3:0.6b` | 60% | react |
180
+ | Model | Score | Time | Tool Support |
181
+ |-------|-------|------|--------------|
182
+ | **`dolphin3.0-llama3:1b`** | **100%** | 48.7s | native |
183
+ | **`granite4:350m`** | **100%** | 75.2s | native |
184
+ | **`qwen2.5-coder:0.5b`** | **100%** | 76.0s | react |
185
+ | **`qwen3:0.6b`** | **100%** | 151.0s | react |
186
+ | `functiongemma:270m` | 80% | 28.5s | native |
187
+ | `dolphin3.0-qwen2.5:0.5b` | 80% | 38.4s | none |
187
188
 
188
- **Key improvements in R02.3**:
189
- - **+13%** for granite3.1-moe:1b (80% → 93%) from few-shot fix
190
- - **+20%** for llama3.2:1b (67% → 87%) from observation role fix
191
- - **qwen3:0.6b restored** from 0% (broken) with `think=False` API fix
192
- - **qwen3.5:0.8b** new sub-1B champion with 100% on quick diagnostic
189
+ **Key improvements in R02.5**:
190
+ - **4 models achieve 100%** on quick diagnostic (dolphin3.0-llama3:1b fastest at 48.7s)
191
+ - **Module refactoring** - agent.py split into 6 focused modules (~1550 lines from ~2770)
192
+ - **All tests passing** after module separation, backward compatibility maintained
193
193
 
194
194
  ---
195
195
 
@@ -240,7 +240,7 @@ Output shows:
240
240
  - **Tool Support** - `✓ native`, `ReAct`, `○ none`, or `untested`
241
241
 
242
242
  ```
243
- ⚛️ AgentNova R02.3 Models
243
+ ⚛️ AgentNova R02.5 Models
244
244
  Model Family Context Tool Support
245
245
  ──────────────────────────────────────────────────────────────────────────────
246
246
  gemma3:270m gemma3 32K ○ none
@@ -1,211 +1,212 @@
1
- """
2
- ⚛️ AgentNova R02.3 - 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
- from .core.model_family_config import (
19
- ModelFamilyConfig, FAMILY_CONFIGS,
20
- get_family_config, get_stop_tokens, supports_tools,
21
- get_tool_format, get_preferred_temperature, should_use_few_shot,
22
- get_few_shot_style, has_known_issues, get_react_system_suffix,
23
- get_native_tool_hints,
24
- )
25
-
26
- # Config exports
27
- from .config import (
28
- OLLAMA_BASE_URL,
29
- BITNET_BASE_URL,
30
- ACP_BASE_URL,
31
- ACP_USER,
32
- ACP_PASS,
33
- DEFAULT_MODEL,
34
- AGENTNOVA_BACKEND,
35
- )
36
-
37
- # R00: BitNet backend support
38
- try:
39
- from .bitnet_client import BitnetClient, KNOWN_MODELS
40
- _BITNET_AVAILABLE = True
41
- except ImportError:
42
- _BITNET_AVAILABLE = False
43
- BitnetClient = None
44
- KNOWN_MODELS = []
45
-
46
-
47
- def get_default_client():
48
- """
49
- Get the default client based on AGENTNOVA_BACKEND setting.
50
-
51
- Returns
52
- -------
53
- OllamaClient or BitnetClient
54
- The appropriate client for the configured backend.
55
-
56
- Examples
57
- --------
58
- >>> # With AGENTNOVA_BACKEND=ollama (default)
59
- >>> client = get_default_client() # Returns OllamaClient
60
-
61
- >>> # With AGENTNOVA_BACKEND=bitnet
62
- >>> client = get_default_client() # Returns BitnetClient
63
- """
64
- if AGENTNOVA_BACKEND == "bitnet":
65
- if not _BITNET_AVAILABLE:
66
- raise ImportError("BitNet backend requested but bitnet_client not available")
67
- return BitnetClient()
68
- else:
69
- return OllamaClient()
70
-
71
-
72
- def get_available_models(client=None):
73
- """
74
- Get list of available models from the configured backend.
75
-
76
- Parameters
77
- ----------
78
- client : OllamaClient or BitnetClient, optional
79
- Client to use. Creates one via get_default_client() if not provided.
80
-
81
- Returns
82
- -------
83
- list[str]
84
- List of model names available on the backend.
85
- """
86
- if client is None:
87
- client = get_default_client()
88
-
89
- if not client.is_running():
90
- return []
91
-
92
- return client.list_models() or []
93
-
94
-
95
- def get_system_prompt(model: str, client=None, default_prompt: str = None):
96
- """
97
- Get the system prompt based on AGENTNOVA_USE_MF_SYS environment variable.
98
-
99
- If AGENTNOVA_USE_MF_SYS=1, returns the Modelfile's system prompt for the model.
100
- Otherwise returns the provided default_prompt.
101
-
102
- Parameters
103
- ----------
104
- model : str
105
- Model name to get system prompt for.
106
- client : OllamaClient or BitnetClient, optional
107
- Client to use. Creates one via get_default_client() if not provided.
108
- default_prompt : str, optional
109
- Default system prompt to use if AGENTNOVA_USE_MF_SYS is not set.
110
- If None and AGENTNOVA_USE_MF_SYS=1 but no Modelfile system prompt,
111
- returns None (agent will use its own default).
112
-
113
- Returns
114
- -------
115
- str or None
116
- The system prompt to use, or None.
117
-
118
- Examples
119
- --------
120
- >>> # Without AGENTNOVA_USE_MF_SYS set
121
- >>> sys_prompt = get_system_prompt("llama3.2", default_prompt="You are helpful.")
122
- >>> print(sys_prompt) # "You are helpful."
123
-
124
- >>> # With AGENTNOVA_USE_MF_SYS=1
125
- >>> sys_prompt = get_system_prompt("qwen2.5-coder", default_prompt="You are helpful.")
126
- >>> print(sys_prompt) # Modelfile's system prompt, e.g., "You are Qwen..."
127
- """
128
- use_mf_sys = os.environ.get("AGENTNOVA_USE_MF_SYS", "0") == "1"
129
-
130
- if use_mf_sys:
131
- if client is None:
132
- client = get_default_client()
133
-
134
- # Only OllamaClient has get_modelfile_system_prompt
135
- if hasattr(client, "get_modelfile_system_prompt"):
136
- mf_sys = client.get_modelfile_system_prompt(model)
137
- if mf_sys:
138
- print(f" 📜 Using Modelfile system prompt ({len(mf_sys)} chars)")
139
- return mf_sys
140
- else:
141
- print(f" ⚠ No SYSTEM prompt in Modelfile for '{model}', using default")
142
- return default_prompt
143
-
144
- return default_prompt
145
-
146
- # R00 Enhancements
147
- from .core.orchestrator_enhanced import Orchestrator as EnhancedOrchestrator, AgentCard as EnhancedAgentCard
148
-
149
- # Tool support detection
150
- from .cli import get_tool_support
151
-
152
- # Shared args for test scripts
153
- from .shared_args import add_shared_args, parse_shared_args, SharedConfig
154
-
155
- # R00: Agent Mode
156
- from .agent_mode import (
157
- AgentMode, AgentState, TaskPlan, Step, Action,
158
- create_file_write_action, create_file_delete_action,
159
- create_mkdir_action, create_shell_action,
160
- format_status, format_progress,
161
- )
162
-
163
- __all__ = [
164
- # Core
165
- "Agent", "AgentRun", "StepResult",
166
- "Memory", "Tool", "ToolRegistry", "ToolParam",
167
- "OllamaClient", "Orchestrator", "AgentCard",
168
- # Skills
169
- "SkillLoader", "Skill", "SkillRegistry",
170
- # R00 Enhancements
171
- "EnhancedOrchestrator", "EnhancedAgentCard",
172
- "ACPPlugin",
173
- # R00: Backend-agnostic helpers
174
- "get_default_client",
175
- "get_available_models",
176
- "get_system_prompt",
177
- "get_tool_support", # Tool support detection
178
- "model_discovery",
179
- "add_shared_args", # Shared CLI args for test scripts
180
- "parse_shared_args",
181
- "SharedConfig",
182
- # R00: Agent Mode
183
- "AgentMode", "AgentState", "TaskPlan", "Step", "Action",
184
- "create_file_write_action", "create_file_delete_action",
185
- "create_mkdir_action", "create_shell_action",
186
- "format_status", "format_progress",
187
- # R02.3: Model Family Configuration
188
- "ModelFamilyConfig", "FAMILY_CONFIGS",
189
- "get_family_config", "get_stop_tokens", "supports_tools",
190
- "get_tool_format", "get_preferred_temperature", "should_use_few_shot",
191
- "get_few_shot_style", "has_known_issues", "get_react_system_suffix",
192
- "get_native_tool_hints",
193
- # Config exports
194
- "OLLAMA_BASE_URL",
195
- "BITNET_BASE_URL",
196
- "ACP_BASE_URL",
197
- "ACP_USER",
198
- "ACP_PASS",
199
- "DEFAULT_MODEL",
200
- "AGENTNOVA_BACKEND",
201
- ]
202
-
203
- # Conditionally export BitNet
204
- if _BITNET_AVAILABLE:
205
- __all__.extend(["BitnetClient", "KNOWN_MODELS"])
206
-
207
- __version__ = "0.2.4"
208
- __author__ = "VTSTech"
209
- __author_email__ = "veritas@vts-tech.org"
210
- __url__ = "https://github.com/VTSTech/AgentNova"
211
- __website__ = "https://www.vts-tech.org"
1
+ """
2
+ ⚛️ AgentNova R02.5 - 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
12
+ from .core.models import AgentRun, StepResult
13
+ from .core.memory import Memory
14
+ from .core.tools import Tool, ToolRegistry, ToolParam
15
+ from .core.ollama_client import OllamaClient
16
+ from .core.orchestrator import Orchestrator, AgentCard
17
+ from .skills import SkillLoader, Skill, SkillRegistry
18
+ from .acp_plugin import ACPPlugin, create_acp_agent
19
+ from .core.model_family_config import (
20
+ ModelFamilyConfig, FAMILY_CONFIGS,
21
+ get_family_config, get_stop_tokens, supports_tools,
22
+ get_tool_format, get_preferred_temperature, should_use_few_shot,
23
+ get_few_shot_style, has_known_issues, get_react_system_suffix,
24
+ get_native_tool_hints,
25
+ )
26
+
27
+ # Config exports
28
+ from .config import (
29
+ OLLAMA_BASE_URL,
30
+ BITNET_BASE_URL,
31
+ ACP_BASE_URL,
32
+ ACP_USER,
33
+ ACP_PASS,
34
+ DEFAULT_MODEL,
35
+ AGENTNOVA_BACKEND,
36
+ )
37
+
38
+ # R02: BitNet backend support
39
+ try:
40
+ from .bitnet_client import BitnetClient, KNOWN_MODELS
41
+ _BITNET_AVAILABLE = True
42
+ except ImportError:
43
+ _BITNET_AVAILABLE = False
44
+ BitnetClient = None
45
+ KNOWN_MODELS = []
46
+
47
+
48
+ def get_default_client():
49
+ """
50
+ Get the default client based on AGENTNOVA_BACKEND setting.
51
+
52
+ Returns
53
+ -------
54
+ OllamaClient or BitnetClient
55
+ The appropriate client for the configured backend.
56
+
57
+ Examples
58
+ --------
59
+ >>> # With AGENTNOVA_BACKEND=ollama (default)
60
+ >>> client = get_default_client() # Returns OllamaClient
61
+
62
+ >>> # With AGENTNOVA_BACKEND=bitnet
63
+ >>> client = get_default_client() # Returns BitnetClient
64
+ """
65
+ if AGENTNOVA_BACKEND == "bitnet":
66
+ if not _BITNET_AVAILABLE:
67
+ raise ImportError("BitNet backend requested but bitnet_client not available")
68
+ return BitnetClient()
69
+ else:
70
+ return OllamaClient()
71
+
72
+
73
+ def get_available_models(client=None):
74
+ """
75
+ Get list of available models from the configured backend.
76
+
77
+ Parameters
78
+ ----------
79
+ client : OllamaClient or BitnetClient, optional
80
+ Client to use. Creates one via get_default_client() if not provided.
81
+
82
+ Returns
83
+ -------
84
+ list[str]
85
+ List of model names available on the backend.
86
+ """
87
+ if client is None:
88
+ client = get_default_client()
89
+
90
+ if not client.is_running():
91
+ return []
92
+
93
+ return client.list_models() or []
94
+
95
+
96
+ def get_system_prompt(model: str, client=None, default_prompt: str = None):
97
+ """
98
+ Get the system prompt based on AGENTNOVA_USE_MF_SYS environment variable.
99
+
100
+ If AGENTNOVA_USE_MF_SYS=1, returns the Modelfile's system prompt for the model.
101
+ Otherwise returns the provided default_prompt.
102
+
103
+ Parameters
104
+ ----------
105
+ model : str
106
+ Model name to get system prompt for.
107
+ client : OllamaClient or BitnetClient, optional
108
+ Client to use. Creates one via get_default_client() if not provided.
109
+ default_prompt : str, optional
110
+ Default system prompt to use if AGENTNOVA_USE_MF_SYS is not set.
111
+ If None and AGENTNOVA_USE_MF_SYS=1 but no Modelfile system prompt,
112
+ returns None (agent will use its own default).
113
+
114
+ Returns
115
+ -------
116
+ str or None
117
+ The system prompt to use, or None.
118
+
119
+ Examples
120
+ --------
121
+ >>> # Without AGENTNOVA_USE_MF_SYS set
122
+ >>> sys_prompt = get_system_prompt("llama3.2", default_prompt="You are helpful.")
123
+ >>> print(sys_prompt) # "You are helpful."
124
+
125
+ >>> # With AGENTNOVA_USE_MF_SYS=1
126
+ >>> sys_prompt = get_system_prompt("qwen2.5-coder", default_prompt="You are helpful.")
127
+ >>> print(sys_prompt) # Modelfile's system prompt, e.g., "You are Qwen..."
128
+ """
129
+ use_mf_sys = os.environ.get("AGENTNOVA_USE_MF_SYS", "0") == "1"
130
+
131
+ if use_mf_sys:
132
+ if client is None:
133
+ client = get_default_client()
134
+
135
+ # Only OllamaClient has get_modelfile_system_prompt
136
+ if hasattr(client, "get_modelfile_system_prompt"):
137
+ mf_sys = client.get_modelfile_system_prompt(model)
138
+ if mf_sys:
139
+ print(f" 📜 Using Modelfile system prompt ({len(mf_sys)} chars)")
140
+ return mf_sys
141
+ else:
142
+ print(f" ⚠ No SYSTEM prompt in Modelfile for '{model}', using default")
143
+ return default_prompt
144
+
145
+ return default_prompt
146
+
147
+ # R02 Enhancements
148
+ from .core.orchestrator_enhanced import Orchestrator as EnhancedOrchestrator, AgentCard as EnhancedAgentCard
149
+
150
+ # Tool support detection
151
+ from .cli import get_tool_support
152
+
153
+ # Shared args for test scripts
154
+ from .shared_args import add_shared_args, parse_shared_args, SharedConfig
155
+
156
+ # R02: Agent Mode
157
+ from .agent_mode import (
158
+ AgentMode, AgentState, TaskPlan, Step, Action,
159
+ create_file_write_action, create_file_delete_action,
160
+ create_mkdir_action, create_shell_action,
161
+ format_status, format_progress,
162
+ )
163
+
164
+ __all__ = [
165
+ # Core
166
+ "Agent", "AgentRun", "StepResult",
167
+ "Memory", "Tool", "ToolRegistry", "ToolParam",
168
+ "OllamaClient", "Orchestrator", "AgentCard",
169
+ # Skills
170
+ "SkillLoader", "Skill", "SkillRegistry",
171
+ # R02 Enhancements
172
+ "EnhancedOrchestrator", "EnhancedAgentCard",
173
+ "ACPPlugin",
174
+ # R02: Backend-agnostic helpers
175
+ "get_default_client",
176
+ "get_available_models",
177
+ "get_system_prompt",
178
+ "get_tool_support", # Tool support detection
179
+ "model_discovery",
180
+ "add_shared_args", # Shared CLI args for test scripts
181
+ "parse_shared_args",
182
+ "SharedConfig",
183
+ # R02: Agent Mode
184
+ "AgentMode", "AgentState", "TaskPlan", "Step", "Action",
185
+ "create_file_write_action", "create_file_delete_action",
186
+ "create_mkdir_action", "create_shell_action",
187
+ "format_status", "format_progress",
188
+ # R02.5: Model Family Configuration
189
+ "ModelFamilyConfig", "FAMILY_CONFIGS",
190
+ "get_family_config", "get_stop_tokens", "supports_tools",
191
+ "get_tool_format", "get_preferred_temperature", "should_use_few_shot",
192
+ "get_few_shot_style", "has_known_issues", "get_react_system_suffix",
193
+ "get_native_tool_hints",
194
+ # Config exports
195
+ "OLLAMA_BASE_URL",
196
+ "BITNET_BASE_URL",
197
+ "ACP_BASE_URL",
198
+ "ACP_USER",
199
+ "ACP_PASS",
200
+ "DEFAULT_MODEL",
201
+ "AGENTNOVA_BACKEND",
202
+ ]
203
+
204
+ # Conditionally export BitNet
205
+ if _BITNET_AVAILABLE:
206
+ __all__.extend(["BitnetClient", "KNOWN_MODELS"])
207
+
208
+ __version__ = "0.2.5"
209
+ __author__ = "VTSTech"
210
+ __author_email__ = "veritas@vts-tech.org"
211
+ __url__ = "https://github.com/VTSTech/AgentNova"
212
+ __website__ = "https://www.vts-tech.org"
@@ -1,27 +1,27 @@
1
- #!/usr/bin/env python3
2
- """
3
- ⚛️ AgentNova R00 — 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()
1
+ #!/usr/bin/env python3
2
+ """
3
+ ⚛️ AgentNova R02 — 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()