Back
Version 11
23h ago
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
import { v4 as uuidv4 } from "https://esm.sh/uuid";
// Define the types for our agent system
type Schema = {
name: string;
description: string;
fields: {
name: string;
type: string;
description: string;
}[];
};
type ToolRequest = {
id?: string;
schema: Schema;
query: string;
parameters?: Record<string, any>;
};
type ToolResponse = {
success: boolean;
data?: any;
error?: string;
};
type ChatMessage = {
role: "user" | "agent" | "system" | "tool";
content: string;
};
type AgentResponse = {
actionType: "create_tool" | "use_tool" | "direct_response";
data-base.web.val.run
Updated: March 12, 2025