Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,7 @@ import time
|
|
| 18 |
import newspaper
|
| 19 |
from newspaper import Article
|
| 20 |
|
|
|
|
| 21 |
# Load environment variables from .env file
|
| 22 |
load_dotenv()
|
| 23 |
|
|
@@ -101,7 +102,7 @@ def call_llm(prompt, data, history,section_name):
|
|
| 101 |
f"History: {history}\n" \
|
| 102 |
f"Search Queries: {search_queries}\n" \
|
| 103 |
f"Original Prompt: {prompt}"
|
| 104 |
-
prompt = search_prompt
|
| 105 |
|
| 106 |
# Execute the model call
|
| 107 |
system_prompt = "You are an academic PhD proposal generator. Use the context and history to answer the user's question and fill in any missing fields."
|
|
|
|
| 18 |
import newspaper
|
| 19 |
from newspaper import Article
|
| 20 |
|
| 21 |
+
max_prompt_lenth=6000
|
| 22 |
# Load environment variables from .env file
|
| 23 |
load_dotenv()
|
| 24 |
|
|
|
|
| 102 |
f"History: {history}\n" \
|
| 103 |
f"Search Queries: {search_queries}\n" \
|
| 104 |
f"Original Prompt: {prompt}"
|
| 105 |
+
prompt = search_prompt[:max_prompt_lenth-1]
|
| 106 |
|
| 107 |
# Execute the model call
|
| 108 |
system_prompt = "You are an academic PhD proposal generator. Use the context and history to answer the user's question and fill in any missing fields."
|