interactive-chat / engine /tools /state /finish_pocket.py
Junhoee's picture
Upload 98 files
f646e0b verified
Raw
History Blame Contribute Delete
684 Bytes
"""finish_pocket โ€” ์ˆ˜๋ ด ํŒ์ • (1ํŒŒ์ผ = 1ํ•จ์ˆ˜, FunctionTool).
escalate๋กœ ์ด๋ฒˆ ํ„ด ํŒŒ์ดํ”„๋ผ์ธ์„ ์ข…๋ฃŒ ์‹ ํ˜ธ๋กœ ํ‘œ์‹œํ•œ๋‹ค. ์ตœ์ข… ์ „์ด๋Š”
services/pocket.py์˜ ์ฝ”๋“œ ์žฌ๊ฒ€์ฆ์„ ๊ฑฐ์ณ์•ผ๋งŒ ํ™•์ •๋œ๋‹ค (LLM ์ถœ๋ ฅ๋งŒ์œผ๋กœ ์ „์ด ๊ธˆ์ง€).
"""
from google.adk.tools import ToolContext
def finish_pocket(reason: str, tool_context: ToolContext) -> dict:
"""์žฅ๋ฉด ์ˆ˜๋ ด์„ ์„ ์–ธํ•œ๋‹ค.
Args:
reason: "goal_reached" | "drift" | "stall"
"""
tool_context.state["pocket_converged"] = True
tool_context.state["pocket_converge_reason"] = reason
tool_context.actions.escalate = True
return {"status": "ok", "reason": reason}