Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -38,24 +38,6 @@ with open("prompt.txt", "r", encoding="utf-8") as f:
|
|
| 38 |
# System message
|
| 39 |
sys_msg = SystemMessage(content=system_prompt)
|
| 40 |
|
| 41 |
-
# # build a retriever
|
| 42 |
-
# embeddings = HuggingFaceEmbeddings(
|
| 43 |
-
# model_name="sentence-transformers/all-mpnet-base-v2"
|
| 44 |
-
# ) # dim=768
|
| 45 |
-
# supabase: Client = create_client(
|
| 46 |
-
# SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY
|
| 47 |
-
# )
|
| 48 |
-
# vector_store = SupabaseVectorStore(
|
| 49 |
-
# client=supabase,
|
| 50 |
-
# embedding=embeddings,
|
| 51 |
-
# table_name="documents2",
|
| 52 |
-
# query_name="match_documents_2",
|
| 53 |
-
# )
|
| 54 |
-
# create_retriever_tool = create_retriever_tool(
|
| 55 |
-
# retriever=vector_store.as_retriever(),
|
| 56 |
-
# name="Question Search",
|
| 57 |
-
# description="A tool to retrieve similar questions from a vector store.",
|
| 58 |
-
# )
|
| 59 |
|
| 60 |
# Loading the assistant
|
| 61 |
chat = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
|
@@ -64,7 +46,6 @@ tools = [add,
|
|
| 64 |
substract,
|
| 65 |
multiply,
|
| 66 |
divide,
|
| 67 |
-
#DuckDuckGoSearchTool,
|
| 68 |
TavilySearchTool,
|
| 69 |
WikipediaSearchTool,
|
| 70 |
ArxivSearchTool,
|
|
@@ -73,7 +54,10 @@ tools = [add,
|
|
| 73 |
download_file_from_url,
|
| 74 |
extract_text_from_image,
|
| 75 |
analyze_csv_file,
|
| 76 |
-
analyze_excel_file
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
chat_with_tools = chat.bind_tools(tools)
|
| 79 |
|
|
|
|
| 38 |
# System message
|
| 39 |
sys_msg = SystemMessage(content=system_prompt)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
# Loading the assistant
|
| 43 |
chat = ChatGoogleGenerativeAI(model="gemini-2.0-flash", temperature=0)
|
|
|
|
| 46 |
substract,
|
| 47 |
multiply,
|
| 48 |
divide,
|
|
|
|
| 49 |
TavilySearchTool,
|
| 50 |
WikipediaSearchTool,
|
| 51 |
ArxivSearchTool,
|
|
|
|
| 54 |
download_file_from_url,
|
| 55 |
extract_text_from_image,
|
| 56 |
analyze_csv_file,
|
| 57 |
+
analyze_excel_file,
|
| 58 |
+
extract_video_id,
|
| 59 |
+
get_youtube_transcript
|
| 60 |
+
]
|
| 61 |
|
| 62 |
chat_with_tools = chat.bind_tools(tools)
|
| 63 |
|