Spaces:
Sleeping
Sleeping
Update gemini_agent.py
Browse files- gemini_agent.py +1 -1
gemini_agent.py
CHANGED
|
@@ -236,7 +236,7 @@ Provide only the direct answer. If it's a quote, give just the quoted text. If i
|
|
| 236 |
|
| 237 |
# Prepend context to the prompt if available and likely relevant
|
| 238 |
def is_good_context(context):
|
| 239 |
-
return context and not any(x in context.lower() for x in ["not found", "no results", "does not contain
|
| 240 |
if wiki_context and is_good_context(wiki_context):
|
| 241 |
if "first name" in question.lower():
|
| 242 |
prompt = f"Based on this Wikipedia information, find the actor who played Ray/Roman and identify what character they played in Magda M., then give only their first name:\n{wiki_context}\n\n{question}\n\nAnswer:"
|
|
|
|
| 236 |
|
| 237 |
# Prepend context to the prompt if available and likely relevant
|
| 238 |
def is_good_context(context):
|
| 239 |
+
return context and not any(x in context.lower() for x in ["not found", "no results", "does not contain", "disambiguation"])
|
| 240 |
if wiki_context and is_good_context(wiki_context):
|
| 241 |
if "first name" in question.lower():
|
| 242 |
prompt = f"Based on this Wikipedia information, find the actor who played Ray/Roman and identify what character they played in Magda M., then give only their first name:\n{wiki_context}\n\n{question}\n\nAnswer:"
|