refactor(agent): json-viewer switch to to-json-schema module (#164)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@inquirer/input": "^4.0.2",
|
"@inquirer/input": "^4.0.2",
|
||||||
"json-schema-generator": "^2.0.6"
|
"to-json-schema": "^0.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const { promisify } = require("node:util");
|
|||||||
const path = require("node:path");
|
const path = require("node:path");
|
||||||
const { tmpdir } = require("node:os");
|
const { tmpdir } = require("node:os");
|
||||||
|
|
||||||
const jsonSchemaGenerator = require("json-schema-generator");
|
const toJsonSchema = require('to-json-schema');
|
||||||
const input = require("@inquirer/input").default;
|
const input = require("@inquirer/input").default;
|
||||||
|
|
||||||
exports._instructions = async function () {
|
exports._instructions = async function () {
|
||||||
@@ -23,7 +23,7 @@ exports._instructions = async function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const json_data = await fs.readFile(json_file_path, "utf8");
|
const json_data = await fs.readFile(json_file_path, "utf8");
|
||||||
const json_schema = jsonSchemaGenerator(JSON.parse(json_data));
|
const json_schema = toJsonSchema(JSON.parse(json_data));
|
||||||
|
|
||||||
return `You are a AI agent that can view and filter json data with jq.
|
return `You are a AI agent that can view and filter json data with jq.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user