mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Adds the always-enabled _goal plugin with per-chat goal storage, WebUI goal strip, /goal slash command, and agent-facing goal tools. Includes command-picker integration, focused plugin tests, and the generated 256x256 thumbnail asset.
23 lines
582 B
Python
23 lines
582 B
Python
from __future__ import annotations
|
|
|
|
from helpers.tool import Response, Tool
|
|
from plugins._goal.helpers import goals
|
|
|
|
|
|
class CreateGoal(Tool):
|
|
async def execute(
|
|
self,
|
|
objective: str = "",
|
|
token_budget: int | None = None,
|
|
**kwargs,
|
|
) -> Response:
|
|
goal = goals.create_goal(
|
|
self.agent.context.id,
|
|
objective,
|
|
created_by="model",
|
|
token_budget=token_budget,
|
|
)
|
|
return Response(
|
|
message=f"Goal created: {goal['objective']}",
|
|
break_loop=False,
|
|
)
|