mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 04:30:10 +01:00
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:
parent
0524aadf58
commit
11b7ccda07
@ -33,7 +33,10 @@ ${JSON.stringify(def.parameters.properties, null, 4)}\n`;
|
|||||||
|
|
||||||
if (Array.isArray(def.examples)) {
|
if (Array.isArray(def.examples)) {
|
||||||
def.examples.forEach(({ prompt, call }) => {
|
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`;
|
output += `${shotExample}-----------\n`;
|
||||||
|
Loading…
Reference in New Issue
Block a user