Spaces:
Running
Running
| """update_trust โ ์ ๋ขฐ์ถ ์ด๋ (1ํ์ผ = 1ํจ์, FunctionTool). | |
| session.state์ ์จ์ ๊ฐ๋ง ์์ง์ธ๋ค. ์์ ์ปค๋ฐ์ ํฌ์ผ ์ข ๋ฃ ์ | |
| services/pocket.py โ services/state.py ๊ฒฝ๋ก๊ฐ ๋ด๋น (์ด์ค ๊ฐฑ์ ๊ธ์ง). | |
| """ | |
| from google.adk.tools import ToolContext | |
| from engine.services.state import AXIS_DELTA | |
| def update_trust(direction: str, tool_context: ToolContext) -> dict: | |
| """์ ์ ๋ฐํ ํ๋ ํ์ ์ ๋ฐ๋ผ ์ ๋ขฐ์ถ์ ๋ฏผ๋ค. | |
| Args: | |
| direction: "trust" | "doubt" | "neutral" | |
| """ | |
| if direction == "trust": | |
| tool_context.state["hidden_trust"] = tool_context.state.get("hidden_trust", 0) + AXIS_DELTA | |
| elif direction == "doubt": | |
| tool_context.state["hidden_doubt"] = tool_context.state.get("hidden_doubt", 0) + AXIS_DELTA | |
| elif direction != "neutral": | |
| return {"status": "error", "message": f"unknown direction: {direction}"} | |
| turns = tool_context.state.get("pocket_axis_calls", 0) + 1 | |
| tool_context.state["pocket_axis_calls"] = turns | |
| return {"status": "ok", "direction": direction} | |