Skip to content

Conversation

@debabratamishra
Copy link
Owner

@debabratamishra debabratamishra commented Dec 29, 2025

📋 Description

  • Introduced dedicated conversation history
  • Introduced additional params Max Tokens and Temperature across Chat UI and RAG UI
  • Improved code quality following CodeQL checks

🔧 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Configuration or build changes
  • ♻️ Code refactoring (no functional changes, no API changes)
  • 🧪 Test changes

🚀 What's Changed

  • Introduced dedicated conversation history
  • Introduced additional params Max Tokens and Temperature across Chat UI and RAG UI
  • Improved code quality following CodeQL checks

🧪 Testing

  • Tested with Docker Hub images
  • Tested with build from source
  • Tested frontend functionality
  • Tested backend API endpoints
  • Tested RAG functionality
  • Tested with Ollama backend
  • Tested with vLLM backend

✅ Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have tested my changes locally
  • Any dependent changes have been merged and published

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces three major enhancements to the LLM interface: a conversation history database, configurable temperature and max_tokens parameters, and security improvements based on CodeQL recommendations.

Key Changes

  • Adds SQLite-based conversation persistence with create, load, delete, and search capabilities for both Chat and RAG interfaces
  • Implements temperature and max_tokens controls throughout the UI and API stack, giving users fine-grained control over response generation
  • Enhances security with filename sanitization, path traversal protection, ReDoS vulnerability fixes, and improved input validation

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
app/services/conversation_db.py New SQLite conversation database service with CRUD operations for conversations and messages
app/frontend/components/conversation_sidebar.py New sidebar component for managing conversation history with load/save/delete functionality
app/services/ollama.py Added max_tokens parameter support via num_predict option
app/services/rag_service.py Added temperature and max_tokens parameters to query method, improved JSON parsing with fallback
app/backend/models/api_models.py Added max_tokens field to ChatRequestEnhanced and temperature/max_tokens to RAGQueryRequestEnhanced
app/backend/api/chat.py Propagated max_tokens parameter through chat streaming endpoints
app/backend/api/rag.py Added file upload security with sanitization, size validation, and max_tokens support
app/frontend/pages/chat_page.py Integrated conversation sidebar, added max_tokens slider, updated labels
app/frontend/pages/rag_page.py Integrated conversation sidebar, added temperature/max_tokens sliders, updated labels
app/frontend/services/chat_service.py Added max_tokens parameter to all chat service methods
app/frontend/services/rag_service.py Added temperature and max_tokens parameters to stream_rag_query
app/frontend/components/streaming_handler.py Propagated temperature and max_tokens through streaming handlers
main.py Added comprehensive file upload security with sanitization and validation functions
app/services/vllm_service.py Fixed shell injection vulnerability, added PID validation
app/frontend/utils/text_processing.py Fixed ReDoS vulnerability with length-limited regex pattern
app/frontend/utils/text_processing_clean.py Fixed ReDoS vulnerability with length-limited regex pattern
streamlit_app.py Removed emoji decorators from page names for cleaner UI
README.md Updated feature list to remove emoji decorators and add generation controls
.github/workflows/docker-publish.yml Removed redundant semantic versioning patterns
app/services/init.py New exports for conversation database components
app/frontend/components/init.py Added conversation sidebar exports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

debabratamishra and others added 3 commits December 30, 2025 11:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@debabratamishra debabratamishra added the enhancement New feature or request label Dec 30, 2025
@debabratamishra debabratamishra merged commit fd5f593 into main Dec 30, 2025
4 checks passed
@debabratamishra debabratamishra deleted the feat/message_history branch January 1, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants