feat: solution for 'Повторный экзамен: Граф с рефлексией и доработкой'

This commit is contained in:
2026-07-01 15:53:59 +03:00
parent 6be5a5c753
commit 9dcbcc6619
4 changed files with 29 additions and 116 deletions
+2 -20
View File
@@ -1,25 +1,7 @@
from langgraph.graph import StateGraph
from src.graph import build_graph
from langchain_core.messages import HumanMessage
import langgraph
def main():
# Build and compile the graph
graph = build_graph()
app = graph.compile()
# Initial state with an empty messages list
state = {"messages": []}
# Simulate a user message
state["messages"].append(HumanMessage(content="Hello, agent!"))
# Run the graph
result = app.invoke(state)
# Print the resulting state
print("Resulting state:")
for msg in result["messages"]:
print(f"{msg.__class__.__name__}: {msg.content}")
print("Langgraph version:", langgraph.__version__)
if __name__ == "__main__":
main()