0.1.8 • Published 7 months ago
@richgoblinlabs/goblinagent-sdk v0.1.8
GoblinAgent SDK
Official TypeScript SDK for interacting with the GoblinAgent API..
Installation
npm install @richgoblinlabs/goblinagent-sdkUsage
import { GoblinAgentClient } from "@richgoblinlabs/goblinagent-sdk";
const client = new GoblinAgentClient({
apiKey: "your_api_key",
userId: "your_user_id",
baseUrl: "https://your-deployment-url.vercel.app", // Optional
});
// Send a message and return the response
const responseMessage = await client.sendMessage({
conversationId: "conversation_id",
message: "Hello, world!",
});API Reference
Configuration
The GoblinAgentClient constructor accepts the following configuration options:
apiKey(required): Your GoblinAgent API keyuserId(required): Your GoblinAgent user IDbaseUrl(optional): The base URL for API requests. Defaults to 'https://goblin-agent.vercel.app'
Methods
sendPrompt
Sends a prompt to a conversation and returns the updated chat history.
sendPrompt(params: {
conversationId: string;
prompt: string;
}): Promise<string>License
MIT