Responds to a user message in a conversational way.This function uses a language model to process the user’s message and generate
an appropriate response, taking into account any specific instructions and
maintaining conversation history through the thread.Args:
message: The user’s message to respond to.
instructions: Optional additional instructions to guide the response.
Used to provide specific guidance about how to interpret or
respond to the message.
agent: Optional custom agent to use for the response. If not provided,
the default agent will be used.
thread: Optional thread for maintaining conversation context. Can be
either a Thread object or a string thread ID.
context: Optional dictionary of additional context to include in the task.
handlers: Optional list of handlers to use for the task.
Returns:
str: The assistant’s response to the user’s message.
Responds to a user message in a conversational way.This function uses a language model to process the user’s message and generate
an appropriate response, taking into account any specific instructions and
maintaining conversation history through the thread.Args:
message: The user’s message to respond to.
instructions: Optional additional instructions to guide the response.
Used to provide specific guidance about how to interpret or
respond to the message.
agent: Optional custom agent to use for the response. If not provided,
the default agent will be used.
thread: Optional thread for maintaining conversation context. Can be
either a Thread object or a string thread ID.
context: Optional dictionary of additional context to include in the task.
handlers: Optional list of handlers to use for the task.
Returns:
str: The assistant’s response to the user’s message.Parent Module:fns