makima-ts v1.0.0-alpha.4
Makima TypeScript SDK
The Makima TypeScript SDK provides a simple way to interact with the Makima Agent Framework API. This SDK allows you to manage agents, threads, and tools programmatically in your TypeScript or JavaScript projects.
Installation
Install the Makima SDK using npm:
npm install makima-ts
Basic Usage
Here's a quick example of how to use the Makima SDK:
import { Makima } from 'makima-ts';
const makima = new Makima('YOUR_MAKIMA_API_URL');
async function example() {
// Create a new agent
const newAgent = await makima.agent.create({
name: 'my-agent',
description: 'A helpful AI assistant',
prompt: 'You are a helpful AI assistant. Provide concise and accurate responses.',
primaryModel: 'openai/gpt-4o-mini',
fallbackModels: [],
});
// Create a new thread
const newThread = await makima.thread.create({
id: 'my-thread',
platform: 'api',
agentName: 'my-agent',
});
// Chat with the agent
const chatResponse = await makima.thread.chat('my-thread', {
message: {
role: 'human',
content: 'Hello, how are you?',
name: 'user',
},
});
console.log('Chat Response:', chatResponse);
}
example().catch(console.error);
Key Features
The Makima SDK provides methods to:
- Manage Agents: Create, update, delete, and retrieve agents
- Handle Threads: Create, delete, and manage conversation threads
- Interact with Tools: Create, update, delete, and manage tools
- Perform Chat Inference: Send messages and receive responses from agents
API Reference
Agents
makima.agent.create(agentData)
: Create a new agentmakima.agent.getAll()
: Retrieve all agentsmakima.agent.get(agentName)
: Get a specific agent by namemakima.agent.update(agentName, updateData)
: Update an agentmakima.agent.delete(agentName)
: Delete an agentmakima.agent.addTool(agentName, toolName)
: Add a tool to an agentmakima.agent.removeTool(agentName, toolName)
: Remove a tool from an agent
Threads
makima.thread.create(threadData)
: Create a new threadmakima.thread.getAll()
: Retrieve all threadsmakima.thread.get(threadId)
: Get a specific thread by IDmakima.thread.delete(threadId)
: Delete a threadmakima.thread.chat(threadId, messageData)
: Send a message to a threadmakima.thread.getMessages(threadId)
: Retrieve messages from a thread
Tools
makima.tool.create(toolData)
: Create a new toolmakima.tool.getAll()
: Retrieve all toolsmakima.tool.get(toolName)
: Get a specific tool by namemakima.tool.update(toolName, updateData)
: Update a toolmakima.tool.delete(toolName)
: Delete a tool
Development Status
Please note that this SDK is in early alpha stage and is actively being developed. APIs and features may change, and some functionality might be unstable. We recommend using this in non-production environments until we reach a stable release.
Contributing
We welcome contributions to the Makima TypeScript SDK! Please see our Contributing Guide for details on how to get started.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
8 months ago
8 months ago
8 months ago
8 months ago