Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -148,23 +148,19 @@ supabase: Client = create_client(
|
|
148 |
)
|
149 |
|
150 |
# Initialize Supabase vector store
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
query_name="match_documents_langchain"
|
157 |
)
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
except Exception as e:
|
166 |
-
print(f"Error: {e}")
|
167 |
-
|
168 |
|
169 |
|
170 |
tools = [
|
|
|
148 |
)
|
149 |
|
150 |
# Initialize Supabase vector store
|
151 |
+
vector_store = SupabaseVectorStore(
|
152 |
+
client=supabase,
|
153 |
+
embedding=embeddings,
|
154 |
+
table_name="documents",
|
155 |
+
query_name="match_documents_langchain2"
|
|
|
156 |
)
|
157 |
|
158 |
+
# Create retriever tool
|
159 |
+
create_retriever_tool = create_retriever_tool(
|
160 |
+
retriever=vector_store.as_retriever(),
|
161 |
+
name="Question Search",
|
162 |
+
description="A tool to retrieve similar questions from a vector store."
|
163 |
+
)
|
|
|
|
|
|
|
164 |
|
165 |
|
166 |
tools = [
|