Spaces:
Sleeping
Sleeping
Luigi D'Addona
commited on
Commit
·
1a64e3b
1
Parent(s):
b5df7ff
Se la question prevede un video di youtube, suggerisce di utilizzare il tool 'get_youtube_transcript'
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import requests
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
import time
|
|
|
7 |
|
8 |
from langchain_core.messages import HumanMessage
|
9 |
|
@@ -92,6 +93,10 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
92 |
if file_name:
|
93 |
question_text += " file_name: {}, task:id: {} (use tool 'download_taskid_file' to get it)".format(file_name, task_id)
|
94 |
|
|
|
|
|
|
|
|
|
95 |
try:
|
96 |
# submitted_answer = agent(question_text)
|
97 |
messages = [HumanMessage(content = question_text)]
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
import time
|
7 |
+
import re
|
8 |
|
9 |
from langchain_core.messages import HumanMessage
|
10 |
|
|
|
93 |
if file_name:
|
94 |
question_text += " file_name: {}, task:id: {} (use tool 'download_taskid_file' to get it)".format(file_name, task_id)
|
95 |
|
96 |
+
# Se la question prevede un video di youtube, suggerisce di utilizzare il tool 'get_youtube_transcript'
|
97 |
+
if re.search('youtube', question_text, re.IGNORECASE):
|
98 |
+
question_text += ". use tool 'get_youtube_transcript' to analyze the video"
|
99 |
+
|
100 |
try:
|
101 |
# submitted_answer = agent(question_text)
|
102 |
messages = [HumanMessage(content = question_text)]
|