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

Function parseTestResponse

api/controller/channel-test.go:266–280  ·  view source on GitHub ↗
(resp string)

Source from the content-addressed store, hash-verified

264}
265
266func parseTestResponse(resp string) (*openai.TextResponse, string, string, error) {
267 var response openai.TextResponse
268 err := json.Unmarshal([]byte(resp), &response)
269 if err != nil {
270 return nil, "", "", err
271 }
272 if len(response.Choices) == 0 {
273 return nil, "", "", errors.New("response has no choices")
274 }
275 stringContent, ok := response.Choices[0].Content.(string)
276 if !ok {
277 return nil, "", "", errors.New("response content is not string")
278 }
279 return &response, stringContent, response.Model, nil
280}
281
282func buildTestRequest(model string) *relaymodel.GeneralOpenAIRequest {
283 if model == "" {

Callers 1

testChannelFunction · 0.85

Calls 1

NewMethod · 0.45

Tested by

no test coverage detected