@probelabs/probe 0.6.0-rc233 → 0.6.0-rc234
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.
- package/bin/binaries/probe-v0.6.0-rc234-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc234-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc234-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc234-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc234-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/ProbeAgent.js +15 -1
- package/build/agent/index.js +462 -1005
- package/build/agent/schemaUtils.js +74 -1
- package/build/agent/tasks/taskTool.js +6 -1
- package/cjs/agent/ProbeAgent.cjs +462 -1005
- package/cjs/index.cjs +462 -1005
- package/package.json +2 -2
- package/src/agent/ProbeAgent.js +15 -1
- package/src/agent/schemaUtils.js +74 -1
- package/src/agent/tasks/taskTool.js +6 -1
- package/bin/binaries/probe-v0.6.0-rc233-aarch64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc233-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc233-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc233-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc233-x86_64-unknown-linux-musl.tar.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -81,7 +81,8 @@ import {
|
|
|
81
81
|
generateSchemaInstructions,
|
|
82
82
|
isJsonSchemaDefinition,
|
|
83
83
|
createSchemaDefinitionCorrectionPrompt,
|
|
84
|
-
validateAndFixMermaidResponse
|
|
84
|
+
validateAndFixMermaidResponse,
|
|
85
|
+
tryAutoWrapForSimpleSchema
|
|
85
86
|
} from './schemaUtils.js';
|
|
86
87
|
import { removeThinkingTags } from './xmlParsingUtils.js';
|
|
87
88
|
import { predefinedPrompts } from './shared/prompts.js';
|
|
@@ -4501,6 +4502,19 @@ Convert your previous response content into actual JSON data that follows this s
|
|
|
4501
4502
|
retryCount = 1; // Start at 1 since we already did one correction
|
|
4502
4503
|
}
|
|
4503
4504
|
|
|
4505
|
+
// Before entering correction loop, try auto-wrapping for simple schemas
|
|
4506
|
+
// This avoids re-invoking AI for schemas like {text: string} where we can just wrap programmatically
|
|
4507
|
+
if (!validation.isValid) {
|
|
4508
|
+
const autoWrapped = tryAutoWrapForSimpleSchema(finalResult, options.schema, { debug: this.debug });
|
|
4509
|
+
if (autoWrapped) {
|
|
4510
|
+
if (this.debug) {
|
|
4511
|
+
console.log(`[DEBUG] JSON validation: Auto-wrapped plain text for simple schema`);
|
|
4512
|
+
}
|
|
4513
|
+
finalResult = autoWrapped;
|
|
4514
|
+
validation = validateJsonResponse(finalResult, { debug: this.debug });
|
|
4515
|
+
}
|
|
4516
|
+
}
|
|
4517
|
+
|
|
4504
4518
|
while (!validation.isValid && retryCount < maxRetries) {
|
|
4505
4519
|
if (this.debug) {
|
|
4506
4520
|
console.log(`[DEBUG] JSON validation: attempt_completion validation failed (attempt ${retryCount + 1}/${maxRetries}):`, validation.error);
|