Class: Woods::Formatting::GenericAdapter
- Defined in:
- lib/woods/formatting/generic_adapter.rb
Overview
Formats assembled context as plain text for generic LLM consumption.
Produces plain text with:
-
‘=== CODEBASE CONTEXT ===` header
-
Token usage line
-
Content separated by ‘—` dividers
-
Sources in bracket notation
Instance Method Summary collapse
-
#format(assembled_context) ⇒ String
Format assembled context as plain text.
Instance Method Details
#format(assembled_context) ⇒ String
Format assembled context as plain text.
25 26 27 28 29 30 31 32 33 |
# File 'lib/woods/formatting/generic_adapter.rb', line 25 def format(assembled_context) parts = [] parts << '=== CODEBASE CONTEXT ===' parts << "Tokens: #{assembled_context.tokens_used} / #{assembled_context.budget}" parts << '---' parts << assembled_context.context parts.concat(format_sources(assembled_context.sources)) parts.join("\n") end |