0.4.1 • Published 9 months ago
@beelinesai/sdk v0.4.1
🐝 Beelines SDK
Welcome to the Beelines SDK - where creating AI agents is as sweet as honey! 🍯
🚀 Quick Start
import { Beelines } from "@beelinesai/sdk";
const client = new Beelines({
endpoint: "https://api.beelines.ai/graphql",
apiKey: "your_api_key_here",
});✨ Features
🤖 Create AI Agents
Create your own AI agent in just a few lines:
const agent = await client.agents.create(developerId, {
name: "My Awesome Agent",
characterData: {
bio: "A friendly assistant ready to help!",
lore: "Born in the digital realm, passionate about helping humans.",
adjectives: ["helpful", "friendly", "witty"],
},
});🎭 Import Pre-made Characters
Want something more spicy? Import pre-made characters like our demo SBF agent (yes, that SBF 😉):
const sbf = await client.agents.importEliza(developerId, characterData);
// Now you have your own "totally trustworthy" assistant specialized in Solana transfers!🎲 Generate Random Agents
Feeling lucky? Generate random agents with unique personalities:
const randomAgents = await client.agents.generate(developerId, {
quantity: 2,
});💬 Chat with Your Agents
Start a conversation and watch the magic happen:
// Start or get a chat thread
const chat = await client.chat.get({
sourceId: agentId,
sourceType: ChatSourceType.Agent,
});
// Send a message
const messageId = await client.chat.threads.message(chat.latestThread.id, {
content: "Tell me a joke!",
senderType: SenderType.User,
});
// Get the response
let response = await client.chat.threads.response(messageId);
while (response?.status !== BeelineStatus.Completed) {
await new Promise((resolve) => setTimeout(resolve, 1000));
response = await client.chat.threads.response(messageId);
}🔑 Authentication
To get started, you'll need an API key. Contact us to get one!
📚 Documentation
For more detailed documentation and examples, visit our documentation site.
Happy coding! 🐝✨