feat: adjust the way of returning data to LLM (#69)

This commit is contained in:
sigoden
2024-07-10 18:53:32 +08:00
committed by GitHub
parent 01e07c0cc0
commit 732eae532c
37 changed files with 218 additions and 142 deletions
+10 -5
View File
@@ -12,13 +12,18 @@
* @param {Args} args
*/
exports.run = function run(args) {
for (const [key, value] of Object.entries(args)) {
console.log(`${key}: ${JSON.stringify(value)}`);
}
let output = `string: ${args.string}
string_enum: ${args.string_enum}
string_optional: ${args.string_optional}
boolean: ${args.boolean}
integer: ${args.integer}
number: ${args.number}
array: ${args.array}
array_optional: ${args.array_optional}`;
for (const [key, value] of Object.entries(process.env)) {
if (key.startsWith("LLM_")) {
console.log(`${key}: ${value}`);
output = `${output}\n${key}: ${value}`;
}
}
return output;
}