pub struct ProviderMeta {Show 21 fields
pub apply_common_config: Option<bool>,
pub codex_official: Option<bool>,
pub custom_endpoints: HashMap<String, CustomEndpoint>,
pub usage_script: Option<UsageScript>,
pub endpoint_auto_select: Option<bool>,
pub is_partner: Option<bool>,
pub partner_promotion_key: Option<String>,
pub cost_multiplier: Option<String>,
pub pricing_model_source: Option<String>,
pub limit_daily_usd: Option<String>,
pub limit_monthly_usd: Option<String>,
pub test_config: Option<ProviderTestConfig>,
pub proxy_config: Option<ProviderProxyConfig>,
pub api_format: Option<String>,
pub prompt_cache_key: Option<String>,
pub auth_binding: Option<AuthBinding>,
pub api_key_field: Option<String>,
pub live_config_managed: Option<bool>,
pub codex_model_provider_key: Option<String>,
pub provider_type: Option<String>,
pub github_account_id: Option<String>,
}Expand description
供应商元数据
Fields§
§apply_common_config: Option<bool>是否在写入 live 配置时合并通用配置片段
codex_official: Option<bool>Codex 官方供应商标记(官方无需填写 API Key,使用 codex login 凭证)
custom_endpoints: HashMap<String, CustomEndpoint>自定义端点列表(按 URL 去重存储)
usage_script: Option<UsageScript>用量查询脚本配置
endpoint_auto_select: Option<bool>请求地址管理:测速后自动选择最佳端点
is_partner: Option<bool>合作伙伴标记(前端使用 isPartner,保持字段名一致)
partner_promotion_key: Option<String>合作伙伴促销 key,用于识别 PackyCode 等特殊供应商
cost_multiplier: Option<String>成本倍数(用于计算实际成本)
pricing_model_source: Option<String>计费模式来源(response/request)
limit_daily_usd: Option<String>每日消费限额(USD)
limit_monthly_usd: Option<String>每月消费限额(USD)
test_config: Option<ProviderTestConfig>供应商单独的模型测试配置
proxy_config: Option<ProviderProxyConfig>供应商单独的代理配置
api_format: Option<String>Claude API 格式(仅 Claude 供应商使用)
- “anthropic”: 原生 Anthropic Messages API,直接透传
- “openai_chat”: OpenAI Chat Completions 格式,需要转换
- “openai_responses”: OpenAI Responses API 格式,需要转换
prompt_cache_key: Option<String>OpenAI 兼容端点使用的 prompt cache key。
auth_binding: Option<AuthBinding>通用认证绑定(provider_config / managed_account)
api_key_field: Option<String>Claude 认证字段名(“ANTHROPIC_AUTH_TOKEN” 或 “ANTHROPIC_API_KEY”)
live_config_managed: Option<bool>累加模式应用中,该 provider 是否已写入 live config。
None 表示旧数据/未知状态,Some(false) 表示明确仅存在于数据库中。
codex_model_provider_key: Option<String>Codex live config 中 [model_providers.<key>] 的稳定外部键。
provider_type: Option<String>供应商类型标识(用于特殊供应商检测)
- “github_copilot”: GitHub Copilot 供应商
github_account_id: Option<String>GitHub Copilot 关联账号 ID(仅 github_copilot 供应商使用) 用于多账号支持,关联到特定的 GitHub 账号
Implementations§
Source§impl ProviderMeta
impl ProviderMeta
pub fn managed_account_id_for(&self, auth_provider: &str) -> Option<String>
Trait Implementations§
Source§impl Clone for ProviderMeta
impl Clone for ProviderMeta
Source§fn clone(&self) -> ProviderMeta
fn clone(&self) -> ProviderMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderMeta
impl Debug for ProviderMeta
Source§impl Default for ProviderMeta
impl Default for ProviderMeta
Source§fn default() -> ProviderMeta
fn default() -> ProviderMeta
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProviderMeta
impl<'de> Deserialize<'de> for ProviderMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProviderMeta
impl RefUnwindSafe for ProviderMeta
impl Send for ProviderMeta
impl Sync for ProviderMeta
impl Unpin for ProviderMeta
impl UnsafeUnpin for ProviderMeta
impl UnwindSafe for ProviderMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more