Spaces:
Runtime error
Runtime error
venkat-srinivasan-nexusflow
commited on
Update app.py
Browse filesUpdate app.py with the no-op support.
app.py
CHANGED
@@ -63,6 +63,12 @@ FUNCTIONS = [
|
|
63 |
description_function=lambda place_1, place_2: "Calculating distances",
|
64 |
explanation_function=lambda result: result[2],
|
65 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
Function(
|
67 |
name="get_recommendations",
|
68 |
short_description="Read recommendations",
|
@@ -510,7 +516,10 @@ class RavenDemo(gr.Blocks):
|
|
510 |
results_str += f"Result {idx + 1}\n{item_str}\n"
|
511 |
|
512 |
current_time = datetime.now().strftime("%b %d, %Y %H:%M:%S")
|
513 |
-
|
|
|
|
|
|
|
514 |
|
515 |
prompt = SUMMARY_MODEL_PROMPT.format(
|
516 |
current_location=current_location,
|
@@ -587,4 +596,4 @@ if __name__ == "__main__":
|
|
587 |
share=True,
|
588 |
allowed_paths=["logo.png", "NexusRaven.png"],
|
589 |
favicon_path="logo.png",
|
590 |
-
)
|
|
|
63 |
description_function=lambda place_1, place_2: "Calculating distances",
|
64 |
explanation_function=lambda result: result[2],
|
65 |
),
|
66 |
+
Function(
|
67 |
+
name="irrelevant_query",
|
68 |
+
short_description="The provided query does not relate to locations, reviews, or recommendations.",
|
69 |
+
description_function=lambda user_query : "Irrelevant query detected.",
|
70 |
+
explanation_function = lambda user_query : "Irrelevant query detected."
|
71 |
+
),
|
72 |
Function(
|
73 |
name="get_recommendations",
|
74 |
short_description="Read recommendations",
|
|
|
516 |
results_str += f"Result {idx + 1}\n{item_str}\n"
|
517 |
|
518 |
current_time = datetime.now().strftime("%b %d, %Y %H:%M:%S")
|
519 |
+
try:
|
520 |
+
current_location = self.tools.get_current_location()
|
521 |
+
except:
|
522 |
+
current_location = "Current location not found."
|
523 |
|
524 |
prompt = SUMMARY_MODEL_PROMPT.format(
|
525 |
current_location=current_location,
|
|
|
596 |
share=True,
|
597 |
allowed_paths=["logo.png", "NexusRaven.png"],
|
598 |
favicon_path="logo.png",
|
599 |
+
)
|