aboutsummaryrefslogtreecommitdiffstats
path: root/agents/json-viewer/tools.js
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2025-02-13 08:57:54 +0800
committerGitHub <noreply@github.com>2025-02-13 08:57:54 +0800
commit42c827e556e9200662728193c85d2ba261c5332f (patch)
tree1a637c0a6042a5dbbede51dbf64839e69393504b /agents/json-viewer/tools.js
parent8e2511493d33d001f86fdd5304db109e63eeccd9 (diff)
downloadllm-functions-docker-42c827e556e9200662728193c85d2ba261c5332f.tar.gz
refactor(agent): json-viewer switch to to-json-schema module (#164)
Diffstat (limited to 'agents/json-viewer/tools.js')
-rw-r--r--agents/json-viewer/tools.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/agents/json-viewer/tools.js b/agents/json-viewer/tools.js
index ea673b9..eba8c93 100644
--- a/agents/json-viewer/tools.js
+++ b/agents/json-viewer/tools.js
@@ -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.