say
function adds a user message to a thread and gets an agent’s response. It transforms str → str
, making it easy to:
- Store messages in a thread (“My name is Alice” → thread.messages += [user_msg, agent_msg])
- Get contextual responses (“What’s my name?” → “Your name is Alice”)
- Guide agent behavior (“You are a chef…” → “Let me suggest a recipe…”)
say
function is a convenient wrapper around Marvin’s task system - see Tasks for more details.
Usage
Add a message and get a response:Parameters
message
: The message to add to the threadinstructions
: Optional guidance for the agent’s responsesagent
: Optional custom agent to usethread
: Optional thread to store conversation historycontext
: Optional additional context