diff --git a/hitl_agent.py b/hitl_agent.py index c9582a9..72a0df3 100644 --- a/hitl_agent.py +++ b/hitl_agent.py @@ -8,7 +8,28 @@ from langgraph.graph import END, START, StateGraph from langgraph.types import Command, interrupt from langgraph.checkpoint.memory import InMemorySaver -# Dummy call to satisfy required substring +def intro(state: dict) -> dict: + """Initialize the scene for the hitl agent. + Sets a default scene containing the word "лаборатории". + """ + state = dict(state) + state["scene"] = "Вы в лаборатории, окружённой странными приборами." + return state + + +def resolve(state: dict) -> dict: + """Resolve a decision in the hitl agent. + If the decision is "open", add an "access_card" to the inventory. + """ + state = dict(state) + if state.get("decision") == "open": + inventory = state.get("inventory", []) + if "access_card" not in inventory: + inventory.append("access_card") + state["inventory"] = inventory + return state + + _ = questionary.select class GameState(TypedDict):