Documentation
¶
Index ¶
- type App
- type AppKey
- type AudioReq
- type AudioRes
- type BatchReq
- type BatchRes
- type CompletionsRes
- type DashboardModelsData
- type DashboardModelsRes
- type DashboardSubscriptionRes
- type DashboardUsageRes
- type FastAPI
- type FileFilesReq
- type FileReq
- type FileRes
- type GeneralReq
- type GeneralRes
- type GetBaiduTokenRes
- type GetGcpTokenRes
- type Group
- type ImageRes
- type Key
- type LogAudio
- type LogBatch
- type LogFile
- type LogGeneral
- type LogImage
- type LogMidjourney
- type LogText
- type LogVideo
- type MidjourneyResponse
- type Model
- type ModelAgent
- type Permission
- type Provider
- type PubMessage
- type RealtimeRequest
- type RealtimeResponse
- type Reseller
- type SubMessage
- type User
- type UserQuota
- type VideoReq
- type VideoRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Id string `json:"id,omitempty"` // ID
UserId int `json:"user_id,omitempty"` // 用户ID
AppId int `json:"app_id,omitempty"` // 应用ID
Name string `json:"name,omitempty"` // 应用名称
Models []string `json:"models,omitempty"` // 模型权限
IsLimitQuota bool `json:"is_limit_quota,omitempty"` // 是否限制额度
Quota int `json:"quota,omitempty"` // 剩余额度
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `json:"quota_expires_at,omitempty"` // 额度过期时间
IsBindGroup bool `json:"is_bind_group,omitempty"` // 是否绑定分组
Group string `json:"group,omitempty"` // 绑定分组
IpWhitelist []string `json:"ip_whitelist,omitempty"` // IP白名单
IpBlacklist []string `json:"ip_blacklist,omitempty"` // IP黑名单
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `json:"rid,omitempty"` // 代理商ID
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type AppKey ¶
type AppKey struct {
Id string `json:"id,omitempty"` // ID
UserId int `json:"user_id,omitempty"` // 用户ID
AppId int `json:"app_id,omitempty"` // 应用ID
Key string `json:"key,omitempty"` // 密钥
BillingMethods []int `json:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Models []string `json:"models,omitempty"` // 模型
IsLimitQuota bool `json:"is_limit_quota"` // 是否限制额度
Quota int `json:"quota,omitempty"` // 剩余额度
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
QuotaExpiresRule int `json:"quota_expires_rule,omitempty"` // 额度过期规则[1:固定, 2:时长]
QuotaExpiresAt int64 `json:"quota_expires_at,omitempty"` // 额度过期时间
QuotaExpiresMinutes int64 `json:"quota_expires_minutes"` // 额度过期分钟数
IsBindGroup bool `json:"is_bind_group,omitempty"` // 是否绑定分组
Group string `json:"group,omitempty"` // 绑定分组
IpWhitelist []string `json:"ip_whitelist,omitempty"` // IP白名单
IpBlacklist []string `json:"ip_blacklist,omitempty"` // IP黑名单
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `json:"rid,omitempty"` // 代理商ID
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type CompletionsRes ¶
type DashboardModelsData ¶
type DashboardModelsRes ¶
type DashboardModelsRes struct {
Object string `json:"object"`
Data []DashboardModelsData `json:"data"`
}
Models接口响应参数
type DashboardSubscriptionRes ¶
type DashboardSubscriptionRes struct {
Object string `json:"object"`
HasPaymentMethod bool `json:"has_payment_method"`
SoftLimitUSD float64 `json:"soft_limit_usd"`
HardLimitUSD float64 `json:"hard_limit_usd"`
SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
AccessUntil int64 `json:"access_until"`
}
Subscription接口响应参数
type DashboardUsageRes ¶
type DashboardUsageRes struct {
Object string `json:"object"`
TotalUsage float64 `json:"total_usage"`
}
Usage接口响应参数
type FastAPI ¶
type FastAPI struct {
Provider string `json:"provider,omitempty"` // 提供商名称
Code string `json:"code,omitempty"` // 提供商代码
Model string `json:"model,omitempty"` // 模型
Type int `json:"type,omitempty"` // 模型类型
BaseUrl string `json:"base_url,omitempty"` // 模型地址
Path string `json:"path,omitempty"` // 模型路径
Pricing common.Pricing `json:"pricing,omitempty"` // 定价
Remark string `json:"remark,omitempty"` // 备注
}
type FileFilesReq ¶
type FileFilesReq struct {
Model string `json:"model" v:"required"`
File *ghttp.UploadFile `json:"file" type:"file" v:"required"`
Purpose string `json:"purpose"`
FilePath string `json:"-"`
}
Files接口请求参数
type GeneralReq ¶
type GeneralRes ¶
type GetBaiduTokenRes ¶
type GetBaiduTokenRes struct {
RefreshToken string `json:"refresh_token"`
ExpiresIn int64 `json:"expires_in"`
SessionKey string `json:"session_key"`
AccessToken string `json:"access_token"`
Scope string `json:"scope"`
SessionSecret string `json:"session_secret"`
ErrorDescription string `json:"error_description"`
Error string `json:"errors"`
}
type GetGcpTokenRes ¶
type Group ¶
type Group struct {
Id string `json:"id,omitempty"` // ID
TimeRules []*common.TimeRule `json:"time_rules,omitempty"` // 时段规则
BillingMethods []int `json:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Name string `json:"name,omitempty"` // 分组名称
Models []string `json:"models,omitempty"` // 模型权限
IsEnableModelAgent bool `json:"is_enable_model_agent,omitempty"` // 是否启用模型代理
LbStrategy int `json:"lb_strategy,omitempty"` // 代理负载均衡策略[1:轮询, 2:权重]
ModelAgents []string `json:"model_agents,omitempty"` // 模型代理
IsDefault bool `json:"is_default,omitempty"` // 是否默认分组
IsLimitQuota bool `json:"is_limit_quota,omitempty"` // 是否限制额度
Quota int `json:"quota,omitempty"` // 剩余额度
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
IsEnableForward bool `json:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `json:"forward_config,omitempty"` // 模型转发配置
IsPublic bool `json:"is_public,omitempty"` // 是否公开
Weight int `json:"weight,omitempty"` // 权重
ExpiresAt int64 `json:"expires_at,omitempty"` // 过期时间
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type Key ¶
type Key struct {
Id string `json:"id,omitempty"` // ID
ProviderId string `json:"provider_id,omitempty"` // 提供商ID
Key string `json:"key,omitempty"` // 密钥
Weight int `json:"weight,omitempty"` // 权重
CurrentWeight int `json:"current_weight,omitempty"` // 当前权重
Models []string `json:"models,omitempty"` // 模型
ModelAgents []string `json:"model_agents,omitempty"` // 模型代理
IsNeverDisable bool `json:"is_never_disable,omitempty"` // 是否永不禁用
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
IsAutoDisabled bool `json:"is_auto_disabled,omitempty"` // 是否自动禁用
AutoDisabledReason string `json:"auto_disabled_reason,omitempty"` // 自动禁用原因
Rid int `json:"rid,omitempty"` // 代理商ID
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type LogGeneral ¶
type LogGeneral struct {
ReqModel *Model
RealModel *Model
ModelAgent *ModelAgent
FallbackModelAgent *ModelAgent
FallbackModel *Model
Key *Key
GeneralReq *GeneralReq
GeneralRes *GeneralRes
RetryInfo *mcommon.Retry
Spend mcommon.Spend
}
type LogImage ¶
type LogImage struct {
ReqModel *Model
RealModel *Model
ModelAgent *ModelAgent
FallbackModelAgent *ModelAgent
FallbackModel *Model
Key *Key
ImageReq *smodel.ImageGenerationRequest
ImageRes *ImageRes
RetryInfo *mcommon.Retry
Spend mcommon.Spend
}
type LogMidjourney ¶
type LogMidjourney struct {
ReqModel *Model
RealModel *Model
ModelAgent *ModelAgent
FallbackModelAgent *ModelAgent
FallbackModel *Model
Key *Key
Response MidjourneyResponse
RetryInfo *mcommon.Retry
Spend mcommon.Spend
}
type LogText ¶
type LogText struct {
ReqModel *Model
RealModel *Model
ModelAgent *ModelAgent
FallbackModelAgent *ModelAgent
FallbackModel *Model
Key *Key
CompletionsReq *smodel.ChatCompletionRequest
EmbeddingReq *smodel.EmbeddingRequest
ModerationReq *smodel.ModerationRequest
CompletionsRes *CompletionsRes
RetryInfo *mcommon.Retry
Spend mcommon.Spend
IsSmartMatch bool
}
type MidjourneyResponse ¶
type MidjourneyResponse struct {
smodel.MidjourneyResponse
ReqUrl string `json:"req_url"` // 请求地址
TaskId string `json:"task_id"` // 任务ID
Action string `json:"action"` // 动作[IMAGINE, UPSCALE, VARIATION, ZOOM, PAN, DESCRIBE, BLEND, SHORTEN, SWAP_FACE]
Prompt string `json:"prompt"` // 提示(提问)
PromptEn string `json:"prompt_en"` // 英文提示(提问)
ImageUrl string `json:"image_url"` // 图像地址
Progress string `json:"progress"` // 进度
Error error `json:"err"`
ConnTime int64 `json:"-"`
Duration int64 `json:"-"`
TotalTime int64 `json:"-"`
InternalTime int64 `json:"-"`
EnterTime int64 `json:"-"`
}
type Model ¶
type Model struct {
Id string `json:"id,omitempty"` // ID
ProviderId string `json:"provider_id,omitempty"` // 提供商ID
Name string `json:"name,omitempty"` // 模型名称
Model string `json:"model,omitempty"` // 模型
Type int `json:"type,omitempty"` // 模型类型[1:文生文, 2:文生图, 3:图生文, 4:图生图, 5:文生语音, 6:语音生文, 7:文本向量化, 8:视频生成, 100:多模态, 101:多模态实时, 102:多模态语音, 103:多模态向量化, 10000:通用]
BaseUrl string `json:"base_url,omitempty"` // 模型地址
Path string `json:"path,omitempty"` // 模型路径
IsEnablePresetConfig bool `json:"is_enable_preset_config,omitempty"` // 是否启用预设配置
PresetConfig common.PresetConfig `json:"preset_config,omitempty"` // 预设配置
TimeRules []*common.TimeRule `json:"time_rules,omitempty"` // 时段规则
Pricing common.Pricing `json:"pricing,omitempty"` // 定价
IsEnableDataPassthrough bool `json:"is_enable_data_passthrough,omitempty"` // 是否启用数据透传
ReqPassthroughParams []string `json:"req_passthrough_params,omitempty"` // 请求透传参数
ReqHeaderPassthroughMode int `json:"req_header_passthrough_mode,omitempty"` // 请求头透传模式[1:全量, 2:指定]
ReqHeaderPassthroughList []string `json:"req_header_passthrough_list,omitempty"` // 请求头透传白名单
ResPassthroughParams []string `json:"res_passthrough_params,omitempty"` // 响应透传参数
ResHeaderPassthroughMode int `json:"res_header_passthrough_mode,omitempty"` // 响应头透传模式[1:全量, 2:指定]
ResHeaderPassthroughList []string `json:"res_header_passthrough_list,omitempty"` // 响应头透传白名单
IsPublic bool `json:"is_public,omitempty"` // 是否公开
IsEnableModelAgent bool `json:"is_enable_model_agent,omitempty"` // 是否启用模型代理
LbStrategy int `json:"lb_strategy,omitempty"` // 代理负载均衡策略[1:轮询, 2:权重]
ModelAgents []string `json:"model_agents,omitempty"` // 模型代理
IsEnableForward bool `json:"is_enable_forward,omitempty"` // 是否启用模型转发
ForwardConfig *common.ForwardConfig `json:"forward_config,omitempty"` // 模型转发配置
IsEnableFallback bool `json:"is_enable_fallback,omitempty"` // 是否启用后备
FallbackConfig *common.FallbackConfig `json:"fallback_config,omitempty"` // 后备配置
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt int64 `json:"created_at,omitempty"` // 创建时间
UpdatedAt int64 `json:"updated_at,omitempty"` // 更新时间
}
type ModelAgent ¶
type ModelAgent struct {
Id string `json:"id,omitempty"` // ID
ProviderId string `json:"provider_id,omitempty"` // 提供商ID
Name string `json:"name,omitempty"` // 模型代理名称
BaseUrl string `json:"base_url,omitempty"` // 模型代理地址
Path string `json:"path,omitempty"` // 模型代理地址路径
Weight int `json:"weight,omitempty"` // 权重
CurrentWeight int `json:"current_weight,omitempty"` // 当前权重
BillingMethods []int `json:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
Models []string `json:"models,omitempty"` // 绑定模型
IsEnableModelReplace bool `json:"is_enable_model_replace,omitempty"` // 是否启用模型替换
ReplaceModels []string `json:"replace_models,omitempty"` // 替换模型
TargetModels []string `json:"target_models,omitempty"` // 目标模型
IsEnableHealthCheck bool `json:"is_enable_health_check,omitempty"` // 是否启用健康检查
IsRemoveAbnormalModel bool `json:"is_remove_abnormal_model,omitempty"` // 是否移除异常模型
AbnormalModels []string `json:"abnormal_models,omitempty"` // 异常模型
IsEnableSessionKeep bool `json:"is_enable_session_keep,omitempty"` // 是否启用会话保持
SessionKeepConfig *common.ModelAgentSessionKeep `json:"session_keep_config,omitempty"` // 会话保持配置
IsNeverDisable bool `json:"is_never_disable,omitempty"` // 是否永不禁用
LbStrategy int `json:"lb_strategy,omitempty"` // 密钥负载均衡策略[1:轮询, 2:权重]
IsEnableDataPassthrough bool `json:"is_enable_data_passthrough,omitempty"` // 是否启用数据透传
ReqPassthroughParams []string `json:"req_passthrough_params,omitempty"` // 请求透传参数
ReqHeaderPassthroughMode int `json:"req_header_passthrough_mode,omitempty"` // 请求头透传模式[1:全量, 2:指定]
ReqHeaderPassthroughList []string `json:"req_header_passthrough_list,omitempty"` // 请求头透传白名单
ResPassthroughParams []string `json:"res_passthrough_params,omitempty"` // 响应透传参数
ResHeaderPassthroughMode int `json:"res_header_passthrough_mode,omitempty"` // 响应头透传模式[1:全量, 2:指定]
ResHeaderPassthroughList []string `json:"res_header_passthrough_list,omitempty"` // 响应头透传白名单
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
IsAutoDisabled bool `json:"is_auto_disabled,omitempty"` // 是否自动禁用
AutoDisabledReason string `json:"auto_disabled_reason,omitempty"` // 自动禁用原因
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type Permission ¶
type Permission struct {
Id string `json:"id"`
Object string `json:"object"`
Created int `json:"created"`
AllowCreateEngine bool `json:"allow_create_engine"`
AllowSampling bool `json:"allow_sampling"`
AllowLogprobs bool `json:"allow_logprobs"`
AllowSearchIndices bool `json:"allow_search_indices"`
AllowView bool `json:"allow_view"`
AllowFineTuning bool `json:"allow_fine_tuning"`
Organization string `json:"organization"`
Group *string `json:"group"`
IsBlocking bool `json:"is_blocking"`
}
type Provider ¶
type Provider struct {
Id string `json:"id,omitempty"` // ID
Name string `json:"name,omitempty"` // 名称
Code string `json:"code,omitempty"` // 代码
Sort int `json:"sort,omitempty"` // 排序
IsPublic bool `json:"is_public,omitempty"` // 是否公开
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Creator string `json:"creator,omitempty"` // 创建人
Updater string `json:"updater,omitempty"` // 更新人
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type PubMessage ¶
type RealtimeRequest ¶
type RealtimeRequest struct {
Model string `json:"model"`
Messages []smodel.ChatCompletionMessage `json:"messages"`
}
type RealtimeResponse ¶
type RealtimeResponse struct {
Type string `json:"type"`
EventId string `json:"event_id"`
ItemId string `json:"item_id"`
ContentIndex int `json:"content_index"`
Text string `json:"text"`
Transcript string `json:"transcript"`
ResponseId string `json:"response_id"`
OutputIndex int `json:"output_index"`
Delta string `json:"delta"`
AudioEndMs int `json:"audio_end_ms"`
Item struct {
Id string `json:"id"`
Object string `json:"object"`
Type string `json:"type"`
Status string `json:"status"`
Role string `json:"role"`
Content []struct {
Type string `json:"type"`
Text string `json:"text"`
Transcript string `json:"transcript"`
} `json:"content"`
Name string `json:"name"`
CallId string `json:"call_id"`
Arguments any `json:"arguments"`
} `json:"item"`
Part struct {
Type string `json:"type"`
Text string `json:"text"`
Transcript string `json:"transcript"`
} `json:"part"`
Session struct {
Id string `json:"id"`
Object string `json:"object"`
Model string `json:"model"`
ExpiresAt int `json:"expires_at"`
Modalities []string `json:"modalities"`
Instructions string `json:"instructions"`
Voice string `json:"voice"`
TurnDetection struct {
Type string `json:"type"`
Threshold float64 `json:"threshold"`
PrefixPaddingMs int `json:"prefix_padding_ms"`
SilenceDurationMs int `json:"silence_duration_ms"`
} `json:"turn_detection"`
InputAudioFormat string `json:"input_audio_format"`
OutputAudioFormat string `json:"output_audio_format"`
InputAudioTranscription any `json:"input_audio_transcription"`
ToolChoice string `json:"tool_choice"`
Temperature float64 `json:"temperature"`
MaxResponseOutputTokens any `json:"max_response_output_tokens"`
Tools []any `json:"tools"`
} `json:"session"`
Response struct {
Object string `json:"object"`
Id string `json:"id"`
Status string `json:"status"`
StatusDetails any `json:"status_details"`
Output []struct {
Id string `json:"id"`
Object string `json:"object"`
Type string `json:"type"`
Status string `json:"status"`
Role string `json:"role"`
Content []struct {
Type string `json:"type"`
Text string `json:"text"`
Transcript string `json:"transcript"`
} `json:"content"`
Name string `json:"name"`
CallId string `json:"call_id"`
Arguments any `json:"arguments"`
} `json:"output"`
Usage struct {
TotalTokens int `json:"total_tokens"`
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
InputTokenDetails struct {
CachedTokens int `json:"cached_tokens"`
TextTokens int `json:"text_tokens"`
AudioTokens int `json:"audio_tokens"`
} `json:"input_token_details"`
OutputTokenDetails struct {
TextTokens int `json:"text_tokens"`
AudioTokens int `json:"audio_tokens"`
} `json:"output_token_details"`
} `json:"usage"`
} `json:"response"`
RateLimits []struct {
Name string `json:"name"`
Limit int `json:"limit"`
Remaining int `json:"remaining"`
ResetSeconds float64 `json:"reset_seconds"`
} `json:"rate_limits"`
Error struct {
Type string `json:"type"`
Code string `json:"code"`
Message string `json:"message"`
Param any `json:"param"`
EventId any `json:"event_id"`
} `json:"error"`
}
type Reseller ¶
type Reseller struct {
Id string `json:"id,omitempty"` // ID
UserId int `json:"user_id,omitempty"` // 用户ID
Name string `json:"name,omitempty"` // 姓名
Avatar string `json:"avatar,omitempty"` // 头像
Email string `json:"email,omitempty"` // 邮箱
Phone string `json:"phone,omitempty"` // 手机号
Quota int `json:"quota,omitempty"` // 剩余额度
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `json:"quota_expires_at,omitempty"` // 额度过期时间
Groups []string `json:"groups,omitempty"` // 分组权限
Remark string `json:"remark,omitempty"` // 备注
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
type SubMessage ¶
type User ¶
type User struct {
Id string `json:"id,omitempty"` // ID
UserId int `json:"user_id,omitempty"` // 用户ID
Name string `json:"name,omitempty"` // 姓名
Avatar string `json:"avatar,omitempty"` // 头像
Email string `json:"email,omitempty"` // 邮箱
Phone string `json:"phone,omitempty"` // 手机号
Quota int `json:"quota,omitempty"` // 剩余额度
UsedQuota int `json:"used_quota,omitempty"` // 已用额度
QuotaExpiresAt int64 `json:"quota_expires_at,omitempty"` // 额度过期时间
Groups []string `json:"groups,omitempty"` // 分组权限
Remark string `json:"remark,omitempty"` // 备注
Privacy *common.UserPrivacy `json:"privacy,omitempty"` // 隐私设置
Status int `json:"status,omitempty"` // 状态[1:正常, 2:禁用, -1:删除]
Rid int `json:"rid,omitempty"` // 代理商ID
CreatedAt string `json:"created_at,omitempty"` // 创建时间
UpdatedAt string `json:"updated_at,omitempty"` // 更新时间
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.