---
title: LanguageModelExecutorGenerationChannel.TextFragment
framework: foundationmodels
role: symbol
role_heading: Structure
path: foundationmodels/languagemodelexecutorgenerationchannel/textfragment
---

# LanguageModelExecutorGenerationChannel.TextFragment

Append text to a streaming entry’s current text segment. Used by both LanguageModelExecutorGenerationChannel.Response.Action.appendText(_:) and LanguageModelExecutorGenerationChannel.Reasoning.Action.appendText(_:).

## Declaration

```swift
struct TextFragment
```

## Topics

### Handling the text fragment

- [content](foundationmodels/languagemodelexecutorgenerationchannel/textfragment/content.md)
- [tokenCount](foundationmodels/languagemodelexecutorgenerationchannel/textfragment/tokencount.md)
- [segmentID](foundationmodels/languagemodelexecutorgenerationchannel/textfragment/segmentid.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Accessing the event types

- [LanguageModelExecutorGenerationChannel.EventKind](foundationmodels/languagemodelexecutorgenerationchannel/eventkind.md)
- [LanguageModelExecutorGenerationChannel.Metadata](foundationmodels/languagemodelexecutorgenerationchannel/metadata.md)
- [LanguageModelExecutorGenerationChannel.Reasoning](foundationmodels/languagemodelexecutorgenerationchannel/reasoning.md)
- [LanguageModelExecutorGenerationChannel.ReasoningSignature](foundationmodels/languagemodelexecutorgenerationchannel/reasoningsignature.md)
- [LanguageModelExecutorGenerationChannel.TextSegmentReplacement](foundationmodels/languagemodelexecutorgenerationchannel/textsegmentreplacement.md)
- [LanguageModelExecutorGenerationChannel.Response](foundationmodels/languagemodelexecutorgenerationchannel/response.md)
- [LanguageModelExecutorGenerationChannel.ToolCalls](foundationmodels/languagemodelexecutorgenerationchannel/toolcalls.md)
- [LanguageModelExecutorGenerationChannel.Usage](foundationmodels/languagemodelexecutorgenerationchannel/usage.md)
