Documentation
¶
Index ¶
- type AdminLogin
- type Announcement
- type AudioPricing
- type AudioSpend
- type AutoDisabledError
- type AutoEnableError
- type AutoRetryError
- type Base
- type BatchTask
- type CachePricing
- type CacheSpend
- type Carousel
- type Core
- type Debug
- type Document
- type Email
- type EnableError
- type FallbackConfig
- type FileTask
- type ForwardConfig
- type GeneralApi
- type Http
- type ImageData
- type ImageGenerationPricing
- type ImageGenerationSpend
- type ImagePricing
- type ImageSpend
- type InviteConfig
- type Log
- type LogPrivacy
- type Message
- type Midjourney
- type MidjourneyPricing
- type MidjourneySpend
- type ModelAgentHealthCheckTask
- type ModelAgentSessionKeep
- type ModelAgentSessionKeepTask
- type ModelStat
- type NotRetryError
- type NotShieldError
- type Notice
- type OncePricing
- type OnceSpend
- type PresetConfig
- type Pricing
- type PrivacyLogFieldOption
- type Quota
- type QuotaTask
- type ResellerLoginRegister
- type ResellerShieldError
- type ResetTask
- type Retry
- type SearchPricing
- type SearchSpend
- type ServiceUnavailable
- type SessionKeepKeySource
- type SessionKeepRule
- type Spend
- type Statistics
- type Test
- type TestItem
- type TextPricing
- type TextSpend
- type Ticket
- type TimeRule
- type UserLoginRegister
- type UserPrivacy
- type UserShieldError
- type VideoGenerationPricing
- type VideoGenerationSpend
- type VideoPricing
- type VideoSpend
- type VideoTask
- type VisionPricing
- type VisionSpend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminLogin ¶
type AdminLogin struct {
AccountLogin bool `bson:"account_login" json:"account_login"` // 账密登录
EmailLogin bool `bson:"email_login" json:"email_login"` // 邮箱登录
EmailRetrieve bool `bson:"email_retrieve" json:"email_retrieve"` // 找回密码
SessionExpire int `bson:"session_expire" json:"session_expire"` // 会话过期, 单位: 秒
Path string `bson:"path" json:"path"` // 登录路径
}
type Announcement ¶
type AudioPricing ¶
type AudioSpend ¶
type AudioSpend struct {
Pricing *AudioPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
OutputTokens int `bson:"output_tokens,omitempty" json:"output_tokens,omitempty"` // 输出Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type AutoDisabledError ¶
type AutoEnableError ¶
type AutoEnableError struct {
Open bool `bson:"open" json:"open"` // 开关
EnableErrors []EnableError `bson:"enable_errors" json:"enable_errors"` // 启用错误
}
type AutoRetryError ¶ added in v2.4.0
type Base ¶
type Base struct {
ErrRetry int `bson:"err_retry" json:"err_retry"` // 错误重试次数
ModelKeyErrDisable int64 `bson:"model_key_err_disable" json:"model_key_err_disable"` // 模型密钥禁用次数
ModelAgentErrDisable int64 `bson:"model_agent_err_disable" json:"model_agent_err_disable"` // 模型代理禁用次数
ModelAgentKeyErrDisable int64 `bson:"model_agent_key_err_disable" json:"model_agent_key_err_disable"` // 模型代理密钥禁用次数
ShortTimeout time.Duration `bson:"short_timeout" json:"short_timeout"` // 短连接超时时间, 单位: 秒
LongTimeout time.Duration `bson:"long_timeout" json:"long_timeout"` // 长连接超时时间, 单位: 秒
AllowRequestAbort bool `bson:"allow_request_abort" json:"allow_request_abort"` // 允许请求中止
}
type CachePricing ¶
type CachePricing struct {
ServiceTier string `bson:"service_tier,omitempty" json:"service_tier,omitempty"` // 服务层[all:全部, default:默认, priority:优先, flex:弹性]
ReadRatio float64 `bson:"read_ratio" json:"read_ratio,omitempty"` // 读取/命中倍率
WriteRatio float64 `bson:"write_ratio" json:"write_ratio,omitempty"` // 写入倍率
Write5MRatio float64 `bson:"write_5m_ratio" json:"write_5m_ratio,omitempty"` // 5分钟缓存写入倍率
Write1HRatio float64 `bson:"write_1h_ratio" json:"write_1h_ratio,omitempty"` // 1小时缓存写入倍率
Mode string `bson:"mode,omitempty" json:"mode,omitempty"` // 模式[all:全部, thinking:思考, non_thinking:非思考]
Gt int `bson:"gt" json:"gt"` // 大于, 单位: k
Lte int `bson:"lte" json:"lte"` // 小于等于, 单位: k
}
type CacheSpend ¶
type CacheSpend struct {
Pricing *CachePricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
ReadTokens int `bson:"read_tokens,omitempty" json:"read_tokens,omitempty"` // 读取/命中Token数
WriteTokens int `bson:"write_tokens,omitempty" json:"write_tokens,omitempty"` // 写入Token数
Write5MTokens int `bson:"write_5m_tokens,omitempty" json:"write_5m_tokens,omitempty"` // 5分钟缓存写入Token数
Write1HTokens int `bson:"write_1h_tokens,omitempty" json:"write_1h_tokens,omitempty"` // 1小时缓存写入Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type Core ¶
type Core struct {
SecretKeyPrefix string `bson:"secret_key_prefix" json:"secret_key_prefix"` // 密钥前缀
ErrorPrefix string `bson:"error_prefix" json:"error_prefix"` // 错误码前缀
ReplaceErrorPrefixes []string `bson:"replace_error_prefixes" json:"replace_error_prefixes"` // 替换错误码前缀
ChannelPrefix string `bson:"channel_prefix" json:"channel_prefix"` // 通道前缀
}
type Email ¶
type Email struct {
Open bool `bson:"open" json:"open"` // 开关
Host string `bson:"host" json:"host"` // smtp.xxx.com
Port int `bson:"port" json:"port"` // 端口号
UserName string `bson:"user_name" json:"user_name"` // 登录账号
Password string `bson:"password" json:"password"` // 登录密码
FromName string `bson:"from_name" json:"from_name"` // 发送人名称
Interval time.Duration `bson:"interval" json:"interval"` // 发信间隔时间, 单位: 毫秒
}
type EnableError ¶
type FallbackConfig ¶
type FallbackConfig struct {
ModelAgent string `bson:"model_agent,omitempty" json:"model_agent,omitempty"` // 后备模型代理
ModelAgentName string `bson:"model_agent_name,omitempty" json:"model_agent_name,omitempty"` // 后备模型代理名称
Model string `bson:"model,omitempty" json:"model,omitempty"` // 后备模型
ModelName string `bson:"model_name,omitempty" json:"model_name,omitempty"` // 后备模型名称
}
type FileTask ¶
type FileTask struct {
Open bool `bson:"open" json:"open"` // 开关
Cron string `bson:"cron" json:"cron"` // CRON表达式
LockMinutes time.Duration `bson:"lock_minutes" json:"lock_minutes"` // 锁定时长, 单位: 分钟
IsEnableStorage bool `bson:"is_enable_storage" json:"is_enable_storage"` // 是否启用存储
StorageDir string `bson:"storage_dir" json:"storage_dir"` // 存储目录
StorageBaseUrl string `bson:"storage_base_url" json:"storage_base_url"` // 访问地址
StorageExpiresAt time.Duration `bson:"storage_expires_at" json:"storage_expires_at,omitempty"` // 存储过期时间, 单位: 分钟
StorageExpiredDelete bool `bson:"storage_expired_delete" json:"storage_expired_delete"` // 存储过期删除开关
}
type ForwardConfig ¶
type ForwardConfig struct {
ForwardRule int `bson:"forward_rule,omitempty" json:"forward_rule,omitempty"` // 转发规则[1:全部转发, 2:按关键字, 3:内容长度, 4:已用额度]
ForwardMode int `bson:"forward_mode,omitempty" json:"forward_mode,omitempty"` // 转发模式[1:固定, 2:轮询]
MatchRule []int `bson:"match_rule,omitempty" json:"match_rule,omitempty"` // 转发规则为2时的匹配规则[1:智能匹配, 2:正则匹配]
TargetModel string `bson:"target_model,omitempty" json:"target_model,omitempty"` // 转发规则为[1,3,4]时的目标模型
DecisionModel string `bson:"decision_model,omitempty" json:"decision_model,omitempty"` // 转发规则为2时并且匹配规则为1时的判定模型
Keywords []string `bson:"keywords,omitempty" json:"keywords,omitempty"` // 转发规则为2时的关键字
TargetModels []string `bson:"target_models,omitempty" json:"target_models,omitempty"` // 转发规则为[1,2]时的目标模型
ContentLength int `bson:"content_length,omitempty" json:"content_length,omitempty"` // 转发规则为3时的内容长度
UsedQuota float64 `bson:"used_quota,omitempty" json:"used_quota,omitempty"` // 转发规则为4时的已用额度
TargetModelName string `bson:"-" json:"target_model_name,omitempty"` // 转发规则为[1,3,4]时的目标模型名称
DecisionModelName string `bson:"-" json:"decision_model_name,omitempty"` // 转发规则为2时并且匹配规则为1时的判定模型名称
TargetModelNames []string `bson:"-" json:"target_model_names,omitempty"` // 转发规则为[1,2]时的目标模型名称
}
type GeneralApi ¶
type ImageGenerationPricing ¶
type ImageGenerationPricing struct {
Quality string `bson:"quality,omitempty" json:"quality,omitempty"` // 质量[high, medium, low, hd, standard]
Width int `bson:"width,omitempty" json:"width,omitempty"` // 宽度
Height int `bson:"height,omitempty" json:"height,omitempty"` // 高度
OnceRatio float64 `bson:"once_ratio" json:"once_ratio,omitempty"` // 一次倍率
IsDefault bool `bson:"is_default,omitempty" json:"is_default,omitempty"` // 是否默认选项
}
type ImageGenerationSpend ¶
type ImageGenerationSpend struct {
Pricing *ImageGenerationPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
N int `bson:"n,omitempty" json:"n,omitempty"` // 图像数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type ImagePricing ¶
type ImageSpend ¶
type ImageSpend struct {
Pricing *ImagePricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
OutputTokens int `bson:"output_tokens,omitempty" json:"output_tokens,omitempty"` // 输出Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type InviteConfig ¶ added in v2.4.0
type InviteConfig struct {
RewardQuota int `bson:"reward_quota,omitempty" json:"reward_quota,omitempty"` // 邀请人收益额度
GrantQuota int `bson:"grant_quota,omitempty" json:"grant_quota,omitempty"` // 被邀请人额外赠送额度
MinApplyQuota int `bson:"min_apply_quota,omitempty" json:"min_apply_quota,omitempty"` // 最低申请入账额度
DailyLimit int `bson:"daily_limit,omitempty" json:"daily_limit,omitempty"` // 单日邀请收益次数上限
TotalLimit int `bson:"total_limit,omitempty" json:"total_limit,omitempty"` // 累计邀请收益次数上限
IpDailyLimit int `bson:"ip_daily_limit,omitempty" json:"ip_daily_limit,omitempty"` // 同IP每日邀请注册上限
IpTotalLimit int `bson:"ip_total_limit,omitempty" json:"ip_total_limit,omitempty"` // 同IP累计邀请注册上限
IpPerInviterLimit int `bson:"ip_per_inviter_limit,omitempty" json:"ip_per_inviter_limit,omitempty"` // 同IP+同邀请人注册上限
IpLimitAction string `bson:"ip_limit_action,omitempty" json:"ip_limit_action,omitempty"` // IP限制触发动作[block:拒绝注册, silent:允许注册但不发放额度]
RuleText string `bson:"rule_text,omitempty" json:"rule_text,omitempty"` // 邀请规则说明
InvalidCodeAction string `bson:"invalid_code_action,omitempty" json:"invalid_code_action,omitempty"` // 无效邀请码处理方式
RechargeRebateEnabled bool `bson:"recharge_rebate_enabled,omitempty" json:"recharge_rebate_enabled,omitempty"` // 是否开启邀请充值返利
RechargeRebateFirstEnabled bool `bson:"recharge_rebate_first_enabled,omitempty" json:"recharge_rebate_first_enabled,omitempty"` // 首次充值返利是否开启
RechargeRebateFirstType string `bson:"recharge_rebate_first_type,omitempty" json:"recharge_rebate_first_type,omitempty"` // 首次充值返利类型[percent:百分比, fixed:固定额度]
RechargeRebateFirstRate float64 `bson:"recharge_rebate_first_rate,omitempty" json:"recharge_rebate_first_rate,omitempty"` // 首次充值返利比例
RechargeRebateFirstQuota int `bson:"recharge_rebate_first_quota,omitempty" json:"recharge_rebate_first_quota,omitempty"` // 首次充值固定返利额度
RechargeRebateSecondEnabled bool `bson:"recharge_rebate_second_enabled,omitempty" json:"recharge_rebate_second_enabled,omitempty"` // 后续充值返利是否开启
RechargeRebateSecondType string `bson:"recharge_rebate_second_type,omitempty" json:"recharge_rebate_second_type,omitempty"` // 后续充值返利类型[percent:百分比, fixed:固定额度]
RechargeRebateSecondRate float64 `bson:"recharge_rebate_second_rate,omitempty" json:"recharge_rebate_second_rate,omitempty"` // 后续充值返利比例
RechargeRebateSecondQuota int `bson:"recharge_rebate_second_quota,omitempty" json:"recharge_rebate_second_quota,omitempty"` // 后续充值固定返利额度
}
type Log ¶
type Log struct {
Open bool `bson:"open" json:"open"` // 开关
TextRecords []string `bson:"text_records" json:"text_records"` // 文本日志记录内容
TextReserve time.Duration `bson:"text_reserve" json:"text_reserve"` // 文本日志保留天数
ImageReserve time.Duration `bson:"image_reserve" json:"image_reserve"` // 绘图日志保留天数
AudioReserve time.Duration `bson:"audio_reserve" json:"audio_reserve"` // 音频日志保留天数
VideoReserve time.Duration `bson:"video_reserve" json:"video_reserve"` // 视频日志保留天数
FileReserve time.Duration `bson:"file_reserve" json:"file_reserve"` // 文件日志保留天数
BatchReserve time.Duration `bson:"batch_reserve" json:"batch_reserve"` // 批处理日志保留天数
GeneralReserve time.Duration `bson:"general_reserve" json:"general_reserve"` // 通用日志保留天数
Status []int `bson:"status" json:"status"` // 删除日志状态
Cron string `bson:"cron" json:"cron"` // CRON表达式
Privacy *LogPrivacy `bson:"privacy" json:"privacy"` // 日志隐私
}
type LogPrivacy ¶ added in v2.4.0
type LogPrivacy struct {
IsEnableRequest bool `bson:"is_enable_request" json:"is_enable_request"` // 是否开放请求内容用户配置
IsDefaultEnableRequest bool `bson:"is_default_enable_request" json:"is_default_enable_request"` // 是否默认记录请求内容
RequestPrivacyFields []PrivacyLogFieldOption `bson:"request_privacy_fields" json:"request_privacy_fields"` // 请求内容字段
IsEnableResponse bool `bson:"is_enable_response" json:"is_enable_response"` // 是否开放响应内容用户配置
IsDefaultEnableResponse bool `bson:"is_default_enable_response" json:"is_default_enable_response"` // 是否默认记录响应内容
ResponsePrivacyFields []PrivacyLogFieldOption `bson:"response_privacy_fields" json:"response_privacy_fields"` // 响应内容字段
IsEnableResource bool `bson:"is_enable_resource" json:"is_enable_resource"` // 是否开放资源链接用户配置
IsDefaultEnableResource bool `bson:"is_default_enable_resource" json:"is_default_enable_resource"` // 是否默认记录资源链接
ResourcePrivacyFields []PrivacyLogFieldOption `bson:"resource_privacy_fields" json:"resource_privacy_fields"` // 资源链接字段
IsEnableNetwork bool `bson:"is_enable_network" json:"is_enable_network"` // 是否开放网络信息用户配置
IsDefaultEnableNetwork bool `bson:"is_default_enable_network" json:"is_default_enable_network"` // 是否默认记录网络信息
NetworkPrivacyFields []PrivacyLogFieldOption `bson:"network_privacy_fields" json:"network_privacy_fields"` // 网络信息字段
}
type Message ¶
type Message struct {
Role string `bson:"role,omitempty" json:"role,omitempty"` // 角色
Content string `bson:"content,omitempty" json:"content,omitempty"` // 内容
Refusal string `bson:"refusal,omitempty" json:"refusal,omitempty"`
Name string `bson:"name,omitempty" json:"name,omitempty"`
FunctionCall *smodel.FunctionCall `bson:"function_call,omitempty" json:"function_call,omitempty"`
ToolCalls []smodel.ToolCall `bson:"tool_calls,omitempty" json:"tool_calls,omitempty"`
ToolCallId string `bson:"tool_call_id,omitempty" json:"tool_call_id,omitempty"`
Audio *smodel.Audio `bson:"audio,omitempty" json:"audio,omitempty"`
}
type Midjourney ¶
type Midjourney struct {
Open bool `bson:"open" json:"open"` // 开关
CdnUrl string `bson:"cdn_url" json:"cdn_url"`
ApiBaseUrl string `bson:"api_base_url" json:"api_base_url"`
ApiSecret string `bson:"api_secret" json:"api_secret"`
ApiSecretHeader string `bson:"api_secret_header" json:"api_secret_header"`
CdnOriginalUrl string `bson:"cdn_original_url" json:"cdn_original_url"`
}
type MidjourneyPricing ¶
type MidjourneyPricing struct {
Name string `bson:"name,omitempty" json:"name,omitempty"` // 名称
Action string `bson:"action,omitempty" json:"action,omitempty"` // 动作[IMAGINE, UPSCALE, VARIATION, ZOOM, PAN, DESCRIBE, BLEND, SHORTEN, SWAP_FACE]
Path string `bson:"path,omitempty" json:"path,omitempty"` // 路径
OnceRatio float64 `bson:"once_ratio" json:"once_ratio,omitempty"` // 一次倍率
}
type MidjourneySpend ¶
type MidjourneySpend struct {
Pricing *MidjourneyPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type ModelAgentHealthCheckTask ¶ added in v2.3.0
type ModelAgentHealthCheckTask struct {
Open bool `bson:"open" json:"open"` // 开关
Cron string `bson:"cron" json:"cron"` // CRON表达式
LockMinutes time.Duration `bson:"lock_minutes" json:"lock_minutes"` // 锁定时长, 单位: 分钟
ModelAgents []string `bson:"model_agents" json:"model_agents"` // 模型代理
Models []string `bson:"models" json:"models"` // 测试模型
DisableCount int64 `bson:"disable_count" json:"disable_count"` // 失败禁用次数
RemoveModelCount int64 `bson:"remove_model_count" json:"remove_model_count"` // 模型移除次数
AutoRecover bool `bson:"auto_recover" json:"auto_recover"` // 自动恢复
RecoverCount int64 `bson:"recover_count" json:"recover_count"` // 成功恢复次数
RecoverModelCount int64 `bson:"recover_model_count" json:"recover_model_count"` // 模型恢复次数
StatPeriod time.Duration `bson:"stat_period" json:"stat_period"` // 统计周期, 单位: 分钟
SmartCheck bool `bson:"smart_check" json:"smart_check"` // 智能检查
TestMethod int `bson:"test_method" json:"test_method"` // 测试方式[1:FastAPI, 2:代理直连, 3:自定义]
BaseUrl string `bson:"base_url" json:"base_url"` // API接口地址
Key string `bson:"key" json:"key"` // API接口密钥
}
type ModelAgentSessionKeep ¶ added in v2.3.0
type ModelAgentSessionKeep struct {
Open bool `bson:"open" json:"open"` // 开关
Mode string `bson:"mode" json:"mode"` // 模式[rule:按规则, user:按用户]
Ttl time.Duration `bson:"ttl" json:"ttl"` // 会话保持时长, 单位: 秒
FailTtl time.Duration `bson:"fail_ttl" json:"fail_ttl"` // 失败保持时长, 单位: 秒
FailSwitchThreshold int64 `bson:"fail_switch_threshold" json:"fail_switch_threshold"` // 失败切换阈值
UserLimit int64 `bson:"user_limit" json:"user_limit"` // 单用户上限
AgentLimit int64 `bson:"agent_limit" json:"agent_limit"` // 单代理上限
GlobalLimit int64 `bson:"global_limit" json:"global_limit"` // 全局总上限
Rules []SessionKeepRule `bson:"rules" json:"rules"` // Mode="rule"时的规则列表
EnableSystemPromptHash bool `bson:"enable_system_prompt_hash" json:"enable_system_prompt_hash"` // Mode="rule"时, 无规则命中则用SystemPrompt哈希兜底
}
type ModelAgentSessionKeepTask ¶ added in v2.3.0
type ModelStat ¶
type ModelStat struct {
ModelId string `bson:"model_id,omitempty" json:"model_id,omitempty"` // 模型ID
Model string `bson:"model,omitempty" json:"model,omitempty"` // 模型
Total int `bson:"total,omitempty" json:"total,omitempty"` // 总数
Tokens float64 `bson:"tokens,omitempty" json:"tokens,omitempty"` // 令牌数
Abnormal int `bson:"abnormal,omitempty" json:"abnormal,omitempty"` // 异常数
AbnormalTokens float64 `bson:"abnormal_tokens,omitempty" json:"abnormal_tokens,omitempty"` // 异常令牌数
}
type NotRetryError ¶
type NotShieldError ¶
type OncePricing ¶
type OncePricing struct {
OnceRatio float64 `bson:"once_ratio" json:"once_ratio,omitempty"` // 一次倍率
}
type OnceSpend ¶
type OnceSpend struct {
Pricing *OncePricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
OutputTokens int `bson:"output_tokens,omitempty" json:"output_tokens,omitempty"` // 输出Token数
}
type PresetConfig ¶
type PresetConfig struct {
IsSupportSystemRole bool `bson:"is_support_system_role" json:"is_support_system_role,omitempty"` // 是否支持system角色
SystemRolePrompt string `bson:"system_role_prompt" json:"system_role_prompt,omitempty"` // system角色预设提示词
MinTokens int `bson:"min_tokens" json:"min_tokens,omitempty"` // max_tokens取值的最小值
MaxTokens int `bson:"max_tokens" json:"max_tokens,omitempty"` // max_tokens取值的最大值
IsSupportStream bool `bson:"is_support_stream" json:"is_support_stream,omitempty"` // 是否支持流式
}
type Pricing ¶
type Pricing struct {
CurrencySymbol string `bson:"currency_symbol,omitempty" json:"currency_symbol,omitempty"` // 货币符号
BillingRule int `bson:"billing_rule,omitempty" json:"billing_rule,omitempty"` // 计费规则[1:按官方, 2:按系统]
BillingMethods []int `bson:"billing_methods,omitempty" json:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
BillingItems []string `bson:"billing_items,omitempty" json:"billing_items,omitempty"` // 计费项[text:文本, text_cache:文本缓存, tiered_text:阶梯文本, tiered_text_cache:阶梯文本缓存, image:图像, image_generation:图像生成, image_cache:图像缓存, vision:识图, audio:音频, audio_cache:音频缓存, video:视频, video_generation:视频生成, video_cache:视频缓存, search:搜索, midjourney:Midjourney, once:一次]
Text []*TextPricing `bson:"text,omitempty" json:"text,omitempty"` // 文本
TextCache []*CachePricing `bson:"text_cache,omitempty" json:"text_cache,omitempty"` // 文本缓存
TieredText []*TextPricing `bson:"tiered_text,omitempty" json:"tiered_text,omitempty"` // 阶梯文本
TieredTextCache []*CachePricing `bson:"tiered_text_cache,omitempty" json:"tiered_text_cache,omitempty"` // 阶梯文本缓存
Image *ImagePricing `bson:"image,omitempty" json:"image,omitempty"` // 图像
ImageGeneration []*ImageGenerationPricing `bson:"image_generation,omitempty" json:"image_generation,omitempty"` // 图像生成
ImageCache *CachePricing `bson:"image_cache,omitempty" json:"image_cache,omitempty"` // 图像缓存
Vision []*VisionPricing `bson:"vision,omitempty" json:"vision,omitempty"` // 识图
Audio *AudioPricing `bson:"audio,omitempty" json:"audio,omitempty"` // 音频
AudioCache *CachePricing `bson:"audio_cache,omitempty" json:"audio_cache,omitempty"` // 音频缓存
Video *VideoPricing `bson:"video,omitempty" json:"video,omitempty"` // 视频
VideoGeneration []*VideoGenerationPricing `bson:"video_generation,omitempty" json:"video_generation,omitempty"` // 视频生成
VideoCache *CachePricing `bson:"video_cache,omitempty" json:"video_cache,omitempty"` // 视频缓存
Search []*SearchPricing `bson:"search,omitempty" json:"search,omitempty"` // 搜索
Midjourney []*MidjourneyPricing `bson:"midjourney,omitempty" json:"midjourney,omitempty"` // Midjourney
Once *OncePricing `bson:"once,omitempty" json:"once,omitempty"` // 一次
}
type PrivacyLogFieldOption ¶ added in v2.4.0
type PrivacyLogFieldOption struct {
Key string `bson:"key" json:"key"` // 字段标识
Label string `bson:"label" json:"label"` // 展示名称
Description string `bson:"description" json:"description,omitempty"` // 描述
LogTypes []string `bson:"log_types" json:"log_types,omitempty"` // 日志类型
Enabled bool `bson:"enabled" json:"enabled"` // 是否启用
Sort int `bson:"sort" json:"sort,omitempty"` // 排序
}
type Quota ¶
type Quota struct {
Warning bool `bson:"warning" json:"warning"` // 额度预警开关
Threshold int `bson:"threshold" json:"threshold"` // 额度预警阈值, 单位: $
ExpiredWarning bool `bson:"expired_warning" json:"expired_warning"` // 额度过期预警开关
ExpiredThreshold time.Duration `bson:"expired_threshold" json:"expired_threshold"` // 额度过期预警阈值, 单位: 天
ExhaustedNotice bool `bson:"exhausted_notice" json:"exhausted_notice"` // 额度耗尽通知开关
ExpiredNotice bool `bson:"expired_notice" json:"expired_notice"` // 额度过期通知开关
ExpiredClear bool `bson:"expired_clear" json:"expired_clear"` // 额度过期清零开关
ExpiredClearDefer time.Duration `bson:"expired_clear_defer" json:"expired_clear_defer"` // 额度过期清零延迟, 单位: 分钟
}
type ResellerLoginRegister ¶
type ResellerLoginRegister struct {
AccountLogin bool `bson:"account_login" json:"account_login"` // 账密登录
EmailLogin bool `bson:"email_login" json:"email_login"` // 邮箱登录
EmailRegister bool `bson:"email_register" json:"email_register"` // 邮箱注册
EmailRetrieve bool `bson:"email_retrieve" json:"email_retrieve"` // 找回密码
SessionExpire int `bson:"session_expire" json:"session_expire"` // 会话过期, 单位: 秒
}
type ResellerShieldError ¶
type SearchPricing ¶
type SearchSpend ¶
type SearchSpend struct {
Pricing *SearchPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type ServiceUnavailable ¶
type ServiceUnavailable struct {
}
type SessionKeepKeySource ¶ added in v2.4.0
type SessionKeepRule ¶ added in v2.4.0
type SessionKeepRule struct {
Name string `bson:"name" json:"name"` // 规则名称
ModelRegex []string `bson:"model_regex" json:"model_regex"` // 模型名正则过滤
PathRegex []string `bson:"path_regex" json:"path_regex"` // 请求路径正则过滤
KeySources []SessionKeepKeySource `bson:"key_sources" json:"key_sources"` // Key提取源(有序, 首个命中生效)
Transform string `bson:"transform" json:"transform"` // 值转换[none, md5, prefix:N]
}
type Spend ¶
type Spend struct {
CurrencySymbol string `bson:"currency_symbol,omitempty" json:"currency_symbol,omitempty"` // 货币符号
ModelTimeRule *TimeRule `bson:"model_time_rule,omitempty" json:"model_time_rule,omitempty"` // 模型时段规则
BillingRule int `bson:"billing_rule,omitempty" json:"billing_rule,omitempty"` // 计费规则[1:按官方, 2:按系统]
BillingMethods []int `bson:"billing_methods,omitempty" json:"billing_methods,omitempty"` // 计费方式[1:按Tokens, 2:按次]
BillingItems []string `bson:"billing_items,omitempty" json:"billing_items,omitempty"` // 计费项[text:文本, text_cache:文本缓存, tiered_text:阶梯文本, tiered_text_cache:阶梯文本缓存, image:图像, image_generation:图像生成, image_cache:图像缓存, vision:识图, audio:音频, audio_cache:音频缓存, video:视频, video_generation:视频生成, video_cache:视频缓存, search:搜索, midjourney:Midjourney, once:一次]
Text *TextSpend `bson:"text,omitempty" json:"text,omitempty"` // 文本
TextCache *CacheSpend `bson:"text_cache,omitempty" json:"text_cache,omitempty"` // 文本缓存
TieredText *TextSpend `bson:"tiered_text,omitempty" json:"tiered_text,omitempty"` // 阶梯文本
TieredTextCache *CacheSpend `bson:"tiered_text_cache,omitempty" json:"tiered_text_cache,omitempty"` // 阶梯文本缓存
Image *ImageSpend `bson:"image,omitempty" json:"image,omitempty"` // 图像
ImageGeneration *ImageGenerationSpend `bson:"image_generation,omitempty" json:"image_generation,omitempty"` // 图像生成
ImageCache *CacheSpend `bson:"image_cache,omitempty" json:"image_cache,omitempty"` // 图像缓存
Vision *VisionSpend `bson:"vision,omitempty" json:"vision,omitempty"` // 识图
Audio *AudioSpend `bson:"audio,omitempty" json:"audio,omitempty"` // 音频
AudioCache *CacheSpend `bson:"audio_cache,omitempty" json:"audio_cache,omitempty"` // 音频缓存
Video *VideoSpend `bson:"video,omitempty" json:"video,omitempty"` // 视频
VideoGeneration *VideoGenerationSpend `bson:"video_generation,omitempty" json:"video_generation,omitempty"` // 视频生成
VideoCache *CacheSpend `bson:"video_cache,omitempty" json:"video_cache,omitempty"` // 视频缓存
Search *SearchSpend `bson:"search,omitempty" json:"search,omitempty"` // 搜索
Midjourney *MidjourneySpend `bson:"midjourney,omitempty" json:"midjourney,omitempty"` // Midjourney
Once *OnceSpend `bson:"once,omitempty" json:"once,omitempty"` // 一次
GroupId string `bson:"group_id,omitempty" json:"group_id,omitempty"` // 分组ID
GroupName string `bson:"group_name,omitempty" json:"group_name,omitempty"` // 分组名称
GroupTimeRule *TimeRule `bson:"group_time_rule,omitempty" json:"group_time_rule,omitempty"` // 分组时段规则
GroupBillingMethods []int `bson:"group_billing_methods,omitempty" json:"group_billing_methods,omitempty"` // 分组计费方式[1:按Tokens, 2:按次]
TotalSpendTokens float64 `bson:"total_spend_tokens,omitempty" json:"total_spend_tokens,omitempty"` // 总花费Token数
}
type Statistics ¶
type TextPricing ¶
type TextPricing struct {
ServiceTier string `bson:"service_tier,omitempty" json:"service_tier,omitempty"` // 服务层[all:全部, default:默认, priority:优先, flex:弹性]
InputRatio float64 `bson:"input_ratio" json:"input_ratio,omitempty"` // 输入倍率
OutputRatio float64 `bson:"output_ratio" json:"output_ratio,omitempty"` // 输出倍率
ReasoningRatio float64 `bson:"reasoning_ratio" json:"reasoning_ratio,omitempty"` // 思考倍率
Mode string `bson:"mode,omitempty" json:"mode,omitempty"` // 模式[all:全部, thinking:思考, non_thinking:非思考]
Gt int `bson:"gt" json:"gt"` // 大于, 单位: k
Lte int `bson:"lte" json:"lte"` // 小于等于, 单位: k
}
type TextSpend ¶
type TextSpend struct {
Pricing *TextPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
OutputTokens int `bson:"output_tokens,omitempty" json:"output_tokens,omitempty"` // 输出Token数
ReasoningTokens int `bson:"reasoning_tokens,omitempty" json:"reasoning_tokens,omitempty"` // 思考Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type Ticket ¶ added in v2.4.0
type Ticket struct {
Open bool `bson:"open" json:"open"` // 开关
Notice bool `bson:"notice" json:"notice"` // 通知提醒
Cron string `bson:"cron" json:"cron"` // CRON表达式
LockMinutes time.Duration `bson:"lock_minutes" json:"lock_minutes"` // 锁定时长, 单位: 分钟
AutoCloseDays time.Duration `bson:"auto_close_days" json:"auto_close_days"` // 自动关闭天数
}
type TimeRule ¶ added in v2.2.0
type TimeRule struct {
TimeType string `bson:"time_type,omitempty" json:"time_type,omitempty"` // 时段类型[all:全天, weekday:工作日, weekend:周末, custom:自定义]
Name string `bson:"name,omitempty" json:"name,omitempty"` // 时段名称
StartTime int64 `bson:"start_time,omitempty" json:"start_time"` // 开始时间
EndTime int64 `bson:"end_time,omitempty" json:"end_time"` // 结束时间
Discount float64 `bson:"discount,omitempty" json:"discount,omitempty"` // 折扣
Days []int `bson:"days,omitempty" json:"days,omitempty"` // 适用日
DayMode string `bson:"day_mode,omitempty" json:"day_mode,omitempty"` // 日期模式[week:按周, month:按月]
Priority int `bson:"priority,omitempty" json:"priority,omitempty"` // 优先级, 数字越大越优先
Models []string `bson:"models,omitempty" json:"models,omitempty"` // 模型
ModelNames []string `bson:"-" json:"model_names,omitempty"` // 模型名称
}
type UserLoginRegister ¶
type UserLoginRegister struct {
AccountLogin bool `bson:"account_login" json:"account_login"` // 账密登录
EmailLogin bool `bson:"email_login" json:"email_login"` // 邮箱登录
EmailRegister bool `bson:"email_register" json:"email_register"` // 邮箱注册
EmailRetrieve bool `bson:"email_retrieve" json:"email_retrieve"` // 找回密码
SessionExpire int `bson:"session_expire" json:"session_expire"` // 会话过期, 单位: 秒
}
type UserPrivacy ¶ added in v2.4.0
type UserPrivacy struct {
IsConfigured bool `bson:"is_configured" json:"is_configured"` // 是否已配置
LogRequestContent bool `bson:"log_request_content" json:"log_request_content"` // 记录请求内容
LogResponseContent bool `bson:"log_response_content" json:"log_response_content"` // 记录响应内容
LogResourceUrl bool `bson:"log_resource_url" json:"log_resource_url"` // 记录资源链接
LogClientIp bool `bson:"log_client_ip" json:"log_client_ip"` // 记录客户端IP
LogRequestFields []string `bson:"log_request_fields" json:"log_request_fields"` // 请求内容字段
LogResponseFields []string `bson:"log_response_fields" json:"log_response_fields"` // 响应内容字段
LogResourceFields []string `bson:"log_resource_fields" json:"log_resource_fields"` // 资源链接字段
LogNetworkFields []string `bson:"log_network_fields" json:"log_network_fields"` // 网络信息字段
}
type UserShieldError ¶
type VideoGenerationPricing ¶
type VideoGenerationPricing struct {
Mode string `bson:"mode,omitempty" json:"mode,omitempty"` // 模式[all:全部, no_video_input:不含视频, has_video_input:包含视频]
Width int `bson:"width,omitempty" json:"width,omitempty"` // 宽度
Height int `bson:"height,omitempty" json:"height,omitempty"` // 高度
OnceRatio float64 `bson:"once_ratio" json:"once_ratio,omitempty"` // 一次倍率
IsDefault bool `bson:"is_default,omitempty" json:"is_default,omitempty"` // 是否默认选项
}
type VideoGenerationSpend ¶
type VideoGenerationSpend struct {
Pricing *VideoGenerationPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
Seconds int `bson:"seconds,omitempty" json:"seconds,omitempty"` // 秒数
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type VideoPricing ¶
type VideoSpend ¶
type VideoSpend struct {
Pricing *VideoPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
InputTokens int `bson:"input_tokens,omitempty" json:"input_tokens,omitempty"` // 输入Token数
OutputTokens int `bson:"output_tokens,omitempty" json:"output_tokens,omitempty"` // 输出Token数
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
type VideoTask ¶
type VideoTask struct {
Open bool `bson:"open" json:"open"` // 开关
Cron string `bson:"cron" json:"cron"` // CRON表达式
LockMinutes time.Duration `bson:"lock_minutes" json:"lock_minutes"` // 锁定时长, 单位: 分钟
IsEnableStorage bool `bson:"is_enable_storage" json:"is_enable_storage"` // 是否启用存储
StorageDir string `bson:"storage_dir" json:"storage_dir"` // 存储目录
StorageBaseUrl string `bson:"storage_base_url" json:"storage_base_url"` // 访问地址
StorageExpiresAt time.Duration `bson:"storage_expires_at" json:"storage_expires_at,omitempty"` // 存储过期时间, 单位: 分钟
StorageExpiredDelete bool `bson:"storage_expired_delete" json:"storage_expired_delete"` // 存储过期删除开关
}
type VisionPricing ¶
type VisionSpend ¶
type VisionSpend struct {
Pricing *VisionPricing `bson:"pricing,omitempty" json:"pricing,omitempty"` // 定价
SpendTokens float64 `bson:"spend_tokens,omitempty" json:"spend_tokens,omitempty"` // 花费Token数
}
Click to show internal directories.
Click to hide internal directories.