Versions in this module Expand all Collapse all v0 v0.1.1 Jul 27, 2026 v0.1.0 Jul 27, 2026 Changes in this version + const RelayFormatClaude + const RelayFormatEmbedding + const RelayFormatGemini + const RelayFormatMjProxy + const RelayFormatOpenAI + const RelayFormatOpenAIAlphaSearch + const RelayFormatOpenAIAudio + const RelayFormatOpenAIImage + const RelayFormatOpenAIRealtime + const RelayFormatOpenAIResponses + const RelayFormatOpenAIResponsesCompaction + const RelayFormatRerank + const RelayFormatTask + var FinishReasonContentFilter = "content_filter" + var FinishReasonFunctionCall = "function_call" + var FinishReasonLength = "length" + var FinishReasonStop = "stop" + var FinishReasonToolCalls = "tool_calls" + func IsChannelError(err *NewAPIError) bool + func IsRecordErrorLog(e *NewAPIError) bool + func IsSkipRetryError(err *NewAPIError) bool + type Base64Source struct + Base64Data string + MimeType string + func NewBase64FileSource(base64Data string, mimeType string) *Base64Source + func (b *Base64Source) ClearCache() + func (b *Base64Source) ClearRawData() + func (b *Base64Source) GetCache() *CachedFileData + func (b *Base64Source) GetIdentifier() string + func (b *Base64Source) GetRawData() string + func (b *Base64Source) HasCache() bool + func (b *Base64Source) IsRegistered() bool + func (b *Base64Source) IsURL() bool + func (b *Base64Source) Mu() *sync.Mutex + func (b *Base64Source) SetCache(data *CachedFileData) + func (b *Base64Source) SetRegistered(registered bool) + type CachedFileData struct + DiskSize int64 + ImageConfig *image.Config + ImageFormat string + MimeType string + OnClose func(size int64) + Size int64 + func NewDiskCachedData(diskPath string, mimeType string, size int64) *CachedFileData + func NewMemoryCachedData(base64Data string, mimeType string, size int64) *CachedFileData + func (c *CachedFileData) Close() error + func (c *CachedFileData) GetBase64Data() (string, error) + func (c *CachedFileData) IsDisk() bool + func (c *CachedFileData) SetBase64Data(data string) + type ChannelError struct + AutoBan bool + ChannelId int + ChannelName string + ChannelType int + IsMultiKey bool + UsingKey string + func NewChannelError(channelId int, channelType int, channelName string, isMultiKey bool, ...) *ChannelError + type ClaudeError struct + Message string + Type string + type EndpointType string + const EndpointTypeAnthropic + const EndpointTypeEmbeddings + const EndpointTypeGemini + const EndpointTypeImageGeneration + const EndpointTypeJinaRerank + const EndpointTypeOpenAI + const EndpointTypeOpenAIAlphaSearch + const EndpointTypeOpenAIResponse + const EndpointTypeOpenAIResponseCompact + const EndpointTypeOpenAIVideo + type ErrorCode string + const ErrorCodeAccessDenied + const ErrorCodeAwsInvokeError + const ErrorCodeBadRequestBody + const ErrorCodeBadResponse + const ErrorCodeBadResponseBody + const ErrorCodeBadResponseStatusCode + const ErrorCodeChannelAwsClientError + const ErrorCodeChannelHeaderOverrideInvalid + const ErrorCodeChannelInvalidKey + const ErrorCodeChannelModelMappedError + const ErrorCodeChannelNoAvailableKey + const ErrorCodeChannelParamOverrideInvalid + const ErrorCodeChannelResponseTimeExceeded + const ErrorCodeConvertRequestFailed + const ErrorCodeCountTokenFailed + const ErrorCodeDoRequestFailed + const ErrorCodeEmptyResponse + const ErrorCodeGenRelayInfoFailed + const ErrorCodeGetChannelFailed + const ErrorCodeInsufficientUserQuota + const ErrorCodeInvalidApiType + const ErrorCodeInvalidRequest + const ErrorCodeJsonMarshalFailed + const ErrorCodeModelNotFound + const ErrorCodeModelPriceError + const ErrorCodePreConsumeTokenQuotaFailed + const ErrorCodePromptBlocked + const ErrorCodeQueryDataError + const ErrorCodeReadRequestBodyFailed + const ErrorCodeReadResponseBodyFailed + const ErrorCodeSensitiveWordsDetected + const ErrorCodeUpdateDataError + const ErrorCodeViolationFeeGrokCSAM + type ErrorType string + const ErrorTypeClaudeError + const ErrorTypeGeminiError + const ErrorTypeMidjourneyError + const ErrorTypeNewAPIError + const ErrorTypeOpenAIError + const ErrorTypeRerankError + const ErrorTypeUpstreamError + type FileMeta struct + Detail string + Source FileSource + func NewFileMeta(fileType FileType, source FileSource) *FileMeta + func NewImageFileMeta(source FileSource, detail string) *FileMeta + func (f *FileMeta) GetIdentifier() string + func (f *FileMeta) GetRawData() string + func (f *FileMeta) IsURL() bool + type FileSource interface + ClearCache func() + ClearRawData func() + GetCache func() *CachedFileData + GetIdentifier func() string + GetRawData func() string + HasCache func() bool + IsRegistered func() bool + IsURL func() bool + Mu func() *sync.Mutex + SetCache func(data *CachedFileData) + SetRegistered func(registered bool) + func NewFileSourceFromData(data string, mimeType string) FileSource + type FileType string + const FileTypeAudio + const FileTypeFile + const FileTypeImage + const FileTypeVideo + type LocalFileData struct + Base64Data string + MimeType string + Size int64 + Url string + type NewAPIError struct + Err error + Metadata json.RawMessage + RelayError any + StatusCode int + func InitOpenAIError(errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions) *NewAPIError + func NewError(err error, errorCode ErrorCode, ops ...NewAPIErrorOptions) *NewAPIError + func NewErrorWithStatusCode(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions) *NewAPIError + func NewOpenAIError(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions) *NewAPIError + func WithClaudeError(claudeError ClaudeError, statusCode int, ops ...NewAPIErrorOptions) *NewAPIError + func WithOpenAIError(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions) *NewAPIError + func (e *NewAPIError) Error() string + func (e *NewAPIError) ErrorWithStatusCode() string + func (e *NewAPIError) GetErrorCode() ErrorCode + func (e *NewAPIError) GetErrorType() ErrorType + func (e *NewAPIError) MaskSensitiveError() string + func (e *NewAPIError) MaskSensitiveErrorWithStatusCode() string + func (e *NewAPIError) SetMessage(message string) + func (e *NewAPIError) ToClaudeError() ClaudeError + func (e *NewAPIError) ToOpenAIError() OpenAIError + func (e *NewAPIError) Unwrap() error + type NewAPIErrorOptions func(*NewAPIError) + func ErrOptionWithHideErrMsg(replaceStr string) NewAPIErrorOptions + func ErrOptionWithNoRecordErrorLog() NewAPIErrorOptions + func ErrOptionWithSkipRetry() NewAPIErrorOptions + func ErrOptionWithStatusCode(statusCode int) NewAPIErrorOptions + type OpenAIError struct + Code any + Message string + Metadata json.RawMessage + Param string + Type string + type RelayFormat string + type RequestMeta struct + OriginalModelName string + PreConsumedQuota int + PromptTokens int + UserUsingGroup string + type TokenCountMeta struct + BillingRatios map[string]float64 + CombineText string + Files []*FileMeta + ImagePriceRatio float64 + MaxTokens int + MessagesCount int + NameCount int + TokenType TokenType + ToolsCount int + type TokenType string + const TokenTypeImage + const TokenTypeTextNumber + const TokenTypeTokenizer + type URLSource struct + URL string + func NewURLFileSource(url string) *URLSource + func (b *URLSource) ClearCache() + func (b *URLSource) GetCache() *CachedFileData + func (b *URLSource) HasCache() bool + func (b *URLSource) IsRegistered() bool + func (b *URLSource) Mu() *sync.Mutex + func (b *URLSource) SetCache(data *CachedFileData) + func (b *URLSource) SetRegistered(registered bool) + func (u *URLSource) ClearRawData() + func (u *URLSource) GetIdentifier() string + func (u *URLSource) GetRawData() string + func (u *URLSource) IsURL() bool