0.1.3 • Published 7 months ago
@sainthoodlabs/agentsaint-sdk v0.1.3
Agent Saint SDK
Official TypeScript SDK for interacting with the Agent Saint API.
Installation
npm install @sainthoodlabs/agentsaint-sdkUsage
import { AgentSaintClient } from "@sainthoodlabs/agentsaint-sdk";
const client = new AgentSaintClient({
apiKey: "your_api_key",
userId: "your_user_id",
baseUrl: "https://your-deployment-url.vercel.app", // Optional
});
// Send a message to a specific agent (creates a new session by default)
const responseMessage = await client.sendPrompt({
agentId: "agent_id",
prompt: "Hello, world!",
});
// Send a message to a specific session
const sessionResponse = await client.sendPrompt({
agentId: "agent_id",
sessionId: "session_id", // Optional - will create a new session if not provided
prompt: "Continue our conversation",
});API Reference
Configuration
The AgentSaintClient constructor accepts the following configuration options:
apiKey(required): Your Agent Saint API keyuserId(required): Your Agent Saint user IDbaseUrl(optional): The base URL for API requests. Defaults to 'https://agentsaint.com'
Methods
sendPrompt
Sends a prompt to a conversation and returns the updated chat history.
sendPrompt(params: {
agentId: string;
sessionId?: string; // Optional - specifies which session to use
prompt: string;
}): Promise<string>License
MIT