A React-based chatbot interface to interact with AI agents from the dgenai.io platform. This project is an example usage of the dgenai.io API and is not intended for production use.
- Node.js >= 16
- npm or yarn
- A valid dgenai API key
- Clone this repository
git clone https://github.com/dgenai/sample-chat.git
cd sample-chat
- Install dependencies
npm install
# or
yarn install
- Set your API key
In AgentChatbot.jsx
, replace the placeholder:
const API_KEY = "";
with your actual API key:
const API_KEY = "your-api-key-here";
Run the development server:
npm start
# or
yarn start
Then open http://localhost:3000 in your browser.
All API endpoints are available and documented at:
👉 https://api.dgenai.io/swagger
This app uses:
GET /api/agents
— to retrieve the list of available agents.POST /api/agents/{agentId}/ask
— to send user input and receive agent responses.
All requests must include the X-Api-Key
HTTP header.
Example:
GET /api/agents
Host: api.dgenai.io
X-Api-Key: your-api-key-here
AgentChatbot.jsx
: Main component for the chatbot UI and logic.- Uses:
axios
for HTTP requests@mui/material
for styling and UIreact-markdown
to render agent responses
- Chat history is stored in component state (not persisted).
Contributions are not currently accepted for this sample project.
For access or API support, visit https://dgenai.io or contact your platform administrator.