raghavNCI
commited on
Commit
·
8114df9
1
Parent(s):
587894c
changes v14
Browse files- question.py +2 -2
question.py
CHANGED
@@ -75,7 +75,7 @@ async def ask_question(input: QuestionInput):
|
|
75 |
|
76 |
|
77 |
# Clean and parse keywords
|
78 |
-
query_string = "
|
79 |
encoded_query = quote(query_string)
|
80 |
gnews_url = f"https://gnews.io/api/v4/search?q={encoded_query}&lang=en&max=3&expand=content&token={GNEWS_API_KEY}"
|
81 |
|
@@ -91,7 +91,7 @@ async def ask_question(input: QuestionInput):
|
|
91 |
print("Fetched articles:", articles)
|
92 |
|
93 |
context = "\n\n".join([
|
94 |
-
article.get("
|
95 |
for article in articles
|
96 |
])[:1500]
|
97 |
|
|
|
75 |
|
76 |
|
77 |
# Clean and parse keywords
|
78 |
+
query_string = " AND ".join(f'"{kw}"' for kw in keywords)
|
79 |
encoded_query = quote(query_string)
|
80 |
gnews_url = f"https://gnews.io/api/v4/search?q={encoded_query}&lang=en&max=3&expand=content&token={GNEWS_API_KEY}"
|
81 |
|
|
|
91 |
print("Fetched articles:", articles)
|
92 |
|
93 |
context = "\n\n".join([
|
94 |
+
article.get("content") or ""
|
95 |
for article in articles
|
96 |
])[:1500]
|
97 |
|