Skip to content

added corpus api and main.py

Ananya Krishna requested to merge main-and-corpus into main
  • main.py This file is the central hub of your backend. It's an API server that defines all the endpoints (like /upload/ and /chat/). It acts as a router, directing incoming requests to the right functions and ensuring data is correctly formatted before being processed by other services.

  • services/corpus_api.py This file is your project's communication layer. It's a specialized client that handles all interaction with the external Corpus API. It securely manages your API token and formats your data so it can be successfully sent to and received from the external service.

  • services/vector_store.py This file is the AI's memory. It manages an in-memory vector database that stores all the text from your uploaded documents as numerical embeddings. When a user asks a question, this file searches the database for the most relevant information to help the chatbot generate an accurate answer.

Merge request reports

Loading