debug
Browse files
agent.py
CHANGED
|
@@ -154,7 +154,7 @@ tools = [
|
|
| 154 |
]
|
| 155 |
|
| 156 |
# Build graph function
|
| 157 |
-
def build_graph(provider: str = "
|
| 158 |
"""Build the graph"""
|
| 159 |
# Load environment variables from .env file
|
| 160 |
if provider == "google":
|
|
@@ -184,6 +184,7 @@ def build_graph(provider: str = "google"):
|
|
| 184 |
def retriever(state: MessagesState):
|
| 185 |
"""Retriever node"""
|
| 186 |
similar_question = vector_store.similarity_search(state["messages"][0].content)
|
|
|
|
| 187 |
example_msg = HumanMessage(
|
| 188 |
content=f"Here I provide a similar question and answer for reference: \n\n{similar_question[0].page_content}",
|
| 189 |
)
|
|
@@ -208,7 +209,7 @@ def build_graph(provider: str = "google"):
|
|
| 208 |
if __name__ == "__main__":
|
| 209 |
question = "When was a picture of St. Thomas Aquinas first added to the Wikipedia page on the Principle of double effect?"
|
| 210 |
# Build the graph
|
| 211 |
-
graph = build_graph(provider="
|
| 212 |
# Run the graph
|
| 213 |
messages = [HumanMessage(content=question)]
|
| 214 |
messages = graph.invoke({"messages": messages})
|
|
|
|
| 154 |
]
|
| 155 |
|
| 156 |
# Build graph function
|
| 157 |
+
def build_graph(provider: str = "groq"):
|
| 158 |
"""Build the graph"""
|
| 159 |
# Load environment variables from .env file
|
| 160 |
if provider == "google":
|
|
|
|
| 184 |
def retriever(state: MessagesState):
|
| 185 |
"""Retriever node"""
|
| 186 |
similar_question = vector_store.similarity_search(state["messages"][0].content)
|
| 187 |
+
print(f"similar_question ={similar_question}")
|
| 188 |
example_msg = HumanMessage(
|
| 189 |
content=f"Here I provide a similar question and answer for reference: \n\n{similar_question[0].page_content}",
|
| 190 |
)
|
|
|
|
| 209 |
if __name__ == "__main__":
|
| 210 |
question = "When was a picture of St. Thomas Aquinas first added to the Wikipedia page on the Principle of double effect?"
|
| 211 |
# Build the graph
|
| 212 |
+
graph = build_graph(provider="groq")
|
| 213 |
# Run the graph
|
| 214 |
messages = [HumanMessage(content=question)]
|
| 215 |
messages = graph.invoke({"messages": messages})
|