Skip to main content

start

Method
This is a method of the Agent class in the agent module.
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) -> Any

Parameters

prompt
str
The 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

Returns
Any
Generator 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 task

Uses

  • substitute_variables
  • isatty
  • time_module.time
  • chat
  • threading.Thread
  • chat_thread.start
  • Panel
  • Panel.fit
  • Markdown
  • Text

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 GitHub

praisonaiagents/agent/agent.py at line 6112