diff --git a/app/Dockerfile b/app/Dockerfile index d3cfd57..4d4ccb9 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -33,6 +33,9 @@ COPY requirements.txt /app/ # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt +# Preload the sentence transformer model to cache +RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" + # Copy the application source code into the container COPY . /app diff --git a/app/app.py b/app/app.py index 61af9c6..958908d 100644 --- a/app/app.py +++ b/app/app.py @@ -193,7 +193,7 @@ def handle_webhook(): # Fetch the conversation and generate an LLM answer for the user logger.info(f"Detected a user reply in conversation {conversation_id}; fetching an answer from LLM...") - answer_intercom_conversation(app.rag_system, conversation_id) + answer_intercom_conversation(app.rag_system, conversation_id, topic) else: logger.info(f"Received webhook for unsupported topic: {topic}; no action taken.")