Documentation
¶
Overview ¶
Package turn extracts and merges conversation turn bodies from journal entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTurnBody ¶
ExtractTurnBody extracts the body text from lines[start:] until the next turn header. Skips a leading blank line.
Parameters:
- lines: All lines of the journal entry
- start: Index of the first line after the turn header
Returns:
- string: Trimmed body content
- int: Index one past the last body line
func MergeConsecutiveTurns ¶
MergeConsecutiveTurns merges back-to-back turns from the same role into a single turn. Keeps the first header and concatenates all bodies. This reduces noise from sequences like 4 consecutive Assistant turns each with a single tool call.
Parameters:
- content: Journal entry content with potential consecutive same-role turns
Returns:
- string: Content with consecutive same-role turns merged
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.