MCPcopy Create free account
hub / github.com/cloudwego/eino-examples / Encode

Function Encode

quickstart/chatwitheino/a2ui/types.go:105–111  ·  view source on GitHub ↗

Encode serializes a Message to JSON followed by a newline byte.

(msg Message)

Source from the content-addressed store, hash-verified

103
104// Encode serializes a Message to JSON followed by a newline byte.
105func Encode(msg Message) ([]byte, error) {
106 data, err := json.Marshal(msg)
107 if err != nil {
108 return nil, err
109 }
110 return append(data, '\n'), nil
111}

Callers 1

emitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected