Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUpstreamShouldRetry = errors.New("upstream failed")
)
Functions ¶
func EndpointHasModel ¶
Types ¶
type ChannelType ¶
type ChannelType string
const ( ChannelTypeOpenAI ChannelType = "openai" ChannelTypeAzure ChannelType = "azure" ChannelTypeCoze ChannelType = "coze" ChannelTypeAnthropic ChannelType = "anthropic" )
type Endpoint ¶
type Endpoint string
const ( EndpointChatCompletion Endpoint = "/v1/chat/completions" EndpointCompletion Endpoint = "/v1/completions" EndpointImageGeneration Endpoint = "/v1/images/generations" EndpointImageEdit Endpoint = "/v1/images/edits" EndpointImageVariation Endpoint = "/v1/images/variations" EndpointAudioSpeech Endpoint = "/v1/audio/speech" EndpointAudioTranscript Endpoint = "/v1/audio/transcriptions" EndpointAudioTranslate Endpoint = "/v1/audio/translations" EndpointModeration Endpoint = "/v1/moderations" EndpointEmbedding Endpoint = "/v1/embeddings" )
type Provider ¶
type Provider interface { Completion(ctx context.Context, openaiReq openai.ChatCompletionRequest, w http.ResponseWriter) error CompletionStream(ctx context.Context, openaiReq openai.ChatCompletionRequest, w http.ResponseWriter) error }
type ResponseError ¶
func (ResponseError) Error ¶
func (r ResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.