Prudvireddy commited on
Commit
b951a7d
1 Parent(s): d256b9c

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +21 -1
tools.py CHANGED
@@ -269,4 +269,24 @@ def create_video_from_images_and_audio(images, speeches, zoom_factor=1.2):
269
  # except Exception as e:
270
  # print(f"Error removing file {temp_file}: {e}")
271
 
272
- return "./final_video.mp4"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  # except Exception as e:
270
  # print(f"Error removing file {temp_file}: {e}")
271
 
272
+ return "./final_video.mp4"
273
+
274
+ class WikiInputs(BaseModel):
275
+ """Inputs to the wikipedia tool."""
276
+ query: str = Field(description="query to look up in Wikipedia, should be 3 or less words")
277
+
278
+ api_wrapper = WikipediaAPIWrapper(top_k_results=3)#, doc_content_chars_max=100)
279
+
280
+ wiki_tool = WikipediaQueryRun(
281
+ name="wiki-tool",
282
+ description="{query:'input here'}",
283
+ args_schema=WikiInputs,
284
+ api_wrapper=api_wrapper,
285
+ return_direct=True,
286
+ )
287
+
288
+ wiki = Tool(
289
+ name = 'wikipedia',
290
+ func = wiki_tool.run,
291
+ description= "{query:'input here'}"
292
+ )