Documentation
¶
Index ¶
- func AudioHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func EmbeddingHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func GeminiEmbeddingHandler(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func GeminiHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func GetAdaptor(apiType int) channel.Adaptor
- func GetTaskAdaptor(platform constant.TaskPlatform) channel.TaskAdaptor
- func GetTaskPlatform(c *gin.Context) constant.TaskPlatform
- func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func RelayMidjourneyImage(c *gin.Context)
- func RelayMidjourneyNotify(c *gin.Context) *dto.MidjourneyResponse
- func RelayMidjourneySubmit(c *gin.Context, relayInfo *relaycommon.RelayInfo) *dto.MidjourneyResponse
- func RelayMidjourneyTask(c *gin.Context, relayMode int) *dto.MidjourneyResponse
- func RelayMidjourneyTaskImageSeed(c *gin.Context) *dto.MidjourneyResponse
- func RelaySwapFace(c *gin.Context, info *relaycommon.RelayInfo) *dto.MidjourneyResponse
- func RelayTaskFetch(c *gin.Context, relayMode int) (taskResp *dto.TaskError)
- func RerankHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func ResolveOriginTask(c *gin.Context, info *relaycommon.RelayInfo) *dto.TaskError
- func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func TaskModel2Dto(task *model.Task) *dto.TaskDto
- func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- func WssHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
- type TaskSubmitResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AudioHelper ¶
func AudioHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func ClaudeHelper ¶
func ClaudeHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func EmbeddingHelper ¶
func EmbeddingHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func GeminiEmbeddingHandler ¶
func GeminiEmbeddingHandler(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func GeminiHelper ¶
func GeminiHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func GetAdaptor ¶
func GetTaskAdaptor ¶
func GetTaskAdaptor(platform constant.TaskPlatform) channel.TaskAdaptor
func GetTaskPlatform ¶
func GetTaskPlatform(c *gin.Context) constant.TaskPlatform
func ImageHelper ¶
func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func RelayMidjourneyImage ¶
func RelayMidjourneyNotify ¶
func RelayMidjourneyNotify(c *gin.Context) *dto.MidjourneyResponse
func RelayMidjourneySubmit ¶
func RelayMidjourneySubmit(c *gin.Context, relayInfo *relaycommon.RelayInfo) *dto.MidjourneyResponse
func RelayMidjourneyTask ¶
func RelayMidjourneyTask(c *gin.Context, relayMode int) *dto.MidjourneyResponse
func RelayMidjourneyTaskImageSeed ¶
func RelayMidjourneyTaskImageSeed(c *gin.Context) *dto.MidjourneyResponse
func RelaySwapFace ¶
func RelaySwapFace(c *gin.Context, info *relaycommon.RelayInfo) *dto.MidjourneyResponse
func RerankHelper ¶
func RerankHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func ResolveOriginTask ¶ added in v0.11.0
ResolveOriginTask 处理基于已有任务的提交(remix / continuation): 查找原始任务、从中提取模型名称、将渠道锁定到原始任务的渠道 (通过 info.LockedChannel,重试时复用同一渠道并轮换 key), 以及提取 OtherRatios(时长、分辨率)。 该函数在控制器的重试循环之前调用一次,其结果通过 info 字段和上下文持久化。
func ResponsesHelper ¶
func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func TextHelper ¶
func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
func WssHelper ¶
func WssHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types.NewAPIError)
Types ¶
type TaskSubmitResult ¶ added in v0.11.0
type TaskSubmitResult struct {
UpstreamTaskID string
TaskData []byte
Platform constant.TaskPlatform
Quota int
}
func RelayTaskSubmit ¶
func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (*TaskSubmitResult, *dto.TaskError)
RelayTaskSubmit 完成 task 提交的全部流程(每次尝试调用一次): 刷新渠道元数据 → 确定 platform/adaptor → 验证请求 → 估算计费(EstimateBilling) → 计算价格 → 预扣费(仅首次)→ 构建/发送/解析上游请求 → 提交后计费调整(AdjustBillingOnSubmit)。 控制器负责 defer Refund 和成功后 Settle。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.