chore: genie chat corrections#4
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR introduces a session-based chat system with AI integration. It adds two Frappe DocTypes for persistent storage, completely redesigns the frontend with a three-panel layout, and implements backend endpoints for session/message management and Ollama-powered AI replies. ChangesSession-Based Chat with AI Integration
Sequence Diagram(s)sequenceDiagram
participant Client as Frontend Client
participant Page as Page Load
participant API as Backend Endpoints
participant Ollama as Ollama Server
participant DB as Frappe DocType Records
Page->>Client: Load NextGenie page
Client->>API: get_sessions()
API->>DB: Fetch user's Genie Chat Session records
DB-->>API: Session list
API-->>Client: Sessions with friendly dates
Client->>Client: Render session history panel
Client->>API: get_session_messages(session_id)
API->>DB: Fetch Genie Chat Message records
DB-->>API: Ordered message list
API-->>Client: Message history
Client->>Client: Render message bubbles, ready for input
Client->>Client: User types and sends message
Client->>Client: Append user bubble immediately
Client->>API: add_chat_message(session_id, 'User', text)
API->>DB: Insert new Genie Chat Message
DB-->>API: Confirmation
Client->>Client: Show typing indicator
Client->>API: get_ai_reply(session_id, message)
API->>DB: Load prior session messages
API->>Ollama: POST /api/generate (prompt with context)
alt AI Success
Ollama-->>API: Response text
API-->>Client: AI reply
Client->>Client: Hide typing, append bot bubble
Client->>API: add_chat_message(session_id, 'Genie', reply)
else Connection Error
Ollama--X API: Connection refused
API-->>Client: Error message
Client->>Client: Hide typing, append error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
Release Notes
New Features
Chores