Spaces:
Running
Running
| """mark_beat โ ๋ชฉํ ๋นํธ ๋ฌ์ฑ ๊ธฐ๋ก (1ํ์ผ = 1ํจ์, FunctionTool).""" | |
| from google.adk.tools import ToolContext | |
| def mark_beat(beat: str, tool_context: ToolContext) -> dict: | |
| """์ฅ๋ฉด ๋ชฉํ ๋นํธ๊ฐ ๋ฌ์ฑ๋์์์ ๊ธฐ๋กํ๋ค. | |
| Args: | |
| beat: ๋ฌ์ฑ๋ ๋นํธ์ ์งง์ ์๋ณ ๋ฌธ๊ตฌ | |
| """ | |
| hits = list(tool_context.state.get("pocket_beats_hit", [])) | |
| if beat not in hits: | |
| hits.append(beat) | |
| tool_context.state["pocket_beats_hit"] = hits | |
| return {"status": "ok", "beats_hit": hits} | |