MCPcopy Index your code
hub / github.com/53AI/53AIHub / ToOpenAIErrorRespone

Method ToOpenAIErrorRespone

api/model/response.go:140–156  ·  view source on GitHub ↗
(data interface{})

Source from the content-addressed store, hash-verified

138}
139
140func (c ResponseCode) ToOpenAIErrorRespone(data interface{}) OpenAIErrorResponse {
141 msg := c.Message()
142 if err, ok := data.(error); ok {
143 msg += ": " + err.Error()
144 }
145 // data if str
146 if str, ok := data.(string); ok {
147 msg += ": " + str
148 }
149
150 return OpenAIErrorResponse{
151 Error: OpenAIError{
152 Message: msg,
153 Type: "53aihub_error",
154 },
155 }
156}

Callers 8

RelayTokenAuthFunction · 0.80
runAgentLoopFunction · 0.80
RelayFunction · 0.80
handleChatRequestFunction · 0.80
executeSkillFunction · 0.80
processChatRequestV2Function · 0.80

Calls 2

MessageMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected