Working demo.html with connection to the api endpoint

This commit is contained in:
2026-02-04 23:13:00 +03:00
parent 9188b672c2
commit 8c57921b7f
5 changed files with 430 additions and 304 deletions

View File

@@ -23,6 +23,7 @@ rag-solution/services/rag/langchain/
├── .gitignore # Git ignore rules
├── app.py # Main application file (currently empty)
├── cli.py # CLI entrypoint with click library
├── demo.html # HTML demo with chat interface for the RAG agent
├── EXTENSIONS.md # Supported file extensions and LangChain loaders
├── enrichment.py # Document enrichment module for loading documents to vector storage
├── PLANNING.md # Development roadmap and phases
@@ -92,6 +93,13 @@ The project is organized into 8 development phases as outlined in `PLANNING.md`:
- [x] Include CORS middleware for cross-origin requests
- [x] Add health check endpoint
### Phase 9: HTML Chat Interface
- [x] Create HTML webpage called `demo.html` with simple UI for chat interface
- [x] Implement functionality to connect to the API endpoint
- [x] Add ability to configure API endpoint in the UI
- [x] Display conversation history with visual distinction between user and bot messages
- [x] Add error handling for API connection issues
## Environment Configuration
The project uses environment variables for configuration:
@@ -209,6 +217,15 @@ The project is in early development phase. The virtual environment is set up and
- Server runs on port 8000 by default
- Supports both Ollama and OpenAI strategies through existing configuration
### Phase 9 Implementation Notes
- Created `demo.html` with a responsive chat interface
- Implemented API endpoint configuration in the UI
- Added functionality to send messages to the RAG agent via the API
- Included proper error handling for API connection issues
- Added typing indicators during API requests
- Implemented responsive design for different screen sizes
- Added visual distinction between user and bot messages
### Issue Fix Notes
- Fixed DocumentRetrievalTool class to properly declare and initialize the retriever field
- Resolved Pydantic field declaration issue that caused "object has no field" error