chore: update something
Browse files
app.py
CHANGED
|
@@ -483,7 +483,9 @@ def generate_chat(
|
|
| 483 |
and len(references) > 0
|
| 484 |
):
|
| 485 |
formatted_references = f"Analyze the provided references, extract relevant information to provide accurate and objective feedback. This reference information may include: conversation context, assistant or user memories, reasoning guides, problem-solving suggestions, assistant rules, etc.\nIf the reference is not relevant, ignore it. Try to have a balanced approach, avoiding over-reliance on the documentation."
|
| 486 |
-
formatted_references += "\n\n" +
|
|
|
|
|
|
|
| 487 |
conversation.append(
|
| 488 |
{
|
| 489 |
"role": "refs",
|
|
@@ -560,11 +562,7 @@ def generate_chat(
|
|
| 560 |
|
| 561 |
# Search on Wikipedia if the search type is "wikipedia"
|
| 562 |
if search_type == "wikipedia":
|
| 563 |
-
gr.Info(
|
| 564 |
-
"Searching for information on the Wikipedia.",
|
| 565 |
-
duration=5,
|
| 566 |
-
visible=True,
|
| 567 |
-
)
|
| 568 |
document_references.extend(
|
| 569 |
search_with_wikipedia(query=keyword, language=language)
|
| 570 |
)
|
|
|
|
| 483 |
and len(references) > 0
|
| 484 |
):
|
| 485 |
formatted_references = f"Analyze the provided references, extract relevant information to provide accurate and objective feedback. This reference information may include: conversation context, assistant or user memories, reasoning guides, problem-solving suggestions, assistant rules, etc.\nIf the reference is not relevant, ignore it. Try to have a balanced approach, avoiding over-reliance on the documentation."
|
| 486 |
+
formatted_references += "\n\n" + json.dumps(
|
| 487 |
+
references, indent=2, ensure_ascii=False
|
| 488 |
+
)
|
| 489 |
conversation.append(
|
| 490 |
{
|
| 491 |
"role": "refs",
|
|
|
|
| 562 |
|
| 563 |
# Search on Wikipedia if the search type is "wikipedia"
|
| 564 |
if search_type == "wikipedia":
|
| 565 |
+
gr.Info("Searching for information on the Wikipedia.")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 566 |
document_references.extend(
|
| 567 |
search_with_wikipedia(query=keyword, language=language)
|
| 568 |
)
|