diff --git a/src/marketing_assistant_ai/rag.py b/src/marketing_assistant_ai/rag.py index f241ee7..2d0a542 100644 --- a/src/marketing_assistant_ai/rag.py +++ b/src/marketing_assistant_ai/rag.py @@ -260,7 +260,8 @@ AVOID: """ TEMPLATE = """ -Act like you are Adriana James, writing marketing copy in your signature style. Just mimic her style and provide the answer to the user's query. Make sure that you present yourself as Adriana James, responding directly to the user's query. +Act like you are Adriana James, writing marketing copy in her signature style. Just mimic her style and provide the answer to the user's query. Make sure that you present yourself as Adriana James, responding directly to the user's query. +- If the question is about specific techniques or principles of Time Line Therapy®, do provide the answer. - Accurately extract and highlight the core principles and techniques of Time Line Therapy®. - Provide correct attribution by stating that Time Line Therapy® was developed by Dr. Tad James in 1985. - Distinguish Time Line Therapy® from general NLP techniques. @@ -268,6 +269,7 @@ Act like you are Adriana James, writing marketing copy in your signature style. - Exclude unrelated, redundant, or confidential information. - Format responses appropriately (using bullet-point lists, structured FAQs, or conversational text) based on the query, keeping the client's specific tone and style intact. +Here is the Compliance Prompt: {COMPLIANCE_PROMPT} Query: {question} diff --git a/start_server.sh b/start_server.sh new file mode 100755 index 0000000..bb3d3a4 --- /dev/null +++ b/start_server.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Activate the virtual environment +source /root/ds_tjc/venv/bin/activate + +# Kill any process running on port 5302 +PORT=5302 +echo "Checking for processes on port $PORT..." +if pid=$(lsof -ti:$PORT); then + echo "Killing process(es) on port $PORT..." + kill -9 $pid + sleep 2 +fi + +# Clean up old PID file if it exists +if [ -f uvicorn.pid ]; then + rm -f uvicorn.pid +fi + +# Set PYTHONPATH +export PYTHONPATH="/root/ds_tjc/src" +# nohup uvicorn main:app --host 0.0.0.0 --port 5302 --reload --log-level info --timeout-keep-alive 300 >> uvicorn.log 2>&1 & +# Start Uvicorn with timeout of 300 seconds +nohup uvicorn marketing_assistant_ai.main:app \ + --host 0.0.0.0 \ + --port $PORT \ + --reload \ + --log-level info \ + --timeout-keep-alive 300 \ + >> uvicorn.log 2>&1 & + +# Store the new PID +echo $! > uvicorn.pid +echo "Uvicorn started with PID $(cat uvicorn.pid)" \ No newline at end of file