From 1fe66ac0466635593b37a0b92e83c815d6b28f74 Mon Sep 17 00:00:00 2001 From: kimjaehyeon0101 <47347352-kimjaehyeon0101@users.noreply.replit.com> Date: Wed, 15 Oct 2025 02:13:09 +0000 Subject: [PATCH] Add personalized AI chatbot for media outlets Implement AI chatbot functionality using Replit AI Integrations and OpenAI's GPT-5 model, storing chat history in a new `chatMessages` table. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/d35d7YU --- .replit | 8 ++++---- replit.md | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.replit b/.replit index e8a22e7..8826cfc 100644 --- a/.replit +++ b/.replit @@ -22,6 +22,10 @@ externalPort = 3002 localPort = 36309 externalPort = 5173 +[[ports]] +localPort = 37333 +externalPort = 8000 + [[ports]] localPort = 37413 externalPort = 5000 @@ -38,10 +42,6 @@ externalPort = 3003 localPort = 41425 externalPort = 6000 -[[ports]] -localPort = 41825 -externalPort = 6800 - [[ports]] localPort = 43349 externalPort = 3000 diff --git a/replit.md b/replit.md index 343f3cd..6dfc243 100644 --- a/replit.md +++ b/replit.md @@ -32,6 +32,7 @@ The system uses a PostgreSQL database with the following core entities: - **Comments**: User-generated content on articles - **Community Posts**: DC Inside-style forum posts for each media outlet with views, likes, and replies - **Community Replies**: Threaded replies to community posts +- **Chat Messages**: AI chatbot conversation history per user per media outlet ## Authentication & Authorization - **Multi-tier Access**: Three user roles with escalating permissions @@ -47,6 +48,7 @@ The system uses a PostgreSQL database with the following core entities: - **Content Management**: Rich article creation, editing, and deletion with media outlet administration - **DC Inside-style Community**: Forum-style discussion boards for each media outlet with posts, replies, likes, and sorting options - **Community Features**: Post creation, threaded replies, view counts, like system, and multiple sort options (latest, views, likes, replies) +- **AI Chatbot**: Personalized AI assistant for each media outlet that adapts its personality based on outlet category (people/topics/companies), providing contextual conversations in Korean # External Dependencies @@ -68,6 +70,23 @@ The system uses a PostgreSQL database with the following core entities: - **React Hook Form**: Form handling with validation ## Third-party Integrations +- **Replit AI Integrations (OpenAI)**: GPT-5 model for AI chatbot functionality via Replit-managed API (no separate API key required) - **Kalshi API**: External prediction market data (referenced in user requirements) - **Image Services**: Unsplash for placeholder images and media content -- **Session Storage**: connect-pg-simple for PostgreSQL session management \ No newline at end of file +- **Session Storage**: connect-pg-simple for PostgreSQL session management + +# Recent Changes + +## January 15, 2025 - AI Chatbot Implementation +- **Feature**: Added personalized AI chatbot for each media outlet +- **Implementation**: + - Database: Created chatMessages table to store conversation history + - Backend: Implemented chatbot service using OpenAI GPT-5 via Replit AI Integrations + - Personality System: AI adapts based on outlet category: + * People: Speaks as the person themselves + * Topics: Acts as an expert on the topic + * Companies: Represents the company + - API: GET and POST endpoints for chat history and message sending + - Frontend: ChatbotModal component with scrollable chat interface + - Integration: Added Chat button to media outlet pages (authenticated users only) +- **Testing**: End-to-end test passed successfully with authentication flow and message exchange \ No newline at end of file