Dermadect is a comprehensive healthcare and educational platform that provides AI-powered healthcare assistance, health metrics tracking, and an educational game about human anatomy. This repository contains the OpenChat bot integration for Dermadect, allowing users to interact with the platform's features directly through chat.
The Dermadect ecosystem consists of two main components:
-
FastAPI Backend (
dermadect-oc-fastapi)- Handles core healthcare and educational functionality
- Manages AI interactions and game mechanics
- Processes health metrics and provides health tips
- Hosted at
https://dermadect-oc-fastapi.vercel.app
-
OpenChat Bot Integration (this repository)
- Provides chat interface for Dermadect services
- Implements OpenChat bot protocol
- Handles command execution and message routing
- Manages user interactions and responses
The Dermadect bot supports the following commands:
- Description: Get information about Dermadect bot and its commands
- Role: Participant
- Permissions: Text message access
- Parameters: None
- Description: Interactive anatomy game with 5 questions
- Role: Participant
- Permissions: Text message access
- Parameters:
message: Command or answer to question (required)- Example commands: "start game", "end game"
- Description: Interact with AI agents for healthcare queries
- Role: Participant
- Permissions: Text message access
- Parameters:
Message: Prompt for the AI agent (required)- Supports multi-line input
- Maximum length: 10000 characters
- Description: Get health tips and wellness information
- Role: Participant
- Permissions: Text message access
- Parameters: None
- Description: Get health-related jokes
- Role: Participant
- Permissions: Text message access
- Parameters: None
The bot follows the OpenChat bot protocol defined in bot_schema.json, which specifies:
- Command definitions
- Parameter types and constraints
- Permission requirements
- Response formats
Each command is implemented as a separate handler in the src/commands directory:
game.ts: Manages the anatomy game flowprompt.ts: Handles AI agent interactionshealth_tip.ts: Fetches health tips from the backendhealth_joke.ts: Retrieves health-related jokesping.ts: Basic connectivity check
The bot communicates with the FastAPI backend through REST endpoints:
- Health tips:
GET /health-tip - Health jokes:
GET /health-joke - Game commands:
POST /game/{user_id} - AI interactions:
POST /chat
- Node.js 14+
- npm or yarn
- OpenChat bot credentials
- Access to Dermadect FastAPI backend
- Clone the repository
- Install dependencies:
npm install
- Configure environment variables:
IDENTITY_PRIVATE=your_private_key OC_PUBLIC=your_public_key IC_HOST=your_ic_host STORAGE_INDEX_CANISTER=your_canister_id
- Development:
npm run dev
- Production:
npm run build npm run start
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.