refactor(agent): json-viewer switch to to-json-schema module (#164)

This commit is contained in:
sigoden
2025-02-13 08:57:54 +08:00
committed by GitHub
parent 8e2511493d
commit 42c827e556
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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"
} }
} }
+2 -2
View File
@@ -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.