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

Function emitMessageShell

quickstart/chatwitheino/a2ui/streamer.go:438–451  ·  view source on GitHub ↗
(w io.Writer, surfaceID string, rootChildren []string, cardID, colID, roleID, contentID, dataKey, roleLabel string)

Source from the content-addressed store, hash-verified

436}
437
438func emitMessageShell(w io.Writer, surfaceID string, rootChildren []string, cardID, colID, roleID, contentID, dataKey, roleLabel string) error {
439 return emit(w, Message{
440 SurfaceUpdate: &SurfaceUpdateMsg{
441 SurfaceID: surfaceID,
442 Components: []Component{
443 {ID: "root-col", Component: ComponentValue{Column: &ColumnComp{Children: append([]string{}, rootChildren...)}}},
444 {ID: cardID, Component: ComponentValue{Card: &CardComp{Children: []string{colID}}}},
445 {ID: colID, Component: ComponentValue{Column: &ColumnComp{Children: []string{roleID, contentID}}}},
446 {ID: roleID, Component: ComponentValue{Text: &TextComp{Value: roleLabel, UsageHint: "caption"}}},
447 {ID: contentID, Component: ComponentValue{Text: &TextComp{DataKey: dataKey, UsageHint: "body"}}},
448 },
449 },
450 })
451}
452
453func emitDataUpdate(w io.Writer, surfaceID, dataKey, content string) error {
454 return emit(w, Message{

Callers 2

streamEventsFunction · 0.85
emitTextCardFunction · 0.85

Calls 1

emitFunction · 0.85

Tested by

no test coverage detected