Coool2 commited on
Commit
ca76aee
·
verified ·
1 Parent(s): a0ecced

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +7 -1
agent.py CHANGED
@@ -239,8 +239,14 @@ def create_rag_tool_fn(documents: List[Document], query: str = None) -> Union[Qu
239
 
240
  return rag_engine_tool
241
 
 
 
 
 
 
 
242
  information_retrieval_tool = FunctionTool.from_defaults(
243
- fn=create_rag_tool_fn,
244
  name="information_retrieval_tool",
245
  description=(
246
  "This is the BEST and OPTIMAL tool to query information from documents parsed from URLs or files. "
 
239
 
240
  return rag_engine_tool
241
 
242
+ def information_retrieval_fn (paths : List[str], query : str = None) -> Union[QueryEngineTool, str]:
243
+ docs = []
244
+ for path in paths :
245
+ docs.append(read_and_parse_content(path))
246
+ return create_rag_tool_fn(docs,query)
247
+
248
  information_retrieval_tool = FunctionTool.from_defaults(
249
+ fn=information_retrieval_fn,
250
  name="information_retrieval_tool",
251
  description=(
252
  "This is the BEST and OPTIMAL tool to query information from documents parsed from URLs or files. "