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

This commit is contained in:
sigoden authored and GitHub committed 2025-02-13 08:57:54 +08:00
1 parent 8e2511493d
commit 42c827e556
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"dependencies": {
"@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 { tmpdir } = require("node:os");
const jsonSchemaGenerator = require("json-schema-generator");
const toJsonSchema = require('to-json-schema');
const input = require("@inquirer/input").default;
exports._instructions = async function () {
@@ -23,7 +23,7 @@ exports._instructions = async function () {
}
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.