@supersolutions/super-chat-core 0.4.2 → 0.4.3
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/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5592,10 +5592,11 @@ function createVisualizeTool(opts) {
|
|
|
5592
5592
|
const full = { ...spec ?? {}, kind };
|
|
5593
5593
|
const verdict = cards.validate(full);
|
|
5594
5594
|
if (!verdict.ok) {
|
|
5595
|
+
const shape = verdict.expected ?? cards.get(kind)?.summary;
|
|
5595
5596
|
return {
|
|
5596
5597
|
// Returned as data, not thrown: the model reads the correction and
|
|
5597
5598
|
// retries with a valid spec on the next step.
|
|
5598
|
-
output: { ok: false, error: verdict.error, ...
|
|
5599
|
+
output: { ok: false, error: verdict.error, ...shape ? { expected: shape } : {} },
|
|
5599
5600
|
failure: "invalid-input"
|
|
5600
5601
|
};
|
|
5601
5602
|
}
|