first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package cohere
import (
providerUtils "github.com/maximhq/bifrost/core/providers/utils"
"github.com/maximhq/bifrost/core/schemas"
"github.com/valyala/fasthttp"
)
func parseCohereError(resp *fasthttp.Response) *schemas.BifrostError {
var errorResp CohereError
bifrostErr := providerUtils.HandleProviderAPIError(resp, &errorResp)
bifrostErr.Type = &errorResp.Type
if bifrostErr.Error == nil {
bifrostErr.Error = &schemas.ErrorField{}
}
bifrostErr.Error.Message = errorResp.Message
if errorResp.Code != nil {
bifrostErr.Error.Code = errorResp.Code
}
return bifrostErr
}