Skip to content

Commit

Permalink
fix: use new ToolsFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser committed Apr 12, 2024
1 parent 897feb9 commit 7225e91
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions templates/components/engines/typescript/agent/chat.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import {
BaseTool,
OpenAIAgent,
QueryEngineTool,
Settings,
ToolFactory,
} from "llamaindex";
import { BaseTool, OpenAIAgent, QueryEngineTool } from "llamaindex";
import { ToolsFactory } from "llamaindex/tools/ToolsFactory";
import fs from "node:fs/promises";
import path from "node:path";
import { getDataSource } from "./index";
Expand Down Expand Up @@ -33,12 +28,10 @@ export async function createChatEngine() {
const config = JSON.parse(
await fs.readFile(path.join("config", "tools.json"), "utf8"),
);
tools = tools.concat(await ToolFactory.createTools(config));
tools = tools.concat(await ToolsFactory.createTools(config));
} catch {}

return new OpenAIAgent({
tools,
llm: Settings.llm,
verbose: true,
});
}

0 comments on commit 7225e91

Please sign in to comment.