Open sangee2004 opened 1 month ago
Electron dev build with commit id - 6e2f8ed99637f9
6e2f8ed99637f9
Steps to reproduce the problem:
Following is the assistant that was generated when creating the tool:
Name: sangeetestnewagent Type: Tool Tools: json-query Chat: true You are a good assistant wait for user to ask you a question --- Name: json-query Type: Tool #!node const jq = require('node-jq'); // Simple argument parsing function function parseArgs() { const args = {}; process.argv.slice(2).forEach((val, index, array) => { if (val.startsWith('--')) { const argName = val.substring(2); // Check if we are not at the last element and the next element doesn't start with '--' if (index < array.length - 1 && !array[index + 1].startsWith('--')) { // Directly assign the following value to the argument args[argName] = array[index + 1]; } } }); return args; } const args = parseArgs(); // Fallback to default values if arguments not provided const filter = args.filter || '.'; const jsonPath = args.jsonpath; const options = { input: 'file', output: 'json', slurp: args.optionSlurp === 'true' }; jq.run(filter, jsonPath, options) .then((output) => { console.log(output); }) .catch((err) => { console.error(err); }); --- !metadata:json-query:package.json { "name": "jq", "version": "0.0.1", "description": "gptscript jq tool", "main": "jq.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "cloudnautique", "license": "MIT", "dependencies": { "node-jq": "^4.3.0" }, "devDependencies": {} }
@sangee2004 This should now be fixed. Can you give it another try?
@sangee2004 Why was this issue reopened?
Electron dev build with commit id -
6e2f8ed99637f9
Steps to reproduce the problem:
Following is the assistant that was generated when creating the tool: