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

# LogSpanFunctionContent

> Span content type for custom application logic and function executions.

# LogSpanFunctionContent

Span content for custom application logic. Use this type when logging functions in your own codebase — data transformations, business rules, preprocessing steps, or any operation that isn't an LLM call, tool invocation, or retrieval.

## Import

```typescript theme={null}
import type { LogSpanFunctionContent } from '@adaline/api';
import { LogSpanFunctionContentTypeEnum } from '@adaline/api';
```

## Type Definition

```typescript theme={null}
interface LogSpanFunctionContent {
  type: 'Function';
  input: string;                   // JSON string (must be valid JSON)
  output: string;                  // JSON string (must be valid JSON)
}
```

## Properties

* `type` - Discriminator field, always `'Function'` for this content type
* `input` - The function arguments as a JSON string (`JSON.stringify()` of the input parameters)
* `output` - The function return value as a JSON string (`JSON.stringify()` of the result)

Both `input` and `output` must be valid, parseable JSON strings (the result of `JSON.stringify()`). Passing a plain string that isn't valid JSON will cause the span to be rejected.

***

## Example

```typescript theme={null}
function classifyIntent(message: string): { intent: string; confidence: number } {
  // custom classification logic
  return { intent: 'billing_inquiry', confidence: 0.92 };
}

const input = { message: 'Where is my invoice?' };
const result = classifyIntent(input.message);

span.update({
  content: {
    type: 'Function',
    input: JSON.stringify(input),
    output: JSON.stringify(result),
  },
});
```

***

## Related

* [LogSpanContent](/docs/reference/sdk/v2/typescript/types/LogSpanContent) — union type that includes `LogSpanFunctionContent`
* [LogSpanToolContent](/docs/reference/sdk/v2/typescript/types/LogSpanToolContent) — for external tool/function-call executions triggered by an LLM
* [Span](/docs/reference/sdk/v2/typescript/classes/span) — class that accepts `LogSpanContent` via `span.update()`
