From a9ca0af9dc0a714f590f77aa680723a4666e4896 Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Fri, 12 Jul 2024 18:49:16 -0400 Subject: [PATCH] updated prompt --- src/backend/config/tools.py | 8 ++++---- src/backend/tools/minimap.py | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/backend/config/tools.py b/src/backend/config/tools.py index 77548595f1..48beb9e64c 100644 --- a/src/backend/config/tools.py +++ b/src/backend/config/tools.py @@ -33,7 +33,7 @@ class ToolName(StrEnum): Python_Interpreter = "Python_Interpreter" Calculator = "Calculator" Tavily_Internet_Search = "Internet_Search" - MiniMap = "MiniMap" + Minimap = "Minimap" ALL_TOOLS = { @@ -54,12 +54,12 @@ class ToolName(StrEnum): category=Category.DataLoader, description="Retrieves documents from Wikipedia using LangChain.", ), - ToolName.MiniMap: ManagedTool( - name=ToolName.MiniMap, + ToolName.Minimap: ManagedTool( + name=ToolName.Minimap, implementation=LangChainMinimapRetriever, parameter_definitions={ "query": { - "description": "Query for searching the news. It can be a topic, a named entities, or a quoted keyword.", + "description": "Query for searching the news. It can be a topic, a named entities, or a quoted keyword. Summarizations should be in the form of a bulleted list where each bullet point is its own core topic.", "type": "str", "required": True, } diff --git a/src/backend/tools/minimap.py b/src/backend/tools/minimap.py index 1ba5873d13..ddff0a4535 100644 --- a/src/backend/tools/minimap.py +++ b/src/backend/tools/minimap.py @@ -64,7 +64,7 @@ class MinimapAPIWrapper(BaseModel): max_retry: int = 5 # Default values for the parameters - top_k_results: int = 15 + top_k_results: int = 50 MAX_QUERY_LENGTH: int = 300 doc_content_chars_max: int = 2000 @@ -140,5 +140,9 @@ def is_available(cls) -> bool: def call(self, parameters: dict, **kwargs: Any) -> List[Dict[str, Any]]: query = parameters.get("query", "") results = self.client.run(query) - print(results) + + # remap `id` to `document_id` + for result in results: + result["document_id"] = result.pop("id") + return [dict(result) for result in results] \ No newline at end of file