Skip to content

feat: Add AI Chatbot Feature with OpenAI Integration#919

Merged
neozhu merged 1 commit intomainfrom
feature/ai-chatbot
Nov 8, 2025
Merged

feat: Add AI Chatbot Feature with OpenAI Integration#919
neozhu merged 1 commit intomainfrom
feature/ai-chatbot

Conversation

@neozhu
Copy link
Copy Markdown
Owner

@neozhu neozhu commented Nov 8, 2025

Description

This PR introduces a new AI Chatbot feature integrated with OpenAI services, providing users with an interactive chat interface powered by GPT-4 models.

Changes

New Features

  • AI Chatbot Page (/ai/chatbot): A fully functional chat interface with ChatGPT-style UI
    • User and AI message bubbles with distinct styling
    • Real-time message streaming
    • Copy-to-clipboard functionality for AI responses
    • Auto-scroll to latest messages
    • Keyboard shortcuts (Ctrl+Enter to send)
    • Multi-line input support

Infrastructure Updates

  • OpenAI Integration:

    • Added Betalgo.OpenAI.Utilities and Betalgo.Ranul.OpenAI packages
    • Configured OpenAI service in dependency injection
    • Added OpenAIApiKey configuration to IAISettings interface and implementation
  • Configuration:

    • Updated appsettings.json with OpenAI API key placeholder
    • Updated docker-compose.yml to support OpenAI environment variables
  • Navigation:

    • Added Chatbot menu item to the navigation menu
    • Accessible to Admin and Users roles

UI Components

  • MudBlazor-based responsive design
  • User avatar display with profile picture support
  • Loading indicators during API calls
  • Error handling with user-friendly notifications

Technical Details

  • Framework: Blazor Server-Side
  • UI Library: MudBlazor
  • AI Provider: OpenAI (GPT-4o-mini)
  • Architecture: Clean Architecture pattern maintained

Testing

  • ✅ Compilation successful
  • ✅ UI renders correctly
  • ⚠️ Requires valid OpenAI API key for functionality testing

Configuration Required

Add your OpenAI API key to configuration:

"AISettings": {
  "OpenAIApiKey": "your-api-key-here"
}

Screenshots

The chat interface features:

  • Clean, modern design following ChatGPT styling
  • Responsive layout for mobile and desktop
  • User messages aligned right with primary color
  • AI messages aligned left with surface color
  • Smooth animations and transitions

@neozhu neozhu merged commit b3be849 into main Nov 8, 2025
3 checks passed
@neozhu neozhu deleted the feature/ai-chatbot branch November 9, 2025 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant