> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# StepWithChildSpans

***

# Class: StepWithChildSpans

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

## Extends

* [`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan)

## Extended by

* [`WorkflowSpan`](/sdk-api/typescript/reference/types/classes/WorkflowSpan)
* [`AgentSpan`](/sdk-api/typescript/reference/types/classes/AgentSpan)
* [`Trace`](/sdk-api/typescript/reference/types/classes/Trace)

## Constructors

### Constructor

```ts theme={null}
new StepWithChildSpans(type: "agent" | "llm" | "retriever" | "tool" | "workflow" | "trace" | "session", data: StepWithChildSpansOptions): StepWithChildSpans;
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

#### Parameters

##### type

`"agent"` | `"llm"` | `"retriever"` | `"tool"` | `"workflow"` | `"trace"` | `"session"`

##### data

[`StepWithChildSpansOptions`](/sdk-api/typescript/reference/types/interfaces/StepWithChildSpansOptions)

#### Returns

`StepWithChildSpans`

#### Overrides

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`constructor`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#constructor)

## Properties

### createdAt

```ts theme={null}
createdAt: Date;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`createdAt`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#createdat)

***

### datasetInput?

```ts theme={null}
optional datasetInput: string;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`datasetInput`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#datasetinput)

***

### datasetMetadata?

```ts theme={null}
optional datasetMetadata: Record<string, string> = {};
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`datasetMetadata`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#datasetmetadata)

***

### datasetOutput?

```ts theme={null}
optional datasetOutput: string;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`datasetOutput`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#datasetoutput)

***

### externalId?

```ts theme={null}
optional externalId: string;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`externalId`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#externalid)

***

### input

```ts theme={null}
input: StepAllowedInputType;
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`input`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#input)

***

### metrics

```ts theme={null}
metrics: Metrics;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`metrics`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#metrics)

***

### name

```ts theme={null}
name: string = "";
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`name`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#name)

***

### output?

```ts theme={null}
optional output: StepAllowedOutputType;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`output`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#output)

***

### redactedInput?

```ts theme={null}
optional redactedInput: StepAllowedInputType;
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`redactedInput`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#redactedinput)

***

### redactedOutput?

```ts theme={null}
optional redactedOutput: StepAllowedOutputType;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`redactedOutput`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#redactedoutput)

***

### spans

```ts theme={null}
spans: Span[] = [];
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

***

### statusCode?

```ts theme={null}
optional statusCode: number;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`statusCode`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#statuscode)

***

### stepNumber?

```ts theme={null}
optional stepNumber: number;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`stepNumber`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#stepnumber)

***

### tags?

```ts theme={null}
optional tags: string[];
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`tags`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#tags)

***

### type

```ts theme={null}
type: "agent" | "llm" | "retriever" | "tool" | "workflow" | "trace" | "session";
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`type`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#type)

***

### userMetadata

```ts theme={null}
userMetadata: Record<string, string> = {};
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/step.types.ts)

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`userMetadata`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#usermetadata)

## Methods

### addChildSpan()

```ts theme={null}
addChildSpan(...spans: Span[]): void;
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

#### Parameters

##### spans

...[`Span`](/sdk-api/typescript/reference/types/type-aliases/Span)\[]

#### Returns

`void`

***

### toJSON()

```ts theme={null}
toJSON(): Record<string, any>;
```

Defined in: [src/types/logging/span.types.ts](https://github.com/rungalileo/galileo-js/blob/main/src/types/logging/span.types.ts)

#### Returns

`Record`\<`string`, `any`>

#### Overrides

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`toJSON`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#tojson)

***

### validateInputOutputSerializable()

```ts theme={null}
validateInputOutputSerializable<T>(val: T): T;
```

Defined in: [src/types/logging/step.types.ts](https://github.com/rungalileo/galileo-js/blob/main/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`](/sdk-api/typescript/reference/types/classes/Document)
\| `Record`\<`string`, `string`>
\| [`Document`](/sdk-api/typescript/reference/types/classes/Document)\[]
\| `Record`\<`string`, `string`>\[]
\| `object`\[]
\| `Record`\<`string`, `string`>\[]

#### Parameters

##### val

`T`

#### Returns

`T`

#### Inherited from

[`BaseSpan`](/sdk-api/typescript/reference/types/classes/BaseSpan).[`validateInputOutputSerializable`](/sdk-api/typescript/reference/types/classes/BaseSpan.mdx#validateinputoutputserializable)
