(text string)
| 583 | } |
| 584 | } |
| 585 | return firstRunes(candidate, budget.MaxChars), true |
| 586 | } |
| 587 | |
| 588 | func BuildBudgetAttachmentSection(name, heading, rawContent string, preserveSeparator *string, budget PromptAttachmentBudget) PromptSection { |
| 589 | truncated, wasTruncated := TruncateAttachmentText(rawContent, budget, preserveSeparator) |
| 590 | if wasTruncated { |
| 591 | truncated = strings.TrimRightFunc(truncated, unicode.IsSpace) + "\n\n(The following content was truncated to fit the prompt budget.)" |
| 592 | } |
| 593 | return PromptSection{ |
| 594 | name, |
| 595 | BuildAttachmentBlock(name, heading, truncated), |
| 596 | true, |
| 597 | } |
| 598 | } |
| 599 |
no outgoing calls
no test coverage detected