MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / ObjectData

Function ObjectData

relay/helper/common.go:86–95  ·  view source on GitHub ↗
(c *gin.Context, object interface{})

Source from the content-addressed store, hash-verified

84}
85
86func ObjectData(c *gin.Context, object interface{}) error {
87 if object == nil {
88 return errors.New("object is nil")
89 }
90 jsonData, err := common.Marshal(object)
91 if err != nil {
92 return fmt.Errorf("error marshalling object: %w", err)
93 }
94 return StringData(c, string(jsonData))
95}
96
97func Done(c *gin.Context) {
98 _ = StringData(c, "[DONE]")

Callers 11

GeminiChatStreamHandlerFunction · 0.92
xAIStreamHandlerFunction · 0.92
sendStreamDataFunction · 0.92
handleFinalResponseFunction · 0.92
tencentStreamHandlerFunction · 0.92
difyStreamHandlerFunction · 0.92
baiduStreamHandlerFunction · 0.92
cfStreamHandlerFunction · 0.92
HandleStreamResponseDataFunction · 0.92
handleCozeEventFunction · 0.92

Calls 2

MarshalFunction · 0.92
StringDataFunction · 0.85

Tested by

no test coverage detected