aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/chatbot/tools')
-rw-r--r--src/client/views/nodes/chatbot/tools/BaseTool.ts4
-rw-r--r--src/client/views/nodes/chatbot/tools/CalculateTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/CreateCSVTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts392
-rw-r--r--src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/GetDocsTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/NoTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/RAGTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/SearchTool.ts12
-rw-r--r--src/client/views/nodes/chatbot/tools/ToolTypes.ts76
-rw-r--r--src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts2
-rw-r--r--src/client/views/nodes/chatbot/tools/WikipediaTool.ts4
12 files changed, 410 insertions, 92 deletions
diff --git a/src/client/views/nodes/chatbot/tools/BaseTool.ts b/src/client/views/nodes/chatbot/tools/BaseTool.ts
index 58cd514d9..05ca83b26 100644
--- a/src/client/views/nodes/chatbot/tools/BaseTool.ts
+++ b/src/client/views/nodes/chatbot/tools/BaseTool.ts
@@ -1,5 +1,5 @@
import { Observation } from '../types/types';
-import { Parameter, Tool, ParametersType } from './ToolTypes';
+import { Parameter, ParametersType } from '../types/tool_types';
/**
* @file BaseTool.ts
@@ -14,7 +14,7 @@ import { Parameter, Tool, ParametersType } from './ToolTypes';
* It is generic over a type parameter `P`, which extends `ReadonlyArray<Parameter>`.
* This means `P` is a readonly array of `Parameter` objects that cannot be modified (immutable).
*/
-export abstract class BaseTool<P extends ReadonlyArray<Parameter>> implements Tool<P> {
+export abstract class BaseTool<P extends ReadonlyArray<Parameter>> {
// The name of the tool (e.g., "calculate", "searchTool")
name: string;
// A description of the tool's functionality
diff --git a/src/client/views/nodes/chatbot/tools/CalculateTool.ts b/src/client/views/nodes/chatbot/tools/CalculateTool.ts
index e96c9a98a..139ede8f0 100644
--- a/src/client/views/nodes/chatbot/tools/CalculateTool.ts
+++ b/src/client/views/nodes/chatbot/tools/CalculateTool.ts
@@ -1,5 +1,5 @@
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
import { BaseTool } from './BaseTool';
const calculateToolParams = [
diff --git a/src/client/views/nodes/chatbot/tools/CreateCSVTool.ts b/src/client/views/nodes/chatbot/tools/CreateCSVTool.ts
index b321d98ba..2cc513d6c 100644
--- a/src/client/views/nodes/chatbot/tools/CreateCSVTool.ts
+++ b/src/client/views/nodes/chatbot/tools/CreateCSVTool.ts
@@ -1,7 +1,7 @@
import { BaseTool } from './BaseTool';
import { Networking } from '../../../../Network';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
const createCSVToolParams = [
{
diff --git a/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts b/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts
new file mode 100644
index 000000000..63a6004a7
--- /dev/null
+++ b/src/client/views/nodes/chatbot/tools/CreateDocumentTool.ts
@@ -0,0 +1,392 @@
+import { v4 as uuidv4 } from 'uuid';
+import { BaseTool } from './BaseTool';
+import { Observation } from '../types/types';
+import { ParametersType } from '../types/tool_types';
+import { DocumentOptions } from '../../../../documents/Documents';
+
+/**
+ * Tthe CreateDocTool class is responsible for creating
+ * documents of various types (e.g., text, flashcards, collections) and organizing them in a
+ * structured manner. The tool supports creating dashboards with diverse document types and
+ * ensures proper placement of documents without overlap.
+ */
+
+// Example document structure for various document types
+const example = [
+ {
+ doc_type: 'equation',
+ title: 'quadratic',
+ data: 'x^2 + y^2 = 3',
+ width: 300,
+ height: 300,
+ x: 0,
+ y: 0,
+ },
+ {
+ doc_type: 'collection',
+ title: 'Advanced Biology',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'Cell Structure',
+ data: 'Cells are the basic building blocks of all living organisms.',
+ width: 300,
+ height: 300,
+ x: 500,
+ y: 0,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 600,
+ height: 600,
+ x: 600,
+ y: 0,
+ type_collection: 'tree',
+ },
+ {
+ doc_type: 'image',
+ title: 'experiment',
+ data: 'https://plus.unsplash.com/premium_photo-1694819488591-a43907d1c5cc?q=80&w=2628&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
+ width: 300,
+ height: 300,
+ x: 600,
+ y: 300,
+ },
+ {
+ doc_type: 'deck',
+ title: 'Chemistry',
+ data: [
+ {
+ doc_type: 'flashcard',
+ title: 'Photosynthesis',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'front_Photosynthesis',
+ data: 'What is photosynthesis?',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 600,
+ },
+ {
+ doc_type: 'text',
+ title: 'back_photosynthesis',
+ data: 'The process by which plants make food.',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 700,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 300,
+ height: 300,
+ x: 300,
+ y: 1000,
+ },
+ {
+ doc_type: 'flashcard',
+ title: 'Photosynthesis',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'front_Photosynthesis',
+ data: 'What is photosynthesis?',
+ width: 300,
+ height: 300,
+ x: 200,
+ y: 800,
+ },
+ {
+ doc_type: 'text',
+ title: 'back_photosynthesis',
+ data: 'The process by which plants make food.',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: -100,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 300,
+ height: 300,
+ x: 10,
+ y: 70,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 600,
+ height: 600,
+ x: 200,
+ y: 800,
+ },
+ {
+ doc_type: 'web',
+ title: 'Brown University Wikipedia',
+ data: 'https://en.wikipedia.org/wiki/Brown_University',
+ width: 300,
+ height: 300,
+ x: 1000,
+ y: 2000,
+ },
+ {
+ doc_type: 'simulation',
+ title: 'Physics simulation',
+ data: '',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 100,
+ },
+ {
+ doc_type: 'comparison',
+ title: 'WWI vs. WWII',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'WWI',
+ data: 'From 1914 to 1918, fighting took place across several continents, at sea and, for the first time, in the air.',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 100,
+ },
+ {
+ doc_type: 'text',
+ title: 'WWII',
+ data: 'A devastating global conflict spanning from 1939 to 1945, saw the Allied powers fight against the Axis powers.',
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 100,
+ },
+ ],
+ width: 300,
+ height: 300,
+ x: 100,
+ y: 100,
+ },
+ {
+ doc_type: 'collection',
+ title: 'Science Collection',
+ data: [
+ {
+ doc_type: 'flashcard',
+ title: 'Photosynthesis',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'front_Photosynthesis',
+ data: 'What is photosynthesis?',
+ width: 300,
+ height: 300,
+ },
+ {
+ doc_type: 'text',
+ title: 'back_photosynthesis',
+ data: 'The process by which plants make food.',
+ width: 300,
+ height: 300,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 300,
+ height: 300,
+ },
+ {
+ doc_type: 'web',
+ title: 'Brown University Wikipedia',
+ data: 'https://en.wikipedia.org/wiki/Brown_University',
+ width: 300,
+ height: 300,
+ x: 1100,
+ y: 1100,
+ },
+ {
+ doc_type: 'text',
+ title: 'Water Cycle',
+ data: 'The continuous movement of water on, above, and below the Earth’s surface.',
+ width: 300,
+ height: 300,
+ x: 1500,
+ y: 500,
+ },
+ {
+ doc_type: 'collection',
+ title: 'Advanced Biology',
+ data: [
+ {
+ doc_type: 'text',
+ title: 'Cell Structure',
+ data: 'Cells are the basic building blocks of all living organisms.',
+ width: 300,
+ height: 300,
+ },
+ ],
+ backgroundColor: '#00ff00',
+ width: 600,
+ height: 600,
+ x: 1100,
+ y: 500,
+ type_collection: 'freeform',
+ },
+ ],
+ width: 600,
+ height: 600,
+ x: 500,
+ y: 500,
+ type_collection: 'freeform',
+ },
+];
+
+// Stringify the entire structure for transmission if needed
+const finalJsonString = JSON.stringify(example);
+
+// Instructions for creating various document types
+const docInstructions = {
+ collection: {
+ description:
+ 'A recursive collection of documents as a stringified array. Each document can be a "text", "deck", "flashcard", "image", "web", "image", "comparison", "equation", "noteboard", "simulation", "diagram", "map", "screengrab", "webcam", "button", or another "collection".',
+ example: finalJsonString,
+ },
+ text: 'Provide text content as a plain string. Example: "This is a standalone text document."',
+ flashcard: 'Two text documents with content for the front and back.',
+ deck: 'A decks data is an array of flashcards.',
+ web: 'A URL to a webpage. Example: https://en.wikipedia.org/wiki/Brown_University',
+ equation: 'Create an equation document, not a text document. Data is math equation.',
+ noteboard: 'Create a noteboard document',
+ simulation: 'Create a simulation document',
+ audio: 'A url to an audio recording. Example: ',
+} as const;
+
+// Parameters for creating individual documents
+const createDocToolParams = [
+ {
+ name: 'data',
+ type: 'string', // Accepts either string or array, supporting individual and nested data
+ description: docInstructions,
+ required: true,
+ },
+ {
+ name: 'doc_type',
+ type: 'string',
+ description: 'The type of the document. Options: "collection", "text", "flashcard", "web".',
+ required: true,
+ },
+ {
+ name: 'title',
+ type: 'string',
+ description: 'The title of the document.',
+ required: true,
+ },
+ {
+ name: 'x',
+ type: 'number',
+ description: 'The x location of the document; 0 <= x.',
+ required: true,
+ },
+ {
+ name: 'y',
+ type: 'number',
+ description: 'The y location of the document; 0 <= y.',
+ required: true,
+ },
+ {
+ name: 'background_color',
+ type: 'string',
+ description: 'The background color of the document as a hex string.',
+ required: false,
+ },
+ {
+ name: 'font_color',
+ type: 'string',
+ description: 'The font color of the document as a hex string.',
+ required: false,
+ },
+ {
+ name: 'width',
+ type: 'number',
+ description: 'The width of the document in pixels.',
+ required: true,
+ },
+ {
+ name: 'height',
+ type: 'number',
+ description: 'The height of the document in pixels.',
+ required: true,
+ },
+ {
+ name: 'type_collection',
+ type: 'string',
+ description: 'Either freeform, card, carousel, 3d-carousel, multicolumn, multirow, linear, map, notetaking, schema, stacking, grid, tree, or masonry.',
+ required: false,
+ },
+] as const;
+
+// Parameters for creating a list of documents
+const createListDocToolParams = [
+ {
+ name: 'docs',
+ type: 'string',
+ description:
+ 'Array of documents in stringified JSON format. Each item in the array should be an individual stringified JSON object. Each document can be of type "text", "flashcard", "web", or "collection" (for nested documents). ' +
+ 'Use this structure for nesting collections within collections. Each document should follow the structure in ' +
+ createDocToolParams +
+ '. Example: ' +
+ finalJsonString,
+ required: true,
+ },
+] as const;
+
+type CreateListDocToolParamsType = typeof createListDocToolParams;
+
+// Tool class for creating documents
+export class CreateDocTool extends BaseTool<CreateListDocToolParamsType> {
+ private _addLinkedDoc: (doc_type: string, data: string, options: DocumentOptions, id: string) => void;
+
+ constructor(addLinkedDoc: (doc_type: string, data: string, options: DocumentOptions, id: string) => void) {
+ super(
+ 'createDoc',
+ 'Creates one or more documents that best fit the user’s request. If the user requests a "dashboard," first call the search tool and then generate a variety of document types individually, with absolutely a minimum of 20 documents with two stacks of flashcards that are small and it should have a couple nested freeform collections of things, each with different content and color schemes. For example, create multiple individual documents like "text," "deck," "web", "equation," and "comparison." Use decks instead of flashcards for dashboards. Decks should have at least three flashcards. Really think about what documents are useful to the user. If they ask for a dashboard about the skeletal system, include flashcards, as they would be helpful. Arrange the documents in a grid layout, ensuring that the x and y coordinates are calculated so no documents overlap but they should be directly next to each other with 20 padding in between. Take into account the width and height of each document, spacing them appropriately to prevent collisions. Use a systematic approach, such as placing each document in a grid cell based on its order, where cell dimensions match the document dimensions plus a fixed margin for spacing. Do not nest all documents within a single collection unless explicitly requested by the user. Instead, create a set of independent documents with diverse document types. Each type should appear separately unless specified otherwise.',
+ createListDocToolParams,
+ 'Use the "data" parameter for document content and include title, color, and document dimensions. Ensure web documents use URLs from the search tool if relevant. Each document in a dashboard should be unique and well-differentiated in type and content, without repetition of similar types in any single collection.',
+ 'When creating a dashboard, ensure that it consists of a broad range of document types. Include a variety of documents, such as text, web, deck, comparison, image, simulation, and equation documents, each with distinct titles and colors, following the user’s preferences. ' +
+ 'Do not overuse collections or nest all document types within a single collection; instead, represent document types individually. Use this example for reference: ' +
+ finalJsonString +
+ '. Which documents are created should be random with different numbers of each document type and different for each dashboard. Must use search tool before creating a dashboard.'
+ );
+ this._addLinkedDoc = addLinkedDoc;
+ }
+
+ // Executes the tool logic for creating documents
+ async execute(args: ParametersType<CreateListDocToolParamsType>): Promise<Observation[]> {
+ try {
+ console.log('EXE' + args.docs);
+ const parsedDoc = JSON.parse(args.docs);
+ console.log('parsed' + parsedDoc);
+ parsedDoc.forEach(doc => {
+ this._addLinkedDoc(
+ doc['doc_type'],
+ doc['data'],
+ {
+ title: doc['title'],
+ backgroundColor: doc['backgroundColor'],
+ text_fontColor: doc['font_color'],
+ _width: doc['width'],
+ _height: doc['height'],
+ type_collection: doc['type_collection'],
+ _layout_fitWidth: false,
+ _layout_autoHeight: true,
+ x: doc['x'],
+ y: doc['y'],
+ },
+ uuidv4()
+ );
+ });
+ return [{ type: 'text', text: 'Created document.' }];
+ } catch (error) {
+ return [{ type: 'text', text: 'Error creating text document, ' + error }];
+ }
+ }
+}
diff --git a/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts b/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts
index d9b75219d..97b9ee023 100644
--- a/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts
+++ b/src/client/views/nodes/chatbot/tools/DataAnalysisTool.ts
@@ -1,5 +1,5 @@
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
import { BaseTool } from './BaseTool';
const dataAnalysisToolParams = [
diff --git a/src/client/views/nodes/chatbot/tools/GetDocsTool.ts b/src/client/views/nodes/chatbot/tools/GetDocsTool.ts
index 26756522c..4286e7ffe 100644
--- a/src/client/views/nodes/chatbot/tools/GetDocsTool.ts
+++ b/src/client/views/nodes/chatbot/tools/GetDocsTool.ts
@@ -1,5 +1,5 @@
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
import { BaseTool } from './BaseTool';
import { DocServer } from '../../../../DocServer';
import { Docs } from '../../../../documents/Documents';
diff --git a/src/client/views/nodes/chatbot/tools/NoTool.ts b/src/client/views/nodes/chatbot/tools/NoTool.ts
index a92e3fa23..5d652fd8d 100644
--- a/src/client/views/nodes/chatbot/tools/NoTool.ts
+++ b/src/client/views/nodes/chatbot/tools/NoTool.ts
@@ -1,6 +1,6 @@
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
const noToolParams = [] as const;
diff --git a/src/client/views/nodes/chatbot/tools/RAGTool.ts b/src/client/views/nodes/chatbot/tools/RAGTool.ts
index 482069f36..fcd93a07a 100644
--- a/src/client/views/nodes/chatbot/tools/RAGTool.ts
+++ b/src/client/views/nodes/chatbot/tools/RAGTool.ts
@@ -1,6 +1,6 @@
import { Networking } from '../../../../Network';
import { Observation, RAGChunk } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
import { Vectorstore } from '../vectorstore/Vectorstore';
import { BaseTool } from './BaseTool';
diff --git a/src/client/views/nodes/chatbot/tools/SearchTool.ts b/src/client/views/nodes/chatbot/tools/SearchTool.ts
index fd5144dd6..d22f4c189 100644
--- a/src/client/views/nodes/chatbot/tools/SearchTool.ts
+++ b/src/client/views/nodes/chatbot/tools/SearchTool.ts
@@ -2,11 +2,11 @@ import { v4 as uuidv4 } from 'uuid';
import { Networking } from '../../../../Network';
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
const searchToolParams = [
{
- name: 'query',
+ name: 'queries',
type: 'string[]',
description: 'The search query or queries to use for finding websites',
required: true,
@@ -20,7 +20,7 @@ export class SearchTool extends BaseTool<SearchToolParamsType> {
private _addLinkedUrlDoc: (url: string, id: string) => void;
private _max_results: number;
- constructor(addLinkedUrlDoc: (url: string, id: string) => void, max_results: number = 5) {
+ constructor(addLinkedUrlDoc: (url: string, id: string) => void, max_results: number = 4) {
super(
'searchTool',
'Search the web to find a wide range of websites related to a query or multiple queries',
@@ -33,8 +33,9 @@ export class SearchTool extends BaseTool<SearchToolParamsType> {
}
async execute(args: ParametersType<SearchToolParamsType>): Promise<Observation[]> {
- const queries = args.query;
+ const queries = args.queries;
+ console.log(`Searching the web for queries: ${queries[0]}`);
// Create an array of promises, each one handling a search for a query
const searchPromises = queries.map(async query => {
try {
@@ -44,9 +45,10 @@ export class SearchTool extends BaseTool<SearchToolParamsType> {
});
const data = results.map((result: { url: string; snippet: string }) => {
const id = uuidv4();
+ this._addLinkedUrlDoc(result.url, id);
return {
type: 'text',
- text: `<chunk chunk_id="${id}" chunk_type="text"><url>${result.url}</url><overview>${result.snippet}</overview></chunk>`,
+ text: `<chunk chunk_id="${id}" chunk_type="url"><url>${result.url}</url><overview>${result.snippet}</overview></chunk>`,
};
});
return data;
diff --git a/src/client/views/nodes/chatbot/tools/ToolTypes.ts b/src/client/views/nodes/chatbot/tools/ToolTypes.ts
deleted file mode 100644
index d47a38952..000000000
--- a/src/client/views/nodes/chatbot/tools/ToolTypes.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import { Observation } from '../types/types';
-
-/**
- * The `Tool` interface represents a generic tool in the system.
- * It is generic over a type parameter `P`, which extends `ReadonlyArray<Parameter>`.
- * @template P - An array of `Parameter` objects defining the tool's parameters.
- */
-export interface Tool<P extends ReadonlyArray<Parameter>> {
- // The name of the tool (e.g., "calculate", "searchTool")
- name: string;
- // A description of the tool's functionality
- description: string;
- // An array of parameter definitions for the tool
- parameterRules: P;
- // Guidelines for how to handle citations when using the tool
- citationRules: string;
- // A brief summary of the tool's purpose
- briefSummary: string;
- /**
- * Executes the tool's main functionality.
- * @param args - The arguments for execution, with types inferred from `ParametersType<P>`.
- * @returns A promise that resolves to an array of `Observation` objects.
- */
- execute: (args: ParametersType<P>) => Promise<Observation[]>;
- /**
- * Generates an action rule object that describes the tool's usage.
- * @returns An object representing the tool's action rules.
- */
- getActionRule: () => Record<string, unknown>;
-}
-
-/**
- * The `Parameter` type defines the structure of a parameter configuration.
- */
-export type Parameter = {
- // The type of the parameter; constrained to the types 'string', 'number', 'boolean', 'string[]', 'number[]'
- readonly type: 'string' | 'number' | 'boolean' | 'string[]' | 'number[]';
- // The name of the parameter
- readonly name: string;
- // A description of the parameter
- readonly description: string;
- // Indicates whether the parameter is required
- readonly required: boolean;
- // (Optional) The maximum number of inputs (useful for array types)
- readonly max_inputs?: number;
-};
-
-/**
- * A utility type that maps string representations of types to actual TypeScript types.
- * This is used to convert the `type` field of a `Parameter` into a concrete TypeScript type.
- */
-type TypeMap = {
- string: string;
- number: number;
- boolean: boolean;
- 'string[]': string[];
- 'number[]': number[];
-};
-
-/**
- * The `ParamType` type maps a `Parameter`'s `type` field to the corresponding TypeScript type.
- * If the `type` field matches a key in `TypeMap`, it returns the associated type.
- * Otherwise, it returns `unknown`.
- * @template P - A `Parameter` object.
- */
-export type ParamType<P extends Parameter> = P['type'] extends keyof TypeMap ? TypeMap[P['type']] : unknown;
-
-/**
- * The `ParametersType` type transforms an array of `Parameter` objects into an object type
- * where each key is the parameter's name, and the value is the corresponding TypeScript type.
- * This is used to define the types of the arguments passed to the `execute` method of a tool.
- * @template P - An array of `Parameter` objects.
- */
-export type ParametersType<P extends ReadonlyArray<Parameter>> = {
- [K in P[number] as K['name']]: ParamType<K>;
-};
diff --git a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
index f2e3863a6..ce659e344 100644
--- a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
+++ b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
@@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid';
import { Networking } from '../../../../Network';
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
const websiteInfoScraperToolParams = [
{
diff --git a/src/client/views/nodes/chatbot/tools/WikipediaTool.ts b/src/client/views/nodes/chatbot/tools/WikipediaTool.ts
index 4fcffe2ed..f2dbf3cfd 100644
--- a/src/client/views/nodes/chatbot/tools/WikipediaTool.ts
+++ b/src/client/views/nodes/chatbot/tools/WikipediaTool.ts
@@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid';
import { Networking } from '../../../../Network';
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType } from '../types/tool_types';
const wikipediaToolParams = [
{
@@ -38,7 +38,7 @@ export class WikipediaTool extends BaseTool<WikipediaToolParamsType> {
return [
{
type: 'text',
- text: `<chunk chunk_id="${id}" chunk_type="text"> ${text} </chunk>`,
+ text: `<chunk chunk_id="${id}" chunk_type="url"> ${text} </chunk>`,
},
];
} catch (error) {