Update tools.py
Browse files
tools.py
CHANGED
@@ -124,7 +124,7 @@ tools = [
|
|
124 |
from langgraph.graph import StateGraph
|
125 |
from langgraph.graph.message import MessagesState
|
126 |
|
127 |
-
def build_graph(
|
128 |
"""Build the LangGraph with CSV-based vector store and tools."""
|
129 |
|
130 |
# Initialize CSV vector store
|
@@ -137,7 +137,7 @@ def build_graph(provider: str = "groq", csv_file_path: str = "embeddings.csv"):
|
|
137 |
|
138 |
llm = HuggingFaceEndpoint(
|
139 |
endpoint_url="https://api.endpoints.huggingface.co/v1/completions",
|
140 |
-
huggingfacehub_api_token="
|
141 |
model_kwargs={"max_tokens": 512}
|
142 |
)
|
143 |
|
@@ -183,7 +183,7 @@ if __name__ == "__main__":
|
|
183 |
question = "When was a picture of St. Thomas Aquinas first added to the Wikipedia page on the Principle of double effect?"
|
184 |
|
185 |
# Build the graph (you'll need to provide the path to your CSV file)
|
186 |
-
graph = build_graph(
|
187 |
|
188 |
# Run the graph
|
189 |
messages = [HumanMessage(content=question)]
|
|
|
124 |
from langgraph.graph import StateGraph
|
125 |
from langgraph.graph.message import MessagesState
|
126 |
|
127 |
+
def build_graph(csv_file_path: str = "embedding_database.csv"):
|
128 |
"""Build the LangGraph with CSV-based vector store and tools."""
|
129 |
|
130 |
# Initialize CSV vector store
|
|
|
137 |
|
138 |
llm = HuggingFaceEndpoint(
|
139 |
endpoint_url="https://api.endpoints.huggingface.co/v1/completions",
|
140 |
+
huggingfacehub_api_token="inference",
|
141 |
model_kwargs={"max_tokens": 512}
|
142 |
)
|
143 |
|
|
|
183 |
question = "When was a picture of St. Thomas Aquinas first added to the Wikipedia page on the Principle of double effect?"
|
184 |
|
185 |
# Build the graph (you'll need to provide the path to your CSV file)
|
186 |
+
graph = build_graph(csv_file_path="embedding_database.csv")
|
187 |
|
188 |
# Run the graph
|
189 |
messages = [HumanMessage(content=question)]
|