Update tools.py
Browse files
tools.py
CHANGED
|
@@ -52,6 +52,7 @@ def wiki_search(query):
|
|
| 52 |
return wikipedia.summary(query, sentences=5)
|
| 53 |
|
| 54 |
def python_repl(code):
|
|
|
|
| 55 |
print(code)
|
| 56 |
try:
|
| 57 |
local_vars = {}
|
|
@@ -68,6 +69,7 @@ def get_youtube_transcript(url):
|
|
| 68 |
return transcript
|
| 69 |
|
| 70 |
def speech_recognition(path):
|
|
|
|
| 71 |
print(path)
|
| 72 |
r = sr.Recognizer()
|
| 73 |
with sr.AudioFile(path) as source:
|
|
@@ -79,6 +81,7 @@ def reverse_string(s):
|
|
| 79 |
return web_search(rs)
|
| 80 |
|
| 81 |
def query_image(path):
|
|
|
|
| 82 |
print(path)
|
| 83 |
import easyocr
|
| 84 |
|
|
@@ -91,6 +94,7 @@ def query_image(path):
|
|
| 91 |
return text
|
| 92 |
|
| 93 |
def query_video(path):
|
|
|
|
| 94 |
print(path)
|
| 95 |
return "Video analysis not implemented yet"
|
| 96 |
|
|
|
|
| 52 |
return wikipedia.summary(query, sentences=5)
|
| 53 |
|
| 54 |
def python_repl(code):
|
| 55 |
+
code = "AkylaiBva/Final_Assignment_Template_AB/"+code
|
| 56 |
print(code)
|
| 57 |
try:
|
| 58 |
local_vars = {}
|
|
|
|
| 69 |
return transcript
|
| 70 |
|
| 71 |
def speech_recognition(path):
|
| 72 |
+
path = "AkylaiBva/Final_Assignment_Template_AB/"+ path
|
| 73 |
print(path)
|
| 74 |
r = sr.Recognizer()
|
| 75 |
with sr.AudioFile(path) as source:
|
|
|
|
| 81 |
return web_search(rs)
|
| 82 |
|
| 83 |
def query_image(path):
|
| 84 |
+
path = "AkylaiBva/Final_Assignment_Template_AB/"+ path
|
| 85 |
print(path)
|
| 86 |
import easyocr
|
| 87 |
|
|
|
|
| 94 |
return text
|
| 95 |
|
| 96 |
def query_video(path):
|
| 97 |
+
path = "AkylaiBva/Final_Assignment_Template_AB/"+path
|
| 98 |
print(path)
|
| 99 |
return "Video analysis not implemented yet"
|
| 100 |
|