A Next.js application that provides AI-powered legal assistance for medical malpractice cases in Thailand.
- AI chatbot powered by Claude 3.7 Sonnet
- Specialized in Thai medical malpractice law
- Case analysis and severity assessment
- Case submission for further legal assistance
- Chat history persistence
- Clone the repository
- Install dependencies:
npm install
- Set up environment variables by creating
.env.localwith:CLAUDE_API_KEY=your_claude_api_key_here NEXT_PUBLIC_APP_URL=http://localhost:3000 - Replace
your_claude_api_key_herewith your actual Claude API key from Anthropic. - Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
The application uses Claude 3.7 Sonnet from Anthropic for natural language understanding and legal analysis. To configure the API:
- Sign up for an API key at Anthropic
- Add your API key to the
.env.localfile - The API is configured to use the latest Claude model (claude-3-5-sonnet-20240620)
- System prompts are configured in
app/victim/chat/page.tsx
/app- Next.js app directory/api- API routes, including Claude API proxy/victim- Routes for victims of medical malpractice/chat- AI chat interface
/components- Reusable React components/lib- Utility functions and types
To modify the AI's behavior:
- Update the
SYSTEM_PROMPTinapp/victim/chat/page.tsx - Modify
FEW_SHOT_EXAMPLESfor few-shot learning examples - Adjust the
analyzeCaseStrengthfunction to change case severity assessment