Skip to main content

Class: LlmSpan

Defined in: src/types/logging/span.types.ts

Extends

Constructors

Constructor

new LlmSpan(data: LlmSpanOptions): LlmSpan;
Defined in: src/types/logging/span.types.ts

Parameters

data
LlmSpanOptions

Returns

LlmSpan

Overrides

BaseSpan.constructor

Properties

createdAt

createdAt: Date;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.createdAt

datasetInput?

optional datasetInput: string;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.datasetInput

datasetMetadata?

optional datasetMetadata: Record<string, string> = {};
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.datasetMetadata

datasetOutput?

optional datasetOutput: string;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.datasetOutput

externalId?

optional externalId: string;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.externalId

finishReason?

optional finishReason: string;
Defined in: src/types/logging/span.types.ts

input

input: object[];
Defined in: src/types/logging/span.types.ts

content

content: string;
Content

role

role:
  | "function"
  | "agent"
  | "tool"
  | "user"
  | "assistant"
  | "developer"
  | "system";

tool_call_id?

optional tool_call_id: null | string;
Tool Call Id

tool_calls?

optional tool_calls: null | object[];
Tool Calls

Overrides

BaseSpan.input

metrics

metrics: LlmMetrics;
Defined in: src/types/logging/span.types.ts

Overrides

BaseSpan.metrics

model?

optional model: string;
Defined in: src/types/logging/span.types.ts

name

name: string = "";
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.name

output

output: object;
Defined in: src/types/logging/span.types.ts

content

content: string;
Content

role

role:
  | "function"
  | "agent"
  | "tool"
  | "user"
  | "assistant"
  | "developer"
  | "system";

tool_call_id?

optional tool_call_id: null | string;
Tool Call Id

tool_calls?

optional tool_calls: null | object[];
Tool Calls

Overrides

BaseSpan.output

redactedInput?

optional redactedInput: object[];
Defined in: src/types/logging/span.types.ts

content

content: string;
Content

role

role:
  | "function"
  | "agent"
  | "tool"
  | "user"
  | "assistant"
  | "developer"
  | "system";

tool_call_id?

optional tool_call_id: null | string;
Tool Call Id

tool_calls?

optional tool_calls: null | object[];
Tool Calls

Overrides

BaseSpan.redactedInput

redactedOutput?

optional redactedOutput: object;
Defined in: src/types/logging/span.types.ts

content

content: string;
Content

role

role:
  | "function"
  | "agent"
  | "tool"
  | "user"
  | "assistant"
  | "developer"
  | "system";

tool_call_id?

optional tool_call_id: null | string;
Tool Call Id

tool_calls?

optional tool_calls: null | object[];
Tool Calls

Overrides

BaseSpan.redactedOutput

statusCode?

optional statusCode: number;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.statusCode

stepNumber?

optional stepNumber: number;
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.stepNumber

tags?

optional tags: string[];
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.tags

temperature?

optional temperature: number;
Defined in: src/types/logging/span.types.ts

tools?

optional tools: Record<string, any>[];
Defined in: src/types/logging/span.types.ts

type

type: "agent" | "llm" | "retriever" | "tool" | "workflow" | "trace" | "session" = StepType.llm;
Defined in: src/types/logging/span.types.ts

Overrides

BaseSpan.type

userMetadata

userMetadata: Record<string, string> = {};
Defined in: src/types/logging/step.types.ts

Inherited from

BaseSpan.userMetadata

Methods

toJSON()

toJSON(): Record<string, any>;
Defined in: src/types/logging/span.types.ts

Returns

Record<string, any>

Overrides

BaseSpan.toJSON

validateInputOutputSerializable()

validateInputOutputSerializable<T>(val: T): T;
Defined in: src/types/logging/step.types.ts

Type Parameters

T
T = | string | { content: string; role: | "function" | "agent" | "tool" | "user" | "assistant" | "developer" | "system"; tool_call_id?: null | string; tool_calls?: null | object[]; } | string[] | Document | Record<string, string> | Document[] | Record<string, string>[] | object[] | Record<string, string>[]

Parameters

val
T

Returns

T

Inherited from

BaseSpan.validateInputOutputSerializable