0.1.4 • Published 9 months ago
@richgoblinlabs/gadgetgpt-sdk v0.1.4
GadgetGPT SDK
Official TypeScript SDK for interacting with the GadgetGPT API..
Installation
npm install @richgoblinlabs/gadgetgpt-sdkUsage
import GadgetGPTClient from "@richgoblinlabs/gadgetgpt-sdk";
const client = new GadgetGPTClient({
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 GadgetGPTClient constructor accepts the following configuration options:
apiKey(required): Your GadgetGPT API keyuserId(required): Your GadgetGPT user IDbaseUrl(optional): The base URL for API requests. Defaults to 'https://api.gadgetgpt.com'
Methods
sendMessage
Sends a message to a conversation and returns the updated chat history.
sendMessage(params: {
conversationId: string;
message: string;
}): Promise<ChatMessage[]>License
MIT