MCPcopy Create free account
hub / github.com/docker/docker-agent / lastAssistantContent

Method lastAssistantContent

cmd/wasm/runtime_wasm.go:775–782  ·  view source on GitHub ↗

lastAssistantContent returns the content of the last assistant message.

(messages []chat.Message)

Source from the content-addressed store, hash-verified

773
774// lastAssistantContent returns the content of the last assistant message.
775func (rt *wasmRuntime) lastAssistantContent(messages []chat.Message) string {
776 for i := len(messages) - 1; i >= 0; i-- {
777 if messages[i].Role == chat.MessageRoleAssistant && messages[i].Content != "" {
778 return messages[i].Content
779 }
780 }
781 return ""
782}
783
784// parseToolArgs attempts to parse a JSON string into a map.
785func parseToolArgs(args string) map[string]any {

Callers 1

runAgentLoopMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected