Skip to content

Commit

Permalink
updated prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonSmith committed Jul 12, 2024
1 parent 5b6b45b commit a9ca0af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/backend/config/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ToolName(StrEnum):
Python_Interpreter = "Python_Interpreter"
Calculator = "Calculator"
Tavily_Internet_Search = "Internet_Search"
MiniMap = "MiniMap"
Minimap = "Minimap"


ALL_TOOLS = {
Expand All @@ -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,
}
Expand Down
8 changes: 6 additions & 2 deletions src/backend/tools/minimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]

0 comments on commit a9ca0af

Please sign in to comment.