How the reply is shown

A fuller trace

The box is the trace of the run. The last line is the answer.

Example

from praisonai import Agent

agent = Agent(instructions="Answer in one sentence.", output="verbose")
print(agent.start("What is a flow?"))

Try it Yourself

Example explained

  • output — verbose prints the trace as well as the answer.

A stream

A stream prints the answer in pieces as they arrive. end="" keeps the pieces on one line.

Example

from praisonai import Agent

agent = Agent(instructions="You are a helpful assistant")
for chunk in agent.start("Explain streaming in one sentence", stream=True):
    print(chunk, end="", flush=True)
print()

Try it Yourself

Example explained

  • stream — True yields pieces. False returns the whole answer.

Reference: documentation