Fix tooling examples (#2513)

* Fix incorrect json API description.

* small edits and validity checks

* remove console.logs

* unset and recheck changes

---------

Co-authored-by: Adam <phazei@gmail.com>
This commit is contained in:
Timothy Carambat 2024-10-21 13:56:37 -07:00 committed by GitHub
parent 0524aadf58
commit 11b7ccda07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,10 @@ ${JSON.stringify(def.parameters.properties, null, 4)}\n`;
if (Array.isArray(def.examples)) {
def.examples.forEach(({ prompt, call }) => {
shotExample += `Query: "${prompt}"\nJSON: ${call}\n`;
shotExample += `Query: "${prompt}"\nJSON: ${JSON.stringify({
name: def.name,
arguments: safeJsonParse(call, {}),
})}\n`;
});
}
output += `${shotExample}-----------\n`;