Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -95,7 +95,7 @@ def generate_search_summary(search_results, document_titles, query):
|
|
95 |
relevance_scores = [float(doc.get("score", 0)) for doc in search_results]
|
96 |
|
97 |
summary_prompt = f"""
|
98 |
-
Generate a concise 1-3 sentence summary for the search results found:
|
99 |
- User Query: "{query}"
|
100 |
- Matching Documents: {num_results} found
|
101 |
- Titles: {", ".join(set(doc_titles))}
|
@@ -103,6 +103,7 @@ def generate_search_summary(search_results, document_titles, query):
|
|
103 |
- Relevance Scores (0-1): {relevance_scores}
|
104 |
Provide a clear, user-friendly summary with an action suggestion.
|
105 |
If scores are low but the documents are from the same title no need to comment on the scores.
|
|
|
106 |
"""
|
107 |
|
108 |
llm = ChatOpenAI(model="gpt-4", openai_api_key=openai.api_key, temperature=0.5)
|
|
|
95 |
relevance_scores = [float(doc.get("score", 0)) for doc in search_results]
|
96 |
|
97 |
summary_prompt = f"""
|
98 |
+
Generate a concise 1-3 sentence summary for the document search results found:
|
99 |
- User Query: "{query}"
|
100 |
- Matching Documents: {num_results} found
|
101 |
- Titles: {", ".join(set(doc_titles))}
|
|
|
103 |
- Relevance Scores (0-1): {relevance_scores}
|
104 |
Provide a clear, user-friendly summary with an action suggestion.
|
105 |
If scores are low but the documents are from the same title no need to comment on the scores.
|
106 |
+
If only one result that means there's is only one relevant document. Doesn't meant there are only {num_results} pages
|
107 |
"""
|
108 |
|
109 |
llm = ChatOpenAI(model="gpt-4", openai_api_key=openai.api_key, temperature=0.5)
|