Spaces:
Runtime error
Runtime error
baixianger commited on
Commit ·
3839c42
1
Parent(s): 66a348b
debug
Browse files12 unmodified lines13141516171892 unmodified lines11111211311411511611711811912012112212312412512613 unmodified lines14014114214314414516 unmodified lines16216316416516616716812 unmodified linesfrom langchain_community.vectorstores import SupabaseVectorStorefrom langchain_core.messages import SystemMessage, HumanMessagefrom langchain_core.tools import toolfrom supabase.client import Client, create_clientload_dotenv()92 unmodified lines])return {"arvix_results": formatted_search_docs}tools = [multiply,add,subtract,divide,modulus,wiki_search,web_search,arvix_search,]# load the system prompt from the filewith open("system_prompt.txt", "r", encoding="utf-8") as f:13 unmodified linestable_name="documents",query_name="match_documents_langchain",)# Build graph functiondef build_graph(provider: str = "groq"):16 unmodified lineselse:raise ValueError("Invalid provider. Choose 'google', 'groq' or 'huggingface'.")# Bind tools to LLMllm_with_tools = llm.bind_tools(tools, tool_choice="Question Search")# Nodedef assistant(state: MessagesState):12 unmodified lines1314151617181992 unmodified lines11211311411511611711813 unmodified lines13213313413513613713813914014114214314414514614714814915015115215315415516 unmodified lines17217317417517617717812 unmodified linesfrom langchain_community.vectorstores import SupabaseVectorStorefrom langchain_core.messages import SystemMessage, HumanMessagefrom langchain_core.tools import toolfrom langchain.tools.retriever import create_retriever_toolfrom supabase.client import Client, create_clientload_dotenv()92 unmodified lines])return {"arvix_results": formatted_search_docs}# load the system prompt from the filewith open("system_prompt.txt", "r", encoding="utf-8") as f:13 unmodified linestable_name="documents",query_name="match_documents_langchain",)create_retriever_tool = create_retriever_tool(retriever=vector_store.as_retriever(),name="Question Search",description="A tool to retrieve similar questions from a vector store.",)tools = [multiply,add,subtract,divide,modulus,wiki_search,web_search,arvix_search,]# Build graph functiondef build_graph(provider: str = "groq"):16 unmodified lineselse:raise ValueError("Invalid provider. Choose 'google', 'groq' or 'huggingface'.")# Bind tools to LLMllm_with_tools = llm.bind_tools(tools)# Nodedef assistant(state: MessagesState):
agent.py+21-11