nxtlinq-ai-agent-sdk
v1.0.2
Published
Nxtlinq AI Agent SDK for React applications
Readme
Nxtlinq AI Agent SDK
This is an SDK for integrating Nxtlinq AI Agent into React applications.
Installation
npm install nxtlinq-ai-agent-sdkUsage
import { ChatBot } from 'nxtlinq-ai-agent-sdk';
function App() {
const handleToolUse = async (toolUse) => {
// Handle tool calls
console.log('Tool use:', toolUse);
};
return (
<ChatBot
apiHost="https://api.example.com"
projectId="your-project-id"
onToolUse={handleToolUse}
quickResponses={[
{ text: "Hello, how can you help me?", autoSend: true },
{ text: "I want to add a new member", autoSend: true }
]}
/>
);
}Props
| Property | Type | Required | Description | |----------|------|----------|-------------| | apiHost | string | Yes | AI Agent API host address | | projectId | string | Yes | Project ID | | onToolUse | (toolUse: any) => Promise | No | Callback function for handling tool calls | | quickResponses | Array<{ text: string; autoSend: boolean }> | No | Quick response button configuration |
Features
- Chat interface
- Quick response buttons
- Tool call support
- Automatic scroll to latest message
- Responsive design
- Support for custom tool processing
Dependencies
- React 18+
- Next.js 14+
- next-auth
License
ISC
