1.0.1 • Published 6 months ago
axisai v1.0.1
AxisAI SDK
AxisAI is an easy-to-use JavaScript SDK for interacting with the Axis AI Platform.
🚀 Installation
npm install axisai
📖 Usage
Import the SDK
const AxisAI = require("axisai");
Initialize the SDK
const axisAI = new AxisAI("your-api-key");
Start a Conversation
(async () => {
try {
const response = await axisAI.startConversation({
userId: "12345",
conversationId: "conv-67890",
email: "user@example.com",
name: "John Doe",
});
console.log(response);
} catch (error) {
console.error(error);
}
})();
Add a Message
(async () => {
try {
const response = await axisAI.addMessage({
conversationId: "conv-67890",
message: "Hello!",
role: "user",
});
console.log(response);
} catch (error) {
console.error(error);
}
})();
End a Conversation
(async () => {
try {
const response = await axisAI.endConversation({
conversationId: "conv-67890",
});
console.log(response);
} catch (error) {
console.error(error);
}
})();
🔧 Configuration
The SDK requires an API key, which you must pass when initializing it.
📜 Error Handling
Errors are automatically handled and returned as instances of Error
. You can wrap your calls in try/catch
blocks to handle them properly.
📄 License
This project is licensed under the MIT License.
📬 Contact
For support or questions, reach out at swapnil@getaxis.ai.