MCPcopy Create free account
hub / github.com/codehamr/codehamr / applyToolCall

Method applyToolCall

internal/tui/model.go:775–778  ·  view source on GitHub ↗

applyToolCall queues a streamed tool call for later dispatch. flushStreaming up front commits this round's text to scroll before the inline tool-call status lands, so the user sees styled text *before* the "▶ bash: ..." line, not all at once at turn end.

(e llm.Event)

Source from the content-addressed store, hash-verified

773// schemaToTool unwraps a tool schema (the map[string]any shape shared by bash
774// and the file tools) into the typed llm.Tool the chat payload expects.
775func schemaToTool(s map[string]any) llm.Tool {
776 fn := s["function"].(map[string]any)
777 return llm.Tool{
778 Type: s["type"].(string),
779 Function: llm.FunctionDef{
780 Name: fn["name"].(string),
781 Description: fn["description"].(string),

Callers 1

handleStreamMethod · 0.95

Calls 1

flushStreamingMethod · 0.95

Tested by

no test coverage detected