Skip to content

Commit 42c827e

Browse files
authored
refactor(agent): json-viewer switch to to-json-schema module (#164)
1 parent 8e25114 commit 42c827e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

agents/json-viewer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
33
"@inquirer/input": "^4.0.2",
4-
"json-schema-generator": "^2.0.6"
4+
"to-json-schema": "^0.2.5"
55
}
66
}

agents/json-viewer/tools.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { promisify } = require("node:util");
44
const path = require("node:path");
55
const { tmpdir } = require("node:os");
66

7-
const jsonSchemaGenerator = require("json-schema-generator");
7+
const toJsonSchema = require('to-json-schema');
88
const input = require("@inquirer/input").default;
99

1010
exports._instructions = async function () {
@@ -23,7 +23,7 @@ exports._instructions = async function () {
2323
}
2424

2525
const json_data = await fs.readFile(json_file_path, "utf8");
26-
const json_schema = jsonSchemaGenerator(JSON.parse(json_data));
26+
const json_schema = toJsonSchema(JSON.parse(json_data));
2727

2828
return `You are a AI agent that can view and filter json data with jq.
2929

0 commit comments

Comments
 (0)