applyContent writes one streamed text chunk to the live buffer and promotes phase from thinking to streaming on the first chunk so the status bar shows tokens flowing. View() renders the buffer live above the prompt; once the block ends it's flushed through glamour into scrollback via tea.Println.
(e llm.Event)
| 755 | } |
| 756 | m.lastPromptEstimate = est |
| 757 | dbgWriteRequest(m.cfg.ActiveProfile().LLM, ctxSize, budget, len(m.history), out) |
| 758 | return out |
| 759 | } |
| 760 | |
| 761 | // buildTools exposes the four local tools every turn: bash, read_file, |
| 762 | // write_file, edit_file. No loop/control tool; a turn ends when the model |
| 763 | // stops emitting tool calls (see handleStreamClosed). |
| 764 | func (m *Model) buildTools() []llm.Tool { |
| 765 | return []llm.Tool{ |
| 766 | schemaToTool(tools.BashSchema()), |
| 767 | schemaToTool(tools.ReadFileSchema()), |
| 768 | schemaToTool(tools.WriteFileSchema()), |
| 769 | schemaToTool(tools.EditFileSchema()), |
| 770 | } |
| 771 | } |
| 772 |