Execute a function within a trace context.
Creates a root "agent" span that contains all LLM calls and tool executions.
Output Auto-Extraction: If the function returns an object with common text fields
(text, content, message, output, response, result, answer),
the SDK automatically extracts that field for cleaner display.
Use outputKey to specify a custom field, or outputKey: false to disable.
Execute a function within a trace context. Creates a root "agent" span that contains all LLM calls and tool executions.
Output Auto-Extraction: If the function returns an object with common text fields (
text,content,message,output,response,result,answer), the SDK automatically extracts that field for cleaner display. UseoutputKeyto specify a custom field, oroutputKey: falseto disable.