@base44/sdk
Version:
JavaScript SDK for Base44 API
24 lines (23 loc) • 1.16 kB
TypeScript
import { RoomsSocket } from "../utils/socket-utils.js";
import { AgentConversation, AgentMessage } from "./agents.types.js";
import { AxiosInstance } from "axios";
import { ModelFilterParams } from "../types.js";
export type AgentsModuleConfig = {
axios: AxiosInstance;
socket: ReturnType<typeof RoomsSocket>;
appId: string;
serverUrl?: string;
token?: string;
};
export declare function createAgentsModule({ axios, socket, appId, serverUrl, token, }: AgentsModuleConfig): {
getConversations: () => Promise<AgentConversation[]>;
getConversation: (conversationId: string) => Promise<AgentConversation | undefined>;
listConversations: (filterParams: ModelFilterParams) => Promise<AgentConversation[]>;
createConversation: (conversation: {
agent_name: string;
metadata?: Record<string, any>;
}) => Promise<AgentConversation>;
addMessage: (conversation: AgentConversation, message: AgentMessage) => Promise<AgentMessage>;
subscribeToConversation: (conversationId: string, onUpdate?: (conversation: AgentConversation) => void) => () => void;
getWhatsAppConnectURL: (agentName: string) => string;
};