Node.JS SDK
A Node.js SDK for interacting with the KrosAI Agent APIs.
🚀 Installation
Install via npm:
or via yarn:
🛠️ Usage
Import the SDK:
Initialize the SDK:
✨ Basic Operations
1. Create an Agent
2. Create a Conversation
3. Send a Message
4. Get Conversation Messages
5. Create a Knowledge Base
6. Upload a Document to Knowledge Base
📚 API Reference
🧠 Agents
createAgent(request: CreateAgentRequest): Promise<Agent>
Create a new agent.
listAgents(): Promise<Agent[]>
List all agents.
getAgent(agentId: string): Promise<Agent>
Retrieve details of a specific agent.
updateAgent(agentId: string, request: UpdateAgentRequest): Promise<Agent>
Update an existing agent.
deleteAgent(agentId: string): Promise<void>
Delete an agent.
💬 Conversations
createConversation(request: CreateConversationRequest): Promise<Conversation>
Create a new conversation for an agent.
listConversations(agentId: string): Promise<Conversation[]>
List all conversations for a specific agent.
getConversation(conversationId: string): Promise<Conversation>
Retrieve details of a conversation.
getConversationMessages(conversationId: string): Promise<Message[]>
Get all messages within a conversation.
sendMessage(request: SendMessageRequest): Promise<Message>
Send a new message in a conversation.
📚 Knowledge Bases
createKnowledgeBase(request: CreateKnowledgeBaseRequest): Promise<KnowledgeBase>
Create a new knowledge base.
listKnowledgeBases(): Promise<KnowledgeBase[]>
List all knowledge bases.
uploadDocument(request: UploadDocumentRequest): Promise<Document>
Upload a document to a knowledge base.
listDocuments(knowledgeBaseId: string): Promise<Document[]>
List all documents in a specific knowledge base.
Last updated