Skip to Content
TensorPass
Reference@tensorpass/aiconnect

@tensorpass/aiconnect

Every public export of @tensorpass/aiconnect, the site's connection to the visitor's AI, the fetch for AI SDKs, the tool loop and the MCP tool source, in four pages with their types generated from the source.

@tensorpass/aiconnect is the site's side of AI Connect, without any framework. It exports the AiConnect client, the McpToolSource class, the runConversation and finalAnswer functions, the chat content helpers, WalletRequestError, and the types they share with AI Wallet.

import {
  AiConnect, McpToolSource, WalletRequestError, contentParts, dataUrl, finalAnswer, inlineData, runConversation, textOf,
} from '@tensorpass/aiconnect';
import type {
  ChatEvent, ChatMessage, ChatResponse, ChatStart, ConnectionState, ContentPart, GenerationHint, JsonSchema, ToolSource,
  Usage, UserMessage, WalletChatParams, WalletLink, WalletProvider,
} from '@tensorpass/aiconnect';

The reference is in four pages, each with the tables of its exports, generated from the package's TypeScript source each time the docs are built:

PageWhat it documents
The clientAiConnect, ConnectionState, SdkOptions, WalletFetch, WalletRequestError, McpToolSource
ConversationsrunConversation, ConversationOptions, ConversationHooks, finalAnswer, the chat content helpers
Chat, tool and generation typesthe messages and their content parts, ToolDefinition, ToolSource, JsonSchema, GenerationOptions, ToolChoice, ResponseFormat
Sessions and the walletProviderSession, ChatRequest, ChatStart, ChatResponse, FinishReason, Usage, WalletLink, WalletProvider, ChatEvent