MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / buildMessages

Method buildMessages

api/client.go:593–606  ·  view source on GitHub ↗
(systemPrompt string, messages []map[string]any)

Source from the content-addressed store, hash-verified

591 usage, _ := data["usage"].(map[string]any)
592 delta, _ := data["delta"].(map[string]any)
593
594 out <- EventResult{Event: map[string]any{
595 "type": "usage",
596 "input_tokens": savedInputTokens,
597 "output_tokens": getInt(usage, "output_tokens"),
598 "cache_read_input_tokens": getInt(usage, "cache_read_input_tokens"),
599 "cache_creation_input_tokens": getInt(usage, "cache_creation_input_tokens"),
600 }}
601
602 stopReason := getString(delta, "stop_reason")
603 if stopReason == "" {
604 stopReason = "end_turn"
605 }
606 out <- EventResult{Event: map[string]any{"type": "stop_reason", "stop_reason": stopReason}}
607 }
608 return true
609 })

Callers 2

CompleteMethod · 0.95
StreamChatMethod · 0.95

Calls 1

Tested by

no test coverage detected