Custom Functions
Extend default agent and write custom function calls
Basic Function Registration
from swift_web.controller.service import Controller
# Initialize the controller
controller = Controller()
@controller.action('Ask user for information')
def ask_human(question: str, display_question: bool) -> str:
return input(f'\n{question}\nInput: ')# ... then pass controller to the agent
agent = Agent(
task=task,
llm=llm,
controller=controller
)Browser-Aware Functions
Structured Parameters with Pydantic
Using Custom Actions with multiple agents
Last updated