Extends
SpanBase
Accessors
model
Get Signature
get model(): string
Returns
string
name
Get Signature
get name(): string
Returns
string
Methods
addEvent()
addEvent(Add a named event to the span. Useful for marking non-span moments such as context compaction, tool-loop detection, or guardrail trips. Warns and no-ops aftername,attributes?,startTime?):this
end(). Mirrors OTel Span.addEvent.
Parameters
string
required
Attributes
TimeInput
Returns
this
Example
Inherited from
SpanBase.addEvent
end()
end(Read current field values (to reflect mutations made viaopts?):void
record()
since start) and close the span. Idempotent. Pass error to mark
it as failed; pass endTime to backdate the close.
Parameters
object
Returns
void
record()
record(Bulk-set any subset of the mutable fields. Replaces (does not merge). Input and output messages are serialized when the span ends.opts):this
Parameters
object
required
Returns
this
setAttributes()
setAttributes(Set multiple attributes on the span at once. Warns and no-ops afterattributes):this
end(). Mirrors OTel Span.setAttributes (and the Python SDK’s
set_attributes).
Parameters
Attributes
required
Returns
this
Example
Inherited from
SpanBase.setAttributes
startLLM()
startLLM(Start a child LLM span nested under this SubAgent.opts):LLM
Parameters
Returns
LLM
startSubagent()
startSubagent(Start a nested SubAgent span under this SubAgent.opts):SubAgent
Parameters
SubAgentInit
required
See
SubAgentInit.Returns
SubAgent
startTool()
startTool(Start a child Tool span nested under this SubAgent.opts):Tool
Parameters
Returns
Tool