Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -11,6 +11,7 @@ from langchain_community.document_loaders import ArxivLoader
|
|
| 11 |
from langchain_community.vectorstores import SupabaseVectorStore
|
| 12 |
from langchain_core.messages import SystemMessage, HumanMessage
|
| 13 |
from langchain_community.retrievers import WikipediaRetriever
|
|
|
|
| 14 |
from langchain_core.tools import tool
|
| 15 |
from supabase.client import Client, create_client
|
| 16 |
|
|
@@ -75,6 +76,11 @@ vector_store = SupabaseVectorStore(
|
|
| 75 |
table_name="documents",
|
| 76 |
query_name="match_documents_langchain",
|
| 77 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
tools = [
|
| 80 |
wiki_search,
|
|
|
|
| 11 |
from langchain_community.vectorstores import SupabaseVectorStore
|
| 12 |
from langchain_core.messages import SystemMessage, HumanMessage
|
| 13 |
from langchain_community.retrievers import WikipediaRetriever
|
| 14 |
+
from langchain.tools.retriever import create_retriever_tool
|
| 15 |
from langchain_core.tools import tool
|
| 16 |
from supabase.client import Client, create_client
|
| 17 |
|
|
|
|
| 76 |
table_name="documents",
|
| 77 |
query_name="match_documents_langchain",
|
| 78 |
)
|
| 79 |
+
create_retriever_tool = create_retriever_tool(
|
| 80 |
+
retriever=vector_store.as_retriever(),
|
| 81 |
+
name="Question Search",
|
| 82 |
+
description="A tool to retrieve similar questions from a vector store.",
|
| 83 |
+
)
|
| 84 |
|
| 85 |
tools = [
|
| 86 |
wiki_search,
|