mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-07 04:35:58 -10:00
17 lines
525 B
Python
17 lines
525 B
Python
# praisonai: skip=true
|
|
"""HTTP Approval — serve a local web dashboard for tool approvals."""
|
|
|
|
from praisonaiagents import Agent
|
|
from praisonai.bots import HTTPApproval
|
|
|
|
agent = Agent(
|
|
name="assistant",
|
|
instructions="Help users with system tasks",
|
|
tools=["execute_command"],
|
|
approval=HTTPApproval(host="127.0.0.1", port=8899),
|
|
)
|
|
|
|
# When a tool needs approval, open http://127.0.0.1:8899/approve/<request_id>
|
|
# in your browser and click Approve or Deny.
|
|
agent.start("List the files in the current directory")
|