Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26d2de824f | |||
| 969d21c51a | |||
| da2b827ba3 | |||
| 9bc1f74978 |
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-01-20 - 1.15.1 - fix(tests)
|
||||||
|
enable progress events in invoice tests and bump @push.rocks/smartagent devDependency to ^1.5.4
|
||||||
|
|
||||||
|
- Added an onProgress handler in test/test.invoices.nanonets.ts to log progress events (console.log(event.logMessage)) so tool calls and progress are visible during tests.
|
||||||
|
- Bumped devDependency @push.rocks/smartagent from ^1.5.2 to ^1.5.4 in package.json.
|
||||||
|
|
||||||
## 2026-01-20 - 1.15.0 - feat(tests)
|
## 2026-01-20 - 1.15.0 - feat(tests)
|
||||||
integrate SmartAi/DualAgentOrchestrator into extraction tests and add JSON self-validation
|
integrate SmartAi/DualAgentOrchestrator into extraction tests and add JSON self-validation
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@host.today/ht-docker-ai",
|
"name": "@host.today/ht-docker-ai",
|
||||||
"version": "1.15.0",
|
"version": "1.15.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Docker images for AI vision-language models including MiniCPM-V 4.5",
|
"description": "Docker images for AI vision-language models including MiniCPM-V 4.5",
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsrun": "^2.0.1",
|
"@git.zone/tsrun": "^2.0.1",
|
||||||
"@git.zone/tstest": "^3.1.5",
|
"@git.zone/tstest": "^3.1.5",
|
||||||
"@push.rocks/smartagent": "^1.3.0",
|
"@push.rocks/smartagent": "^1.5.4",
|
||||||
"@push.rocks/smartai": "^0.12.0"
|
"@push.rocks/smartai": "^0.13.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
22
pnpm-lock.yaml
generated
22
pnpm-lock.yaml
generated
@@ -19,11 +19,11 @@ importers:
|
|||||||
specifier: ^3.1.5
|
specifier: ^3.1.5
|
||||||
version: 3.1.6(socks@2.8.7)(typescript@5.9.3)
|
version: 3.1.6(socks@2.8.7)(typescript@5.9.3)
|
||||||
'@push.rocks/smartagent':
|
'@push.rocks/smartagent':
|
||||||
specifier: ^1.3.0
|
specifier: ^1.5.4
|
||||||
version: 1.3.0(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
version: 1.5.4(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
||||||
'@push.rocks/smartai':
|
'@push.rocks/smartai':
|
||||||
specifier: ^0.12.0
|
specifier: ^0.13.2
|
||||||
version: 0.12.0(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
version: 0.13.2(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@@ -868,11 +868,11 @@ packages:
|
|||||||
'@push.rocks/qenv@6.1.3':
|
'@push.rocks/qenv@6.1.3':
|
||||||
resolution: {integrity: sha512-+z2hsAU/7CIgpYLFqvda8cn9rUBMHqLdQLjsFfRn5jPoD7dJ5rFlpkbhfM4Ws8mHMniwWaxGKo+q/YBhtzRBLg==}
|
resolution: {integrity: sha512-+z2hsAU/7CIgpYLFqvda8cn9rUBMHqLdQLjsFfRn5jPoD7dJ5rFlpkbhfM4Ws8mHMniwWaxGKo+q/YBhtzRBLg==}
|
||||||
|
|
||||||
'@push.rocks/smartagent@1.3.0':
|
'@push.rocks/smartagent@1.5.4':
|
||||||
resolution: {integrity: sha512-MuiJVJcl9Pdr03k1zVwgxTqprbIHKwqPqXdOmYFYn0xYnixOX1tBUYkGsu6xIntXq8t4WazBJiF9hCiMpDTiRA==}
|
resolution: {integrity: sha512-W5DoG0MUY6oAvxMcMC0M0ZmMmjs6zs8WcDnz5jVcg74vD3oaSguJjcokjB4L4Tv1dzEhq0ArDOnaC2C0Lf3z7w==}
|
||||||
|
|
||||||
'@push.rocks/smartai@0.12.0':
|
'@push.rocks/smartai@0.13.2':
|
||||||
resolution: {integrity: sha512-T4HRaSSxO6TQGGXlQeswX2eYkB+gMu0FbKF9qCUri6FdRlYzmPDn19jgPrPJxyg5m3oj6TzflvfYwcBCFlWo/A==}
|
resolution: {integrity: sha512-FqnHh31tU0Nkr/g25UMAjjE7gZVN8cuioRlSq1xo19rS9kyMiux+UzpylO2tgXF5S+lTsw5cGtfP0BUfrxlTGg==}
|
||||||
|
|
||||||
'@push.rocks/smartarchive@5.2.1':
|
'@push.rocks/smartarchive@5.2.1':
|
||||||
resolution: {integrity: sha512-TNv5q6QuBRX7jrzffiyb6A8AALNAr0kyAcJswa0l3ahBP1Q6zszNo9xOVXmW2gKX2KShtO/Y+Cn0i46n8lbnaQ==}
|
resolution: {integrity: sha512-TNv5q6QuBRX7jrzffiyb6A8AALNAr0kyAcJswa0l3ahBP1Q6zszNo9xOVXmW2gKX2KShtO/Y+Cn0i46n8lbnaQ==}
|
||||||
@@ -5206,9 +5206,9 @@ snapshots:
|
|||||||
'@push.rocks/smartlog': 3.1.10
|
'@push.rocks/smartlog': 3.1.10
|
||||||
'@push.rocks/smartpath': 6.0.0
|
'@push.rocks/smartpath': 6.0.0
|
||||||
|
|
||||||
'@push.rocks/smartagent@1.3.0(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)':
|
'@push.rocks/smartagent@1.5.4(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/smartai': 0.12.0(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
'@push.rocks/smartai': 0.13.2(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)
|
||||||
'@push.rocks/smartbrowser': 2.0.8(typescript@5.9.3)
|
'@push.rocks/smartbrowser': 2.0.8(typescript@5.9.3)
|
||||||
'@push.rocks/smartdeno': 1.2.0
|
'@push.rocks/smartdeno': 1.2.0
|
||||||
'@push.rocks/smartfs': 1.3.1
|
'@push.rocks/smartfs': 1.3.1
|
||||||
@@ -5230,7 +5230,7 @@ snapshots:
|
|||||||
- ws
|
- ws
|
||||||
- zod
|
- zod
|
||||||
|
|
||||||
'@push.rocks/smartai@0.12.0(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)':
|
'@push.rocks/smartai@0.13.2(typescript@5.9.3)(ws@8.19.0)(zod@3.25.76)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@anthropic-ai/sdk': 0.71.2(zod@3.25.76)
|
'@anthropic-ai/sdk': 0.71.2(zod@3.25.76)
|
||||||
'@mistralai/mistralai': 1.12.0
|
'@mistralai/mistralai': 1.12.0
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ const smartAi = new SmartAi({
|
|||||||
baseUrl: OLLAMA_URL,
|
baseUrl: OLLAMA_URL,
|
||||||
model: EXTRACTION_MODEL,
|
model: EXTRACTION_MODEL,
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
num_ctx: 32768, // Larger context for long invoices + thinking
|
num_ctx: 65536, // 64K context for long invoices + reasoning chains
|
||||||
temperature: 0, // Deterministic for JSON extraction
|
temperature: 0, // Deterministic for JSON extraction
|
||||||
|
repeat_penalty: 1.3, // Penalty to prevent repetition loops
|
||||||
|
think: true, // Enable thinking mode for GPT-OSS reasoning
|
||||||
},
|
},
|
||||||
defaultTimeout: 600000, // 10 minute timeout for large documents
|
defaultTimeout: 600000, // 10 minute timeout for large documents
|
||||||
},
|
},
|
||||||
@@ -636,7 +638,7 @@ tap.test('Stage 2: Setup Ollama + GPT-OSS 20B', async () => {
|
|||||||
console.log(' [SmartAgent] Starting SmartAi...');
|
console.log(' [SmartAgent] Starting SmartAi...');
|
||||||
await smartAi.start();
|
await smartAi.start();
|
||||||
|
|
||||||
console.log(' [SmartAgent] Creating DualAgentOrchestrator...');
|
console.log(' [SmartAgent] Creating DualAgentOrchestrator with native tool calling...');
|
||||||
orchestrator = new DualAgentOrchestrator({
|
orchestrator = new DualAgentOrchestrator({
|
||||||
smartAiInstance: smartAi,
|
smartAiInstance: smartAi,
|
||||||
defaultProvider: 'ollama',
|
defaultProvider: 'ollama',
|
||||||
@@ -652,24 +654,21 @@ tap.test('Stage 2: Setup Ollama + GPT-OSS 20B', async () => {
|
|||||||
CRITICAL RULES:
|
CRITICAL RULES:
|
||||||
1. Output valid JSON with the exact format requested
|
1. Output valid JSON with the exact format requested
|
||||||
2. If you cannot find a value, use empty string "" or 0 for numbers
|
2. If you cannot find a value, use empty string "" or 0 for numbers
|
||||||
3. IMPORTANT: Before completing, validate your JSON using the json.validate tool:
|
3. Before completing, validate your JSON using the json_validate tool
|
||||||
|
4. Only complete after validation passes`,
|
||||||
<tool_call>
|
|
||||||
<tool>json</tool>
|
|
||||||
<action>validate</action>
|
|
||||||
<params>{"jsonString": "YOUR_JSON", "requiredFields": ["invoice_number", "invoice_date", "vendor_name", "currency", "net_amount", "vat_amount", "total_amount"]}</params>
|
|
||||||
</tool_call>
|
|
||||||
|
|
||||||
4. Only complete after validation passes
|
|
||||||
|
|
||||||
When done, wrap your JSON in <task_complete></task_complete> tags.`,
|
|
||||||
maxIterations: 5,
|
maxIterations: 5,
|
||||||
|
// Enable native tool calling for GPT-OSS (uses Harmony format instead of XML)
|
||||||
|
useNativeToolCalling: true,
|
||||||
// Enable streaming for real-time progress visibility
|
// Enable streaming for real-time progress visibility
|
||||||
onToken: (token, source) => {
|
onToken: (token, source) => {
|
||||||
if (source === 'driver') {
|
if (source === 'driver') {
|
||||||
process.stdout.write(token);
|
process.stdout.write(token);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Enable progress events to see tool calls
|
||||||
|
onProgress: (event: { logMessage: string }) => {
|
||||||
|
console.log(event.logMessage);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register JsonValidatorTool for self-validation
|
// Register JsonValidatorTool for self-validation
|
||||||
|
|||||||
Reference in New Issue
Block a user