start • AI Agent SDK
start: Start the agent interactively with verbose output.
start
Method
</div>
Start the agent interactively with verbose output.
Beginner-friendly execution. Defaults to verbose output with streaming when running in a TTY. Use this for interactive/terminal usage where you want to see output in real-time with rich formatting.
Signature
def start(prompt: str) -> AnyParameters
strThe input prompt to process. If not provided, uses the agent’s instructions as the task (useful when instructions already describe what the agent should do). **kwargs: Additional arguments: – stream (bool | None): Override streaming. None = auto-detect TTY – output (str): Output preset override (e.g., “silent”, “verbose”)
Returns
AnyGenerator yielding response chunks – If not streaming: The complete response as a string
Usage
# Minimal usage - instructions IS the task
agent = Agent(instructions="Research AI trends and summarize")
result = agent.start() # Uses instructions as task
# With explicit prompt (overrides/adds to instructions)
agent = Agent(instructions="You are a helpful assistant")
result = agent.start("What is 2+2?") # Uses prompt as taskUses
substitute_variablesisattytime_module.timechatthreading.Threadchat_thread.startPanelPanel.fitMarkdownText
Notes
Unlike .run() which is always silent (production use), .start() enables verbose output by default when in a TTY for beginner-friendly interactive use. Use .run() for programmatic/scripted usage.
Used By
Source
View on GitHubpraisonaiagents/agent/agent.py at line 6112