MCPcopy
hub / github.com/openai/openai-agents-python / CustomSpanData

Class CustomSpanData

src/agents/tracing/span_data.py:268–289  ·  view source on GitHub ↗

Represents a Custom Span in the trace. Includes name and data property bag.

Source from the content-addressed store, hash-verified

266
267
268class CustomSpanData(SpanData):
269 """
270 Represents a Custom Span in the trace.
271 Includes name and data property bag.
272 """
273
274 __slots__ = ("name", "data")
275
276 def __init__(self, name: str, data: dict[str, Any]):
277 self.name = name
278 self.data = data
279
280 @property
281 def type(self) -> str:
282 return "custom"
283
284 def export(self) -> dict[str, Any]:
285 return {
286 "type": self.type,
287 "name": self.name,
288 "data": self.data,
289 }
290
291
292class GuardrailSpanData(SpanData):

Callers 1

custom_spanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected