diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0ad561ce..2c7518802 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -547,8 +547,6 @@ jobs: if: fromJSON(needs.changes.outputs.run)['contract-tests'] steps: - uses: actions/checkout@v4 - - name: ProviderName generator drift (checked-in files must match generator output) - run: python3 scripts/gen_provider_names.py --check - name: Providers doc generator drift (docs/api/providers.md must match generator output) run: python3 scripts/gen_providers_doc.py --check - uses: dtolnay/rust-toolchain@stable diff --git a/CHANGELOG.md b/CHANGELOG.md index fe45c4d4b..8157ad3a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking +- Removed the generated `ProviderName` type in every binding (Rust enum, TS + const object, Go/Java/Kotlin consts, Swift enum, Dart consts, Python + `Literal`) and `scripts/gen_provider_names.py`. Provider names are plain + strings: `provider("groq", ...)`. Built-in and overlay-registered names now + share one string path. The provider list lives in + [docs/api/providers.md](docs/api/providers.md); Rust also gains + `provider_names()`. + **Rust (aimux-stream)** - `SseStream` is now a thin adapter over the `sse-stream` crate (WHATWG diff --git a/README.md b/README.md index 792353a48..e75760c16 100644 --- a/README.md +++ b/README.md @@ -277,18 +277,16 @@ session.close() ```rust // OpenAI → DeepSeek: only the provider name changes (registry-backed; // key read from the provider's env var) -use aimux_providers::{provider, provider_from_env, ProviderName}; +use aimux_providers::{provider, provider_from_env}; -// 推荐:类型化 ProviderName(IDE 补全 + 编译期检查) -let model = provider(ProviderName::Deepseek, None, "deepseek-chat", None)?; -// 字符串形式同样可用: +let model = provider("deepseek", None, "deepseek-chat", None)?; let model = provider_from_env("deepseek", "deepseek-chat", None)?; // model usage is identical — it's all dyn LanguageModel ``` All registry-backed OpenAI-compatible providers share one entry: -`provider(name, ...)` in every binding, with typed `ProviderName` -(enum/union/consts per language). +`provider(name, ...)` in every binding. Provider names are runtime strings; +the generated provider list is the discovery surface. The retired per-provider shell types (`XxxConfig`/`XxxProvider`) are gone — see [docs/API.md](docs/API.md#providers). diff --git a/ROADMAP.md b/ROADMAP.md index 4b7bb5856..17524118d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -67,7 +67,7 @@ aimux 是 **provider 接入与治理的运行时**: 版本语义: - **Rust 层 breaking**:A2 删枚举、#185 换类型。 -- **绑定源码级 breaking**:A2 删除 Go / Java / Kotlin / Swift / Flutter / Node / Python 的 `ProviderName` 类型化常量,改为字符串(Node 由 `gen_ts_types.py` 生成 string-literal union 保留补全);CHANGELOG 需给迁移说明。 +- **绑定源码级 breaking**:A2 删除 Go / Java / Kotlin / Swift / Flutter / Node / Python 的 `ProviderName` 类型化常量,改为字符串,Node 也不保留 string-literal union(overlay 注册的名字无法进入编译期联合类型,保留它就是保留第二条路径);CHANGELOG 需给迁移说明。 - binding wire 与 C ABI 不变。 ### 0.7.0 ——「L1 协议层 + auth」(~5-6 周) diff --git a/aimux-providers/src/lib.rs b/aimux-providers/src/lib.rs index 61f8bb1f4..80f767ad9 100644 --- a/aimux-providers/src/lib.rs +++ b/aimux-providers/src/lib.rs @@ -35,12 +35,11 @@ macro_rules! delegate_list_models { // The 250 per-provider `XxxConfig`/`XxxProvider` shell types were retired in // phase 4 — use [`provider`] / [`provider_from_env`] instead. pub mod provider; -pub mod provider_name; pub mod replay; pub use provider::{ ExternalProviderEntry, ProviderOptions, ProviderProfile, is_external_provider, load_providers_from_json, provider, provider_api_key_env, provider_from_env, provider_handle, - provider_registry_entry, register_provider, + provider_names, provider_registry_entry, register_provider, }; pub use replay::{rebuild_decision_provider, rebuild_provider}; diff --git a/aimux-providers/src/provider.rs b/aimux-providers/src/provider.rs index 0aa3ce26f..a9eefdd5c 100644 --- a/aimux-providers/src/provider.rs +++ b/aimux-providers/src/provider.rs @@ -144,7 +144,7 @@ pub struct ProviderOptions { /// - `options` overrides individual fields of the resolved entry /// (replaces the retired `with_base_url` etc.). /// - Unknown names return [`AiMuxError::NoSuchProvider`] naming the requested -/// provider; built-in names are enumerated by the generated `ProviderName` +/// provider; built-in names are available through [`provider_names`] /// (overlay-registered names are not). /// /// # Errors @@ -417,7 +417,7 @@ pub fn provider_handle( let entry = registry().iter().find(|e| e.name == name).ok_or_else(|| { AiMuxError::NoSuchProvider { // Display derives from the id alone; valid names are discoverable - // via the generated `ProviderName` — listing 250 names here would + // via `provider_names()` — listing 250 names here would // ride along in every error, across the C ABI. provider_id: name.to_string(), } @@ -594,6 +594,11 @@ pub fn provider_from_env( provider(name, None, model_id, options) } +/// Names of all built-in registry providers. +pub fn provider_names() -> impl Iterator { + registry().iter().map(|entry| entry.name.as_str()) +} + /// The environment variable [`provider`] / [`provider_handle`] read `name`'s /// API key from when no key is passed: the runtime overlay's `api_key` /// `env:` reference or its `env_var`, `{NAME}_API_KEY` for the local @@ -639,7 +644,6 @@ pub fn provider_registry_entry(name: &str) -> Option { #[cfg(test)] mod tests { use super::*; - use crate::provider_name::ProviderName; #[test] fn provider_api_key_env_names_the_variable_the_provider_reads() { @@ -708,23 +712,12 @@ mod tests { } #[test] - fn provider_accepts_typed_and_string_names() { - // Both spellings work: typed ProviderName (recommended) and string. - let typed = match provider( - ProviderName::Groq, - Some("sk-test".into()), - "llama-3.3-70b", - None, - ) { - Ok(m) => m, - Err(e) => panic!("typed name should construct: {e}"), - }; - assert_eq!(typed.model_id(), "llama-3.3-70b"); - let string = match provider("groq", Some("sk-test".into()), "llama-3.3-70b", None) { + fn provider_accepts_string_names() { + let model = match provider("groq", Some("sk-test".into()), "llama-3.3-70b", None) { Ok(m) => m, Err(e) => panic!("string name should construct: {e}"), }; - assert_eq!(string.model_id(), "llama-3.3-70b"); + assert_eq!(model.model_id(), "llama-3.3-70b"); } #[test] @@ -855,38 +848,10 @@ mod tests { } #[test] - fn provider_name_roundtrip() { - assert_eq!(ProviderName::Groq.as_str(), "groq"); - assert_eq!( - "deepseek".parse::().ok(), - Some(ProviderName::Deepseek) - ); - assert_eq!("nope".parse::().ok(), None); - assert!(ProviderName::all_names().contains("groq")); - assert_eq!(ProviderName::ALL.len(), 251); - } - - #[test] - fn provider_name_matches_registry_json() { - // Anti-drift: every registry name must exist as a ProviderName variant - // and round-trip; counts must match (guards against editing the JSON - // without regenerating provider_name.rs). - let registry: serde_json::Value = - serde_json::from_str(include_str!("provider_registry.json")) - .expect("registry JSON is valid"); - let names: Vec<&str> = registry - .as_array() - .expect("registry is an array") - .iter() - .map(|e| e["name"].as_str().expect("name is a string")) - .collect(); - assert_eq!(ProviderName::ALL.len(), names.len()); - for name in &names { - let variant = name - .parse::() - .unwrap_or_else(|_| panic!("registry name {name} missing from ProviderName")); - assert_eq!(variant.as_str(), *name); - } + fn provider_names_list_the_registry() { + let names: Vec<_> = provider_names().collect(); + assert_eq!(names.len(), registry().len()); + assert!(names.contains(&"groq")); } // ── RFC-0020: external provider overlay ──────────────────────────────── diff --git a/aimux-providers/src/provider_name.rs b/aimux-providers/src/provider_name.rs deleted file mode 100644 index 7d8467e31..000000000 --- a/aimux-providers/src/provider_name.rs +++ /dev/null @@ -1,1053 +0,0 @@ -//! Provider name enum — GENERATED by `scripts/gen_provider_names.py`. -//! Do not edit manually; single source of truth is `provider_registry.json`. - -/// Names of all built-in OpenAI-compatible providers (registry-backed). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum ProviderName { - Abacus, - AbliterationAi, - Ai21, - Ai302, - AiRouter, - Aiand, - Aibadgr, - Aigc2d, - Aihubmix, - Ails, - Aiml, - AkiIo, - Albert, - Alibaba, - AlibabaCodingPlan, - AlibabaCodingPlanCn, - AlibabaTokenPlan, - AlibabaTokenPlanCn, - Ambient, - Anyapi, - Anyscale, - Apertis, - Api2d, - Api2gpt, - Apiserpent, - Atlascloud, - AtomicChat, - Auriko, - AzureAi, - Baichuan, - Baidu, - BaiduV2, - Bailing, - Baseten, - Berget, - Bigmodel, - Blueclaw, - Bytedance, - Byteplus, - Bytez, - Canopywave, - Cerebras, - Chatgpt, - Cherryin, - Chutes, - Clarifai, - Claudinio, - ClinePass, - Closeai, - CloudferroSherlock, - Cloudflare, - CloudflareWorkersAi, - Codestral, - Cometapi, - Commandcode, - Compactifai, - Copilot, - Cortecs, - Coze, - Crof, - Crossmodel, - Crusoe, - Daoxe, - Darkbloom, - Databricks, - Datarobot, - Deepbricks, - Deepinfra, - Deepseek, - Digitalocean, - Dinference, - Doubao, - Doubleword, - Drun, - Ebcloud, - Embercloud, - Empiriolabs, - Evroc, - Fastcrw, - Fastgpt, - Fastrouter, - FeatherlessAi, - Firepass, - Fireworks, - Freemodel, - Friendliai, - Frogbot, - Galadriel, - Gdc, - Gigachat, - Github, - Gmi, - Gmicloud, - Gonka24, - GradientAi, - Groq, - Helicone, - Heroku, - Hetzner, - HostedVllm, - HpcAi, - Hyperbolic, - Iflowcn, - Inception, - Inceptron, - InferenceNet, - Inferencehub, - Inferx, - Infinity, - IoNet, - Jiekou, - Kenari, - Kilo, - Kimi, - KimiForCoding, - Kiro, - KlusterAi, - Krutrim, - KuaeCloudCodingPlan, - LambdaAi, - Lemonade, - LemonfoxAi, - Libertai, - Lilac, - Lingyiwanwu, - Llama, - Llamagate, - Llmgateway, - Llmtr, - Longcat, - Lucidquery, - Lynkr, - Matterai, - Meganova, - MergeGateway, - Meta, - MetaLlama, - Mimo, - Minimax, - MinimaxCn, - MinimaxCnCodingPlan, - MinimaxCodingPlan, - Mira, - Mixlayer, - Moark, - Modal, - ModelOracleAi, - Modelscope, - Moonshotai, - MoonshotaiCn, - Morph, - Nanogpt, - Ncompass, - Nearai, - Nebius, - Neon, - Neuralwatt, - Nextbit, - NlpCloud, - NousResearch, - Novita, - Nscale, - NvidiaNim, - Oci, - Ofox, - Ohmygpt, - OllamaCloud, - Openaimax, - Openaisb, - Opencode, - OpencodeGo, - OpencodeZen, - Orcarouter, - Ovhcloud, - Parasail, - Perfxcloud, - Perplexity, - PerplexityAgent, - Petals, - Pinstripes, - Pioneer, - Poe, - Poolside, - Portkey, - Ppinfra, - Predibase, - PrivatemodeAi, - Publicai, - QihangAi, - Qihoo360, - QiniuAi, - RegoloAi, - RekaAi, - Requesty, - Reve, - RoutingRun, - Sakana, - Sambanova, - Sarvam, - Scaleway, - ScxAi, - Siliconflow, - Snowflake, - SnowflakeCortex, - Stackit, - Stepfun, - StepfunAiStepPlan, - StepfunStepPlan, - Subconscious, - Submodel, - Synthetic, - Tencent, - TencentCodingPlan, - TencentTokenPlan, - TencentTokenPlanEnterpriseAuto, - TencentTokenPlanEnterprisePro, - TencentTokenPlanGeneralPersonal, - TencentTokenPlanHyPersonal, - TencentTokenhub, - Tensormesh, - TheGridAi, - Thinkingmachines, - Tinfoil, - Togetherai, - Tokenflux, - Tokenpony, - Trustedrouter, - Tundra, - UmansAi, - Unorouter, - Upstage, - V0, - Venice, - Vercel, - Vivgrid, - VolcEngine, - Vultr, - Wafer, - Wandb, - XiaomiTokenPlanAms, - XiaomiTokenPlanCn, - XiaomiTokenPlanSgp, - Xiaomimimo, - Xpersona, - Xunfei, - Zai, - ZaiCodingPlan, - Zeldoc, - Zenmux, - ZhipuV4, - ZhipuaiCodingPlan, -} - -impl ProviderName { - /// All provider names, sorted. - pub const ALL: &'static [ProviderName] = &[ - Self::Abacus, - Self::AbliterationAi, - Self::Ai21, - Self::Ai302, - Self::AiRouter, - Self::Aiand, - Self::Aibadgr, - Self::Aigc2d, - Self::Aihubmix, - Self::Ails, - Self::Aiml, - Self::AkiIo, - Self::Albert, - Self::Alibaba, - Self::AlibabaCodingPlan, - Self::AlibabaCodingPlanCn, - Self::AlibabaTokenPlan, - Self::AlibabaTokenPlanCn, - Self::Ambient, - Self::Anyapi, - Self::Anyscale, - Self::Apertis, - Self::Api2d, - Self::Api2gpt, - Self::Apiserpent, - Self::Atlascloud, - Self::AtomicChat, - Self::Auriko, - Self::AzureAi, - Self::Baichuan, - Self::Baidu, - Self::BaiduV2, - Self::Bailing, - Self::Baseten, - Self::Berget, - Self::Bigmodel, - Self::Blueclaw, - Self::Bytedance, - Self::Byteplus, - Self::Bytez, - Self::Canopywave, - Self::Cerebras, - Self::Chatgpt, - Self::Cherryin, - Self::Chutes, - Self::Clarifai, - Self::Claudinio, - Self::ClinePass, - Self::Closeai, - Self::CloudferroSherlock, - Self::Cloudflare, - Self::CloudflareWorkersAi, - Self::Codestral, - Self::Cometapi, - Self::Commandcode, - Self::Compactifai, - Self::Copilot, - Self::Cortecs, - Self::Coze, - Self::Crof, - Self::Crossmodel, - Self::Crusoe, - Self::Daoxe, - Self::Darkbloom, - Self::Databricks, - Self::Datarobot, - Self::Deepbricks, - Self::Deepinfra, - Self::Deepseek, - Self::Digitalocean, - Self::Dinference, - Self::Doubao, - Self::Doubleword, - Self::Drun, - Self::Ebcloud, - Self::Embercloud, - Self::Empiriolabs, - Self::Evroc, - Self::Fastcrw, - Self::Fastgpt, - Self::Fastrouter, - Self::FeatherlessAi, - Self::Firepass, - Self::Fireworks, - Self::Freemodel, - Self::Friendliai, - Self::Frogbot, - Self::Galadriel, - Self::Gdc, - Self::Gigachat, - Self::Github, - Self::Gmi, - Self::Gmicloud, - Self::Gonka24, - Self::GradientAi, - Self::Groq, - Self::Helicone, - Self::Heroku, - Self::Hetzner, - Self::HostedVllm, - Self::HpcAi, - Self::Hyperbolic, - Self::Iflowcn, - Self::Inception, - Self::Inceptron, - Self::InferenceNet, - Self::Inferencehub, - Self::Inferx, - Self::Infinity, - Self::IoNet, - Self::Jiekou, - Self::Kenari, - Self::Kilo, - Self::Kimi, - Self::KimiForCoding, - Self::Kiro, - Self::KlusterAi, - Self::Krutrim, - Self::KuaeCloudCodingPlan, - Self::LambdaAi, - Self::Lemonade, - Self::LemonfoxAi, - Self::Libertai, - Self::Lilac, - Self::Lingyiwanwu, - Self::Llama, - Self::Llamagate, - Self::Llmgateway, - Self::Llmtr, - Self::Longcat, - Self::Lucidquery, - Self::Lynkr, - Self::Matterai, - Self::Meganova, - Self::MergeGateway, - Self::Meta, - Self::MetaLlama, - Self::Mimo, - Self::Minimax, - Self::MinimaxCn, - Self::MinimaxCnCodingPlan, - Self::MinimaxCodingPlan, - Self::Mira, - Self::Mixlayer, - Self::Moark, - Self::Modal, - Self::ModelOracleAi, - Self::Modelscope, - Self::Moonshotai, - Self::MoonshotaiCn, - Self::Morph, - Self::Nanogpt, - Self::Ncompass, - Self::Nearai, - Self::Nebius, - Self::Neon, - Self::Neuralwatt, - Self::Nextbit, - Self::NlpCloud, - Self::NousResearch, - Self::Novita, - Self::Nscale, - Self::NvidiaNim, - Self::Oci, - Self::Ofox, - Self::Ohmygpt, - Self::OllamaCloud, - Self::Openaimax, - Self::Openaisb, - Self::Opencode, - Self::OpencodeGo, - Self::OpencodeZen, - Self::Orcarouter, - Self::Ovhcloud, - Self::Parasail, - Self::Perfxcloud, - Self::Perplexity, - Self::PerplexityAgent, - Self::Petals, - Self::Pinstripes, - Self::Pioneer, - Self::Poe, - Self::Poolside, - Self::Portkey, - Self::Ppinfra, - Self::Predibase, - Self::PrivatemodeAi, - Self::Publicai, - Self::QihangAi, - Self::Qihoo360, - Self::QiniuAi, - Self::RegoloAi, - Self::RekaAi, - Self::Requesty, - Self::Reve, - Self::RoutingRun, - Self::Sakana, - Self::Sambanova, - Self::Sarvam, - Self::Scaleway, - Self::ScxAi, - Self::Siliconflow, - Self::Snowflake, - Self::SnowflakeCortex, - Self::Stackit, - Self::Stepfun, - Self::StepfunAiStepPlan, - Self::StepfunStepPlan, - Self::Subconscious, - Self::Submodel, - Self::Synthetic, - Self::Tencent, - Self::TencentCodingPlan, - Self::TencentTokenPlan, - Self::TencentTokenPlanEnterpriseAuto, - Self::TencentTokenPlanEnterprisePro, - Self::TencentTokenPlanGeneralPersonal, - Self::TencentTokenPlanHyPersonal, - Self::TencentTokenhub, - Self::Tensormesh, - Self::TheGridAi, - Self::Thinkingmachines, - Self::Tinfoil, - Self::Togetherai, - Self::Tokenflux, - Self::Tokenpony, - Self::Trustedrouter, - Self::Tundra, - Self::UmansAi, - Self::Unorouter, - Self::Upstage, - Self::V0, - Self::Venice, - Self::Vercel, - Self::Vivgrid, - Self::VolcEngine, - Self::Vultr, - Self::Wafer, - Self::Wandb, - Self::XiaomiTokenPlanAms, - Self::XiaomiTokenPlanCn, - Self::XiaomiTokenPlanSgp, - Self::Xiaomimimo, - Self::Xpersona, - Self::Xunfei, - Self::Zai, - Self::ZaiCodingPlan, - Self::Zeldoc, - Self::Zenmux, - Self::ZhipuV4, - Self::ZhipuaiCodingPlan, - ]; - - /// The registry name (snake_case), e.g. `ProviderName::Groq -> "groq"`. - #[must_use] - pub fn as_str(self) -> &'static str { - match self { - Self::Abacus => "abacus", - Self::AbliterationAi => "abliteration_ai", - Self::Ai21 => "ai21", - Self::Ai302 => "ai302", - Self::AiRouter => "ai_router", - Self::Aiand => "aiand", - Self::Aibadgr => "aibadgr", - Self::Aigc2d => "aigc2d", - Self::Aihubmix => "aihubmix", - Self::Ails => "ails", - Self::Aiml => "aiml", - Self::AkiIo => "aki_io", - Self::Albert => "albert", - Self::Alibaba => "alibaba", - Self::AlibabaCodingPlan => "alibaba_coding_plan", - Self::AlibabaCodingPlanCn => "alibaba_coding_plan_cn", - Self::AlibabaTokenPlan => "alibaba_token_plan", - Self::AlibabaTokenPlanCn => "alibaba_token_plan_cn", - Self::Ambient => "ambient", - Self::Anyapi => "anyapi", - Self::Anyscale => "anyscale", - Self::Apertis => "apertis", - Self::Api2d => "api2d", - Self::Api2gpt => "api2gpt", - Self::Apiserpent => "apiserpent", - Self::Atlascloud => "atlascloud", - Self::AtomicChat => "atomic_chat", - Self::Auriko => "auriko", - Self::AzureAi => "azure_ai", - Self::Baichuan => "baichuan", - Self::Baidu => "baidu", - Self::BaiduV2 => "baidu_v2", - Self::Bailing => "bailing", - Self::Baseten => "baseten", - Self::Berget => "berget", - Self::Bigmodel => "bigmodel", - Self::Blueclaw => "blueclaw", - Self::Bytedance => "bytedance", - Self::Byteplus => "byteplus", - Self::Bytez => "bytez", - Self::Canopywave => "canopywave", - Self::Cerebras => "cerebras", - Self::Chatgpt => "chatgpt", - Self::Cherryin => "cherryin", - Self::Chutes => "chutes", - Self::Clarifai => "clarifai", - Self::Claudinio => "claudinio", - Self::ClinePass => "cline_pass", - Self::Closeai => "closeai", - Self::CloudferroSherlock => "cloudferro_sherlock", - Self::Cloudflare => "cloudflare", - Self::CloudflareWorkersAi => "cloudflare_workers_ai", - Self::Codestral => "codestral", - Self::Cometapi => "cometapi", - Self::Commandcode => "commandcode", - Self::Compactifai => "compactifai", - Self::Copilot => "copilot", - Self::Cortecs => "cortecs", - Self::Coze => "coze", - Self::Crof => "crof", - Self::Crossmodel => "crossmodel", - Self::Crusoe => "crusoe", - Self::Daoxe => "daoxe", - Self::Darkbloom => "darkbloom", - Self::Databricks => "databricks", - Self::Datarobot => "datarobot", - Self::Deepbricks => "deepbricks", - Self::Deepinfra => "deepinfra", - Self::Deepseek => "deepseek", - Self::Digitalocean => "digitalocean", - Self::Dinference => "dinference", - Self::Doubao => "doubao", - Self::Doubleword => "doubleword", - Self::Drun => "drun", - Self::Ebcloud => "ebcloud", - Self::Embercloud => "embercloud", - Self::Empiriolabs => "empiriolabs", - Self::Evroc => "evroc", - Self::Fastcrw => "fastcrw", - Self::Fastgpt => "fastgpt", - Self::Fastrouter => "fastrouter", - Self::FeatherlessAi => "featherless_ai", - Self::Firepass => "firepass", - Self::Fireworks => "fireworks", - Self::Freemodel => "freemodel", - Self::Friendliai => "friendliai", - Self::Frogbot => "frogbot", - Self::Galadriel => "galadriel", - Self::Gdc => "gdc", - Self::Gigachat => "gigachat", - Self::Github => "github", - Self::Gmi => "gmi", - Self::Gmicloud => "gmicloud", - Self::Gonka24 => "gonka24", - Self::GradientAi => "gradient_ai", - Self::Groq => "groq", - Self::Helicone => "helicone", - Self::Heroku => "heroku", - Self::Hetzner => "hetzner", - Self::HostedVllm => "hosted_vllm", - Self::HpcAi => "hpc_ai", - Self::Hyperbolic => "hyperbolic", - Self::Iflowcn => "iflowcn", - Self::Inception => "inception", - Self::Inceptron => "inceptron", - Self::InferenceNet => "inference_net", - Self::Inferencehub => "inferencehub", - Self::Inferx => "inferx", - Self::Infinity => "infinity", - Self::IoNet => "io_net", - Self::Jiekou => "jiekou", - Self::Kenari => "kenari", - Self::Kilo => "kilo", - Self::Kimi => "kimi", - Self::KimiForCoding => "kimi_for_coding", - Self::Kiro => "kiro", - Self::KlusterAi => "kluster_ai", - Self::Krutrim => "krutrim", - Self::KuaeCloudCodingPlan => "kuae_cloud_coding_plan", - Self::LambdaAi => "lambda_ai", - Self::Lemonade => "lemonade", - Self::LemonfoxAi => "lemonfox_ai", - Self::Libertai => "libertai", - Self::Lilac => "lilac", - Self::Lingyiwanwu => "lingyiwanwu", - Self::Llama => "llama", - Self::Llamagate => "llamagate", - Self::Llmgateway => "llmgateway", - Self::Llmtr => "llmtr", - Self::Longcat => "longcat", - Self::Lucidquery => "lucidquery", - Self::Lynkr => "lynkr", - Self::Matterai => "matterai", - Self::Meganova => "meganova", - Self::MergeGateway => "merge_gateway", - Self::Meta => "meta", - Self::MetaLlama => "meta_llama", - Self::Mimo => "mimo", - Self::Minimax => "minimax", - Self::MinimaxCn => "minimax_cn", - Self::MinimaxCnCodingPlan => "minimax_cn_coding_plan", - Self::MinimaxCodingPlan => "minimax_coding_plan", - Self::Mira => "mira", - Self::Mixlayer => "mixlayer", - Self::Moark => "moark", - Self::Modal => "modal", - Self::ModelOracleAi => "model_oracle_ai", - Self::Modelscope => "modelscope", - Self::Moonshotai => "moonshotai", - Self::MoonshotaiCn => "moonshotai_cn", - Self::Morph => "morph", - Self::Nanogpt => "nanogpt", - Self::Ncompass => "ncompass", - Self::Nearai => "nearai", - Self::Nebius => "nebius", - Self::Neon => "neon", - Self::Neuralwatt => "neuralwatt", - Self::Nextbit => "nextbit", - Self::NlpCloud => "nlp_cloud", - Self::NousResearch => "nous_research", - Self::Novita => "novita", - Self::Nscale => "nscale", - Self::NvidiaNim => "nvidia_nim", - Self::Oci => "oci", - Self::Ofox => "ofox", - Self::Ohmygpt => "ohmygpt", - Self::OllamaCloud => "ollama_cloud", - Self::Openaimax => "openaimax", - Self::Openaisb => "openaisb", - Self::Opencode => "opencode", - Self::OpencodeGo => "opencode_go", - Self::OpencodeZen => "opencode_zen", - Self::Orcarouter => "orcarouter", - Self::Ovhcloud => "ovhcloud", - Self::Parasail => "parasail", - Self::Perfxcloud => "perfxcloud", - Self::Perplexity => "perplexity", - Self::PerplexityAgent => "perplexity_agent", - Self::Petals => "petals", - Self::Pinstripes => "pinstripes", - Self::Pioneer => "pioneer", - Self::Poe => "poe", - Self::Poolside => "poolside", - Self::Portkey => "portkey", - Self::Ppinfra => "ppinfra", - Self::Predibase => "predibase", - Self::PrivatemodeAi => "privatemode_ai", - Self::Publicai => "publicai", - Self::QihangAi => "qihang_ai", - Self::Qihoo360 => "qihoo360", - Self::QiniuAi => "qiniu_ai", - Self::RegoloAi => "regolo_ai", - Self::RekaAi => "reka_ai", - Self::Requesty => "requesty", - Self::Reve => "reve", - Self::RoutingRun => "routing_run", - Self::Sakana => "sakana", - Self::Sambanova => "sambanova", - Self::Sarvam => "sarvam", - Self::Scaleway => "scaleway", - Self::ScxAi => "scx_ai", - Self::Siliconflow => "siliconflow", - Self::Snowflake => "snowflake", - Self::SnowflakeCortex => "snowflake_cortex", - Self::Stackit => "stackit", - Self::Stepfun => "stepfun", - Self::StepfunAiStepPlan => "stepfun_ai_step_plan", - Self::StepfunStepPlan => "stepfun_step_plan", - Self::Subconscious => "subconscious", - Self::Submodel => "submodel", - Self::Synthetic => "synthetic", - Self::Tencent => "tencent", - Self::TencentCodingPlan => "tencent_coding_plan", - Self::TencentTokenPlan => "tencent_token_plan", - Self::TencentTokenPlanEnterpriseAuto => "tencent_token_plan_enterprise_auto", - Self::TencentTokenPlanEnterprisePro => "tencent_token_plan_enterprise_pro", - Self::TencentTokenPlanGeneralPersonal => "tencent_token_plan_general_personal", - Self::TencentTokenPlanHyPersonal => "tencent_token_plan_hy_personal", - Self::TencentTokenhub => "tencent_tokenhub", - Self::Tensormesh => "tensormesh", - Self::TheGridAi => "the_grid_ai", - Self::Thinkingmachines => "thinkingmachines", - Self::Tinfoil => "tinfoil", - Self::Togetherai => "togetherai", - Self::Tokenflux => "tokenflux", - Self::Tokenpony => "tokenpony", - Self::Trustedrouter => "trustedrouter", - Self::Tundra => "tundra", - Self::UmansAi => "umans_ai", - Self::Unorouter => "unorouter", - Self::Upstage => "upstage", - Self::V0 => "v0", - Self::Venice => "venice", - Self::Vercel => "vercel", - Self::Vivgrid => "vivgrid", - Self::VolcEngine => "volc_engine", - Self::Vultr => "vultr", - Self::Wafer => "wafer", - Self::Wandb => "wandb", - Self::XiaomiTokenPlanAms => "xiaomi_token_plan_ams", - Self::XiaomiTokenPlanCn => "xiaomi_token_plan_cn", - Self::XiaomiTokenPlanSgp => "xiaomi_token_plan_sgp", - Self::Xiaomimimo => "xiaomimimo", - Self::Xpersona => "xpersona", - Self::Xunfei => "xunfei", - Self::Zai => "zai", - Self::ZaiCodingPlan => "zai_coding_plan", - Self::Zeldoc => "zeldoc", - Self::Zenmux => "zenmux", - Self::ZhipuV4 => "zhipu_v4", - Self::ZhipuaiCodingPlan => "zhipuai_coding_plan", - } - } - - /// All registry names (for error messages / docs). - #[must_use] - pub const fn all_names() -> &'static str { - "abacus,abliteration_ai,ai21,ai302,ai_router,aiand,aibadgr,aigc2d,aihubmix,ails,aiml,aki_io,albert,alibaba,alibaba_coding_plan,alibaba_coding_plan_cn,alibaba_token_plan,alibaba_token_plan_cn,ambient,anyapi,anyscale,apertis,api2d,api2gpt,apiserpent,atlascloud,atomic_chat,auriko,azure_ai,baichuan,baidu,baidu_v2,bailing,baseten,berget,bigmodel,blueclaw,bytedance,byteplus,bytez,canopywave,cerebras,chatgpt,cherryin,chutes,clarifai,claudinio,cline_pass,closeai,cloudferro_sherlock,cloudflare,cloudflare_workers_ai,codestral,cometapi,commandcode,compactifai,copilot,cortecs,coze,crof,crossmodel,crusoe,daoxe,darkbloom,databricks,datarobot,deepbricks,deepinfra,deepseek,digitalocean,dinference,doubao,doubleword,drun,ebcloud,embercloud,empiriolabs,evroc,fastcrw,fastgpt,fastrouter,featherless_ai,firepass,fireworks,freemodel,friendliai,frogbot,galadriel,gdc,gigachat,github,gmi,gmicloud,gonka24,gradient_ai,groq,helicone,heroku,hetzner,hosted_vllm,hpc_ai,hyperbolic,iflowcn,inception,inceptron,inference_net,inferencehub,inferx,infinity,io_net,jiekou,kenari,kilo,kimi,kimi_for_coding,kiro,kluster_ai,krutrim,kuae_cloud_coding_plan,lambda_ai,lemonade,lemonfox_ai,libertai,lilac,lingyiwanwu,llama,llamagate,llmgateway,llmtr,longcat,lucidquery,lynkr,matterai,meganova,merge_gateway,meta,meta_llama,mimo,minimax,minimax_cn,minimax_cn_coding_plan,minimax_coding_plan,mira,mixlayer,moark,modal,model_oracle_ai,modelscope,moonshotai,moonshotai_cn,morph,nanogpt,ncompass,nearai,nebius,neon,neuralwatt,nextbit,nlp_cloud,nous_research,novita,nscale,nvidia_nim,oci,ofox,ohmygpt,ollama_cloud,openaimax,openaisb,opencode,opencode_go,opencode_zen,orcarouter,ovhcloud,parasail,perfxcloud,perplexity,perplexity_agent,petals,pinstripes,pioneer,poe,poolside,portkey,ppinfra,predibase,privatemode_ai,publicai,qihang_ai,qihoo360,qiniu_ai,regolo_ai,reka_ai,requesty,reve,routing_run,sakana,sambanova,sarvam,scaleway,scx_ai,siliconflow,snowflake,snowflake_cortex,stackit,stepfun,stepfun_ai_step_plan,stepfun_step_plan,subconscious,submodel,synthetic,tencent,tencent_coding_plan,tencent_token_plan,tencent_token_plan_enterprise_auto,tencent_token_plan_enterprise_pro,tencent_token_plan_general_personal,tencent_token_plan_hy_personal,tencent_tokenhub,tensormesh,the_grid_ai,thinkingmachines,tinfoil,togetherai,tokenflux,tokenpony,trustedrouter,tundra,umans_ai,unorouter,upstage,v0,venice,vercel,vivgrid,volc_engine,vultr,wafer,wandb,xiaomi_token_plan_ams,xiaomi_token_plan_cn,xiaomi_token_plan_sgp,xiaomimimo,xpersona,xunfei,zai,zai_coding_plan,zeldoc,zenmux,zhipu_v4,zhipuai_coding_plan" - } -} - -impl std::str::FromStr for ProviderName { - type Err = (); - - fn from_str(name: &str) -> Result { - match name { - "abacus" => Ok(Self::Abacus), - "abliteration_ai" => Ok(Self::AbliterationAi), - "ai21" => Ok(Self::Ai21), - "ai302" => Ok(Self::Ai302), - "ai_router" => Ok(Self::AiRouter), - "aiand" => Ok(Self::Aiand), - "aibadgr" => Ok(Self::Aibadgr), - "aigc2d" => Ok(Self::Aigc2d), - "aihubmix" => Ok(Self::Aihubmix), - "ails" => Ok(Self::Ails), - "aiml" => Ok(Self::Aiml), - "aki_io" => Ok(Self::AkiIo), - "albert" => Ok(Self::Albert), - "alibaba" => Ok(Self::Alibaba), - "alibaba_coding_plan" => Ok(Self::AlibabaCodingPlan), - "alibaba_coding_plan_cn" => Ok(Self::AlibabaCodingPlanCn), - "alibaba_token_plan" => Ok(Self::AlibabaTokenPlan), - "alibaba_token_plan_cn" => Ok(Self::AlibabaTokenPlanCn), - "ambient" => Ok(Self::Ambient), - "anyapi" => Ok(Self::Anyapi), - "anyscale" => Ok(Self::Anyscale), - "apertis" => Ok(Self::Apertis), - "api2d" => Ok(Self::Api2d), - "api2gpt" => Ok(Self::Api2gpt), - "apiserpent" => Ok(Self::Apiserpent), - "atlascloud" => Ok(Self::Atlascloud), - "atomic_chat" => Ok(Self::AtomicChat), - "auriko" => Ok(Self::Auriko), - "azure_ai" => Ok(Self::AzureAi), - "baichuan" => Ok(Self::Baichuan), - "baidu" => Ok(Self::Baidu), - "baidu_v2" => Ok(Self::BaiduV2), - "bailing" => Ok(Self::Bailing), - "baseten" => Ok(Self::Baseten), - "berget" => Ok(Self::Berget), - "bigmodel" => Ok(Self::Bigmodel), - "blueclaw" => Ok(Self::Blueclaw), - "bytedance" => Ok(Self::Bytedance), - "byteplus" => Ok(Self::Byteplus), - "bytez" => Ok(Self::Bytez), - "canopywave" => Ok(Self::Canopywave), - "cerebras" => Ok(Self::Cerebras), - "chatgpt" => Ok(Self::Chatgpt), - "cherryin" => Ok(Self::Cherryin), - "chutes" => Ok(Self::Chutes), - "clarifai" => Ok(Self::Clarifai), - "claudinio" => Ok(Self::Claudinio), - "cline_pass" => Ok(Self::ClinePass), - "closeai" => Ok(Self::Closeai), - "cloudferro_sherlock" => Ok(Self::CloudferroSherlock), - "cloudflare" => Ok(Self::Cloudflare), - "cloudflare_workers_ai" => Ok(Self::CloudflareWorkersAi), - "codestral" => Ok(Self::Codestral), - "cometapi" => Ok(Self::Cometapi), - "commandcode" => Ok(Self::Commandcode), - "compactifai" => Ok(Self::Compactifai), - "copilot" => Ok(Self::Copilot), - "cortecs" => Ok(Self::Cortecs), - "coze" => Ok(Self::Coze), - "crof" => Ok(Self::Crof), - "crossmodel" => Ok(Self::Crossmodel), - "crusoe" => Ok(Self::Crusoe), - "daoxe" => Ok(Self::Daoxe), - "darkbloom" => Ok(Self::Darkbloom), - "databricks" => Ok(Self::Databricks), - "datarobot" => Ok(Self::Datarobot), - "deepbricks" => Ok(Self::Deepbricks), - "deepinfra" => Ok(Self::Deepinfra), - "deepseek" => Ok(Self::Deepseek), - "digitalocean" => Ok(Self::Digitalocean), - "dinference" => Ok(Self::Dinference), - "doubao" => Ok(Self::Doubao), - "doubleword" => Ok(Self::Doubleword), - "drun" => Ok(Self::Drun), - "ebcloud" => Ok(Self::Ebcloud), - "embercloud" => Ok(Self::Embercloud), - "empiriolabs" => Ok(Self::Empiriolabs), - "evroc" => Ok(Self::Evroc), - "fastcrw" => Ok(Self::Fastcrw), - "fastgpt" => Ok(Self::Fastgpt), - "fastrouter" => Ok(Self::Fastrouter), - "featherless_ai" => Ok(Self::FeatherlessAi), - "firepass" => Ok(Self::Firepass), - "fireworks" => Ok(Self::Fireworks), - "freemodel" => Ok(Self::Freemodel), - "friendliai" => Ok(Self::Friendliai), - "frogbot" => Ok(Self::Frogbot), - "galadriel" => Ok(Self::Galadriel), - "gdc" => Ok(Self::Gdc), - "gigachat" => Ok(Self::Gigachat), - "github" => Ok(Self::Github), - "gmi" => Ok(Self::Gmi), - "gmicloud" => Ok(Self::Gmicloud), - "gonka24" => Ok(Self::Gonka24), - "gradient_ai" => Ok(Self::GradientAi), - "groq" => Ok(Self::Groq), - "helicone" => Ok(Self::Helicone), - "heroku" => Ok(Self::Heroku), - "hetzner" => Ok(Self::Hetzner), - "hosted_vllm" => Ok(Self::HostedVllm), - "hpc_ai" => Ok(Self::HpcAi), - "hyperbolic" => Ok(Self::Hyperbolic), - "iflowcn" => Ok(Self::Iflowcn), - "inception" => Ok(Self::Inception), - "inceptron" => Ok(Self::Inceptron), - "inference_net" => Ok(Self::InferenceNet), - "inferencehub" => Ok(Self::Inferencehub), - "inferx" => Ok(Self::Inferx), - "infinity" => Ok(Self::Infinity), - "io_net" => Ok(Self::IoNet), - "jiekou" => Ok(Self::Jiekou), - "kenari" => Ok(Self::Kenari), - "kilo" => Ok(Self::Kilo), - "kimi" => Ok(Self::Kimi), - "kimi_for_coding" => Ok(Self::KimiForCoding), - "kiro" => Ok(Self::Kiro), - "kluster_ai" => Ok(Self::KlusterAi), - "krutrim" => Ok(Self::Krutrim), - "kuae_cloud_coding_plan" => Ok(Self::KuaeCloudCodingPlan), - "lambda_ai" => Ok(Self::LambdaAi), - "lemonade" => Ok(Self::Lemonade), - "lemonfox_ai" => Ok(Self::LemonfoxAi), - "libertai" => Ok(Self::Libertai), - "lilac" => Ok(Self::Lilac), - "lingyiwanwu" => Ok(Self::Lingyiwanwu), - "llama" => Ok(Self::Llama), - "llamagate" => Ok(Self::Llamagate), - "llmgateway" => Ok(Self::Llmgateway), - "llmtr" => Ok(Self::Llmtr), - "longcat" => Ok(Self::Longcat), - "lucidquery" => Ok(Self::Lucidquery), - "lynkr" => Ok(Self::Lynkr), - "matterai" => Ok(Self::Matterai), - "meganova" => Ok(Self::Meganova), - "merge_gateway" => Ok(Self::MergeGateway), - "meta" => Ok(Self::Meta), - "meta_llama" => Ok(Self::MetaLlama), - "mimo" => Ok(Self::Mimo), - "minimax" => Ok(Self::Minimax), - "minimax_cn" => Ok(Self::MinimaxCn), - "minimax_cn_coding_plan" => Ok(Self::MinimaxCnCodingPlan), - "minimax_coding_plan" => Ok(Self::MinimaxCodingPlan), - "mira" => Ok(Self::Mira), - "mixlayer" => Ok(Self::Mixlayer), - "moark" => Ok(Self::Moark), - "modal" => Ok(Self::Modal), - "model_oracle_ai" => Ok(Self::ModelOracleAi), - "modelscope" => Ok(Self::Modelscope), - "moonshotai" => Ok(Self::Moonshotai), - "moonshotai_cn" => Ok(Self::MoonshotaiCn), - "morph" => Ok(Self::Morph), - "nanogpt" => Ok(Self::Nanogpt), - "ncompass" => Ok(Self::Ncompass), - "nearai" => Ok(Self::Nearai), - "nebius" => Ok(Self::Nebius), - "neon" => Ok(Self::Neon), - "neuralwatt" => Ok(Self::Neuralwatt), - "nextbit" => Ok(Self::Nextbit), - "nlp_cloud" => Ok(Self::NlpCloud), - "nous_research" => Ok(Self::NousResearch), - "novita" => Ok(Self::Novita), - "nscale" => Ok(Self::Nscale), - "nvidia_nim" => Ok(Self::NvidiaNim), - "oci" => Ok(Self::Oci), - "ofox" => Ok(Self::Ofox), - "ohmygpt" => Ok(Self::Ohmygpt), - "ollama_cloud" => Ok(Self::OllamaCloud), - "openaimax" => Ok(Self::Openaimax), - "openaisb" => Ok(Self::Openaisb), - "opencode" => Ok(Self::Opencode), - "opencode_go" => Ok(Self::OpencodeGo), - "opencode_zen" => Ok(Self::OpencodeZen), - "orcarouter" => Ok(Self::Orcarouter), - "ovhcloud" => Ok(Self::Ovhcloud), - "parasail" => Ok(Self::Parasail), - "perfxcloud" => Ok(Self::Perfxcloud), - "perplexity" => Ok(Self::Perplexity), - "perplexity_agent" => Ok(Self::PerplexityAgent), - "petals" => Ok(Self::Petals), - "pinstripes" => Ok(Self::Pinstripes), - "pioneer" => Ok(Self::Pioneer), - "poe" => Ok(Self::Poe), - "poolside" => Ok(Self::Poolside), - "portkey" => Ok(Self::Portkey), - "ppinfra" => Ok(Self::Ppinfra), - "predibase" => Ok(Self::Predibase), - "privatemode_ai" => Ok(Self::PrivatemodeAi), - "publicai" => Ok(Self::Publicai), - "qihang_ai" => Ok(Self::QihangAi), - "qihoo360" => Ok(Self::Qihoo360), - "qiniu_ai" => Ok(Self::QiniuAi), - "regolo_ai" => Ok(Self::RegoloAi), - "reka_ai" => Ok(Self::RekaAi), - "requesty" => Ok(Self::Requesty), - "reve" => Ok(Self::Reve), - "routing_run" => Ok(Self::RoutingRun), - "sakana" => Ok(Self::Sakana), - "sambanova" => Ok(Self::Sambanova), - "sarvam" => Ok(Self::Sarvam), - "scaleway" => Ok(Self::Scaleway), - "scx_ai" => Ok(Self::ScxAi), - "siliconflow" => Ok(Self::Siliconflow), - "snowflake" => Ok(Self::Snowflake), - "snowflake_cortex" => Ok(Self::SnowflakeCortex), - "stackit" => Ok(Self::Stackit), - "stepfun" => Ok(Self::Stepfun), - "stepfun_ai_step_plan" => Ok(Self::StepfunAiStepPlan), - "stepfun_step_plan" => Ok(Self::StepfunStepPlan), - "subconscious" => Ok(Self::Subconscious), - "submodel" => Ok(Self::Submodel), - "synthetic" => Ok(Self::Synthetic), - "tencent" => Ok(Self::Tencent), - "tencent_coding_plan" => Ok(Self::TencentCodingPlan), - "tencent_token_plan" => Ok(Self::TencentTokenPlan), - "tencent_token_plan_enterprise_auto" => Ok(Self::TencentTokenPlanEnterpriseAuto), - "tencent_token_plan_enterprise_pro" => Ok(Self::TencentTokenPlanEnterprisePro), - "tencent_token_plan_general_personal" => Ok(Self::TencentTokenPlanGeneralPersonal), - "tencent_token_plan_hy_personal" => Ok(Self::TencentTokenPlanHyPersonal), - "tencent_tokenhub" => Ok(Self::TencentTokenhub), - "tensormesh" => Ok(Self::Tensormesh), - "the_grid_ai" => Ok(Self::TheGridAi), - "thinkingmachines" => Ok(Self::Thinkingmachines), - "tinfoil" => Ok(Self::Tinfoil), - "togetherai" => Ok(Self::Togetherai), - "tokenflux" => Ok(Self::Tokenflux), - "tokenpony" => Ok(Self::Tokenpony), - "trustedrouter" => Ok(Self::Trustedrouter), - "tundra" => Ok(Self::Tundra), - "umans_ai" => Ok(Self::UmansAi), - "unorouter" => Ok(Self::Unorouter), - "upstage" => Ok(Self::Upstage), - "v0" => Ok(Self::V0), - "venice" => Ok(Self::Venice), - "vercel" => Ok(Self::Vercel), - "vivgrid" => Ok(Self::Vivgrid), - "volc_engine" => Ok(Self::VolcEngine), - "vultr" => Ok(Self::Vultr), - "wafer" => Ok(Self::Wafer), - "wandb" => Ok(Self::Wandb), - "xiaomi_token_plan_ams" => Ok(Self::XiaomiTokenPlanAms), - "xiaomi_token_plan_cn" => Ok(Self::XiaomiTokenPlanCn), - "xiaomi_token_plan_sgp" => Ok(Self::XiaomiTokenPlanSgp), - "xiaomimimo" => Ok(Self::Xiaomimimo), - "xpersona" => Ok(Self::Xpersona), - "xunfei" => Ok(Self::Xunfei), - "zai" => Ok(Self::Zai), - "zai_coding_plan" => Ok(Self::ZaiCodingPlan), - "zeldoc" => Ok(Self::Zeldoc), - "zenmux" => Ok(Self::Zenmux), - "zhipu_v4" => Ok(Self::ZhipuV4), - "zhipuai_coding_plan" => Ok(Self::ZhipuaiCodingPlan), - _ => Err(()), - } - } -} - -impl AsRef for ProviderName { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ProviderName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(self.as_str()) - } -} diff --git a/bindings/flutter/lib/provider_name.dart b/bindings/flutter/lib/provider_name.dart deleted file mode 100644 index c3a7d9743..000000000 --- a/bindings/flutter/lib/provider_name.dart +++ /dev/null @@ -1,258 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/// Names of all built-in OpenAI-compatible providers. -class ProviderName { - ProviderName._(); - static const Abacus = 'abacus'; - static const AbliterationAi = 'abliteration_ai'; - static const Ai21 = 'ai21'; - static const Ai302 = 'ai302'; - static const AiRouter = 'ai_router'; - static const Aiand = 'aiand'; - static const Aibadgr = 'aibadgr'; - static const Aigc2d = 'aigc2d'; - static const Aihubmix = 'aihubmix'; - static const Ails = 'ails'; - static const Aiml = 'aiml'; - static const AkiIo = 'aki_io'; - static const Albert = 'albert'; - static const Alibaba = 'alibaba'; - static const AlibabaCodingPlan = 'alibaba_coding_plan'; - static const AlibabaCodingPlanCn = 'alibaba_coding_plan_cn'; - static const AlibabaTokenPlan = 'alibaba_token_plan'; - static const AlibabaTokenPlanCn = 'alibaba_token_plan_cn'; - static const Ambient = 'ambient'; - static const Anyapi = 'anyapi'; - static const Anyscale = 'anyscale'; - static const Apertis = 'apertis'; - static const Api2d = 'api2d'; - static const Api2gpt = 'api2gpt'; - static const Apiserpent = 'apiserpent'; - static const Atlascloud = 'atlascloud'; - static const AtomicChat = 'atomic_chat'; - static const Auriko = 'auriko'; - static const AzureAi = 'azure_ai'; - static const Baichuan = 'baichuan'; - static const Baidu = 'baidu'; - static const BaiduV2 = 'baidu_v2'; - static const Bailing = 'bailing'; - static const Baseten = 'baseten'; - static const Berget = 'berget'; - static const Bigmodel = 'bigmodel'; - static const Blueclaw = 'blueclaw'; - static const Bytedance = 'bytedance'; - static const Byteplus = 'byteplus'; - static const Bytez = 'bytez'; - static const Canopywave = 'canopywave'; - static const Cerebras = 'cerebras'; - static const Chatgpt = 'chatgpt'; - static const Cherryin = 'cherryin'; - static const Chutes = 'chutes'; - static const Clarifai = 'clarifai'; - static const Claudinio = 'claudinio'; - static const ClinePass = 'cline_pass'; - static const Closeai = 'closeai'; - static const CloudferroSherlock = 'cloudferro_sherlock'; - static const Cloudflare = 'cloudflare'; - static const CloudflareWorkersAi = 'cloudflare_workers_ai'; - static const Codestral = 'codestral'; - static const Cometapi = 'cometapi'; - static const Commandcode = 'commandcode'; - static const Compactifai = 'compactifai'; - static const Copilot = 'copilot'; - static const Cortecs = 'cortecs'; - static const Coze = 'coze'; - static const Crof = 'crof'; - static const Crossmodel = 'crossmodel'; - static const Crusoe = 'crusoe'; - static const Daoxe = 'daoxe'; - static const Darkbloom = 'darkbloom'; - static const Databricks = 'databricks'; - static const Datarobot = 'datarobot'; - static const Deepbricks = 'deepbricks'; - static const Deepinfra = 'deepinfra'; - static const Deepseek = 'deepseek'; - static const Digitalocean = 'digitalocean'; - static const Dinference = 'dinference'; - static const Doubao = 'doubao'; - static const Doubleword = 'doubleword'; - static const Drun = 'drun'; - static const Ebcloud = 'ebcloud'; - static const Embercloud = 'embercloud'; - static const Empiriolabs = 'empiriolabs'; - static const Evroc = 'evroc'; - static const Fastcrw = 'fastcrw'; - static const Fastgpt = 'fastgpt'; - static const Fastrouter = 'fastrouter'; - static const FeatherlessAi = 'featherless_ai'; - static const Firepass = 'firepass'; - static const Fireworks = 'fireworks'; - static const Freemodel = 'freemodel'; - static const Friendliai = 'friendliai'; - static const Frogbot = 'frogbot'; - static const Galadriel = 'galadriel'; - static const Gdc = 'gdc'; - static const Gigachat = 'gigachat'; - static const Github = 'github'; - static const Gmi = 'gmi'; - static const Gmicloud = 'gmicloud'; - static const Gonka24 = 'gonka24'; - static const GradientAi = 'gradient_ai'; - static const Groq = 'groq'; - static const Helicone = 'helicone'; - static const Heroku = 'heroku'; - static const Hetzner = 'hetzner'; - static const HostedVllm = 'hosted_vllm'; - static const HpcAi = 'hpc_ai'; - static const Hyperbolic = 'hyperbolic'; - static const Iflowcn = 'iflowcn'; - static const Inception = 'inception'; - static const Inceptron = 'inceptron'; - static const InferenceNet = 'inference_net'; - static const Inferencehub = 'inferencehub'; - static const Inferx = 'inferx'; - static const Infinity = 'infinity'; - static const IoNet = 'io_net'; - static const Jiekou = 'jiekou'; - static const Kenari = 'kenari'; - static const Kilo = 'kilo'; - static const Kimi = 'kimi'; - static const KimiForCoding = 'kimi_for_coding'; - static const Kiro = 'kiro'; - static const KlusterAi = 'kluster_ai'; - static const Krutrim = 'krutrim'; - static const KuaeCloudCodingPlan = 'kuae_cloud_coding_plan'; - static const LambdaAi = 'lambda_ai'; - static const Lemonade = 'lemonade'; - static const LemonfoxAi = 'lemonfox_ai'; - static const Libertai = 'libertai'; - static const Lilac = 'lilac'; - static const Lingyiwanwu = 'lingyiwanwu'; - static const Llama = 'llama'; - static const Llamagate = 'llamagate'; - static const Llmgateway = 'llmgateway'; - static const Llmtr = 'llmtr'; - static const Longcat = 'longcat'; - static const Lucidquery = 'lucidquery'; - static const Lynkr = 'lynkr'; - static const Matterai = 'matterai'; - static const Meganova = 'meganova'; - static const MergeGateway = 'merge_gateway'; - static const Meta = 'meta'; - static const MetaLlama = 'meta_llama'; - static const Mimo = 'mimo'; - static const Minimax = 'minimax'; - static const MinimaxCn = 'minimax_cn'; - static const MinimaxCnCodingPlan = 'minimax_cn_coding_plan'; - static const MinimaxCodingPlan = 'minimax_coding_plan'; - static const Mira = 'mira'; - static const Mixlayer = 'mixlayer'; - static const Moark = 'moark'; - static const Modal = 'modal'; - static const ModelOracleAi = 'model_oracle_ai'; - static const Modelscope = 'modelscope'; - static const Moonshotai = 'moonshotai'; - static const MoonshotaiCn = 'moonshotai_cn'; - static const Morph = 'morph'; - static const Nanogpt = 'nanogpt'; - static const Ncompass = 'ncompass'; - static const Nearai = 'nearai'; - static const Nebius = 'nebius'; - static const Neon = 'neon'; - static const Neuralwatt = 'neuralwatt'; - static const Nextbit = 'nextbit'; - static const NlpCloud = 'nlp_cloud'; - static const NousResearch = 'nous_research'; - static const Novita = 'novita'; - static const Nscale = 'nscale'; - static const NvidiaNim = 'nvidia_nim'; - static const Oci = 'oci'; - static const Ofox = 'ofox'; - static const Ohmygpt = 'ohmygpt'; - static const OllamaCloud = 'ollama_cloud'; - static const Openaimax = 'openaimax'; - static const Openaisb = 'openaisb'; - static const Opencode = 'opencode'; - static const OpencodeGo = 'opencode_go'; - static const OpencodeZen = 'opencode_zen'; - static const Orcarouter = 'orcarouter'; - static const Ovhcloud = 'ovhcloud'; - static const Parasail = 'parasail'; - static const Perfxcloud = 'perfxcloud'; - static const Perplexity = 'perplexity'; - static const PerplexityAgent = 'perplexity_agent'; - static const Petals = 'petals'; - static const Pinstripes = 'pinstripes'; - static const Pioneer = 'pioneer'; - static const Poe = 'poe'; - static const Poolside = 'poolside'; - static const Portkey = 'portkey'; - static const Ppinfra = 'ppinfra'; - static const Predibase = 'predibase'; - static const PrivatemodeAi = 'privatemode_ai'; - static const Publicai = 'publicai'; - static const QihangAi = 'qihang_ai'; - static const Qihoo360 = 'qihoo360'; - static const QiniuAi = 'qiniu_ai'; - static const RegoloAi = 'regolo_ai'; - static const RekaAi = 'reka_ai'; - static const Requesty = 'requesty'; - static const Reve = 'reve'; - static const RoutingRun = 'routing_run'; - static const Sakana = 'sakana'; - static const Sambanova = 'sambanova'; - static const Sarvam = 'sarvam'; - static const Scaleway = 'scaleway'; - static const ScxAi = 'scx_ai'; - static const Siliconflow = 'siliconflow'; - static const Snowflake = 'snowflake'; - static const SnowflakeCortex = 'snowflake_cortex'; - static const Stackit = 'stackit'; - static const Stepfun = 'stepfun'; - static const StepfunAiStepPlan = 'stepfun_ai_step_plan'; - static const StepfunStepPlan = 'stepfun_step_plan'; - static const Subconscious = 'subconscious'; - static const Submodel = 'submodel'; - static const Synthetic = 'synthetic'; - static const Tencent = 'tencent'; - static const TencentCodingPlan = 'tencent_coding_plan'; - static const TencentTokenPlan = 'tencent_token_plan'; - static const TencentTokenPlanEnterpriseAuto = 'tencent_token_plan_enterprise_auto'; - static const TencentTokenPlanEnterprisePro = 'tencent_token_plan_enterprise_pro'; - static const TencentTokenPlanGeneralPersonal = 'tencent_token_plan_general_personal'; - static const TencentTokenPlanHyPersonal = 'tencent_token_plan_hy_personal'; - static const TencentTokenhub = 'tencent_tokenhub'; - static const Tensormesh = 'tensormesh'; - static const TheGridAi = 'the_grid_ai'; - static const Thinkingmachines = 'thinkingmachines'; - static const Tinfoil = 'tinfoil'; - static const Togetherai = 'togetherai'; - static const Tokenflux = 'tokenflux'; - static const Tokenpony = 'tokenpony'; - static const Trustedrouter = 'trustedrouter'; - static const Tundra = 'tundra'; - static const UmansAi = 'umans_ai'; - static const Unorouter = 'unorouter'; - static const Upstage = 'upstage'; - static const V0 = 'v0'; - static const Venice = 'venice'; - static const Vercel = 'vercel'; - static const Vivgrid = 'vivgrid'; - static const VolcEngine = 'volc_engine'; - static const Vultr = 'vultr'; - static const Wafer = 'wafer'; - static const Wandb = 'wandb'; - static const XiaomiTokenPlanAms = 'xiaomi_token_plan_ams'; - static const XiaomiTokenPlanCn = 'xiaomi_token_plan_cn'; - static const XiaomiTokenPlanSgp = 'xiaomi_token_plan_sgp'; - static const Xiaomimimo = 'xiaomimimo'; - static const Xpersona = 'xpersona'; - static const Xunfei = 'xunfei'; - static const Zai = 'zai'; - static const ZaiCodingPlan = 'zai_coding_plan'; - static const Zeldoc = 'zeldoc'; - static const Zenmux = 'zenmux'; - static const ZhipuV4 = 'zhipu_v4'; - static const ZhipuaiCodingPlan = 'zhipuai_coding_plan'; -} diff --git a/bindings/go/provider_name.go b/bindings/go/provider_name.go deleted file mode 100644 index 9c4fae0a0..000000000 --- a/bindings/go/provider_name.go +++ /dev/null @@ -1,260 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package aimux - -// ProviderName is the registry name of a built-in OpenAI-compatible provider. -type ProviderName string - -const ( - Abacus ProviderName = "abacus" - AbliterationAi ProviderName = "abliteration_ai" - Ai21 ProviderName = "ai21" - Ai302 ProviderName = "ai302" - AiRouter ProviderName = "ai_router" - Aiand ProviderName = "aiand" - Aibadgr ProviderName = "aibadgr" - Aigc2d ProviderName = "aigc2d" - Aihubmix ProviderName = "aihubmix" - Ails ProviderName = "ails" - Aiml ProviderName = "aiml" - AkiIo ProviderName = "aki_io" - Albert ProviderName = "albert" - Alibaba ProviderName = "alibaba" - AlibabaCodingPlan ProviderName = "alibaba_coding_plan" - AlibabaCodingPlanCn ProviderName = "alibaba_coding_plan_cn" - AlibabaTokenPlan ProviderName = "alibaba_token_plan" - AlibabaTokenPlanCn ProviderName = "alibaba_token_plan_cn" - Ambient ProviderName = "ambient" - Anyapi ProviderName = "anyapi" - Anyscale ProviderName = "anyscale" - Apertis ProviderName = "apertis" - Api2d ProviderName = "api2d" - Api2gpt ProviderName = "api2gpt" - Apiserpent ProviderName = "apiserpent" - Atlascloud ProviderName = "atlascloud" - AtomicChat ProviderName = "atomic_chat" - Auriko ProviderName = "auriko" - AzureAi ProviderName = "azure_ai" - Baichuan ProviderName = "baichuan" - Baidu ProviderName = "baidu" - BaiduV2 ProviderName = "baidu_v2" - Bailing ProviderName = "bailing" - Baseten ProviderName = "baseten" - Berget ProviderName = "berget" - Bigmodel ProviderName = "bigmodel" - Blueclaw ProviderName = "blueclaw" - Bytedance ProviderName = "bytedance" - Byteplus ProviderName = "byteplus" - Bytez ProviderName = "bytez" - Canopywave ProviderName = "canopywave" - Cerebras ProviderName = "cerebras" - Chatgpt ProviderName = "chatgpt" - Cherryin ProviderName = "cherryin" - Chutes ProviderName = "chutes" - Clarifai ProviderName = "clarifai" - Claudinio ProviderName = "claudinio" - ClinePass ProviderName = "cline_pass" - Closeai ProviderName = "closeai" - CloudferroSherlock ProviderName = "cloudferro_sherlock" - Cloudflare ProviderName = "cloudflare" - CloudflareWorkersAi ProviderName = "cloudflare_workers_ai" - Codestral ProviderName = "codestral" - Cometapi ProviderName = "cometapi" - Commandcode ProviderName = "commandcode" - Compactifai ProviderName = "compactifai" - Copilot ProviderName = "copilot" - Cortecs ProviderName = "cortecs" - Coze ProviderName = "coze" - Crof ProviderName = "crof" - Crossmodel ProviderName = "crossmodel" - Crusoe ProviderName = "crusoe" - Daoxe ProviderName = "daoxe" - Darkbloom ProviderName = "darkbloom" - Databricks ProviderName = "databricks" - Datarobot ProviderName = "datarobot" - Deepbricks ProviderName = "deepbricks" - Deepinfra ProviderName = "deepinfra" - Deepseek ProviderName = "deepseek" - Digitalocean ProviderName = "digitalocean" - Dinference ProviderName = "dinference" - Doubao ProviderName = "doubao" - Doubleword ProviderName = "doubleword" - Drun ProviderName = "drun" - Ebcloud ProviderName = "ebcloud" - Embercloud ProviderName = "embercloud" - Empiriolabs ProviderName = "empiriolabs" - Evroc ProviderName = "evroc" - Fastcrw ProviderName = "fastcrw" - Fastgpt ProviderName = "fastgpt" - Fastrouter ProviderName = "fastrouter" - FeatherlessAi ProviderName = "featherless_ai" - Firepass ProviderName = "firepass" - Fireworks ProviderName = "fireworks" - Freemodel ProviderName = "freemodel" - Friendliai ProviderName = "friendliai" - Frogbot ProviderName = "frogbot" - Galadriel ProviderName = "galadriel" - Gdc ProviderName = "gdc" - Gigachat ProviderName = "gigachat" - Github ProviderName = "github" - Gmi ProviderName = "gmi" - Gmicloud ProviderName = "gmicloud" - Gonka24 ProviderName = "gonka24" - GradientAi ProviderName = "gradient_ai" - Groq ProviderName = "groq" - Helicone ProviderName = "helicone" - Heroku ProviderName = "heroku" - Hetzner ProviderName = "hetzner" - HostedVllm ProviderName = "hosted_vllm" - HpcAi ProviderName = "hpc_ai" - Hyperbolic ProviderName = "hyperbolic" - Iflowcn ProviderName = "iflowcn" - Inception ProviderName = "inception" - Inceptron ProviderName = "inceptron" - InferenceNet ProviderName = "inference_net" - Inferencehub ProviderName = "inferencehub" - Inferx ProviderName = "inferx" - Infinity ProviderName = "infinity" - IoNet ProviderName = "io_net" - Jiekou ProviderName = "jiekou" - Kenari ProviderName = "kenari" - Kilo ProviderName = "kilo" - Kimi ProviderName = "kimi" - KimiForCoding ProviderName = "kimi_for_coding" - Kiro ProviderName = "kiro" - KlusterAi ProviderName = "kluster_ai" - Krutrim ProviderName = "krutrim" - KuaeCloudCodingPlan ProviderName = "kuae_cloud_coding_plan" - LambdaAi ProviderName = "lambda_ai" - Lemonade ProviderName = "lemonade" - LemonfoxAi ProviderName = "lemonfox_ai" - Libertai ProviderName = "libertai" - Lilac ProviderName = "lilac" - Lingyiwanwu ProviderName = "lingyiwanwu" - Llama ProviderName = "llama" - Llamagate ProviderName = "llamagate" - Llmgateway ProviderName = "llmgateway" - Llmtr ProviderName = "llmtr" - Longcat ProviderName = "longcat" - Lucidquery ProviderName = "lucidquery" - Lynkr ProviderName = "lynkr" - Matterai ProviderName = "matterai" - Meganova ProviderName = "meganova" - MergeGateway ProviderName = "merge_gateway" - Meta ProviderName = "meta" - MetaLlama ProviderName = "meta_llama" - Mimo ProviderName = "mimo" - Minimax ProviderName = "minimax" - MinimaxCn ProviderName = "minimax_cn" - MinimaxCnCodingPlan ProviderName = "minimax_cn_coding_plan" - MinimaxCodingPlan ProviderName = "minimax_coding_plan" - Mira ProviderName = "mira" - Mixlayer ProviderName = "mixlayer" - Moark ProviderName = "moark" - Modal ProviderName = "modal" - ModelOracleAi ProviderName = "model_oracle_ai" - Modelscope ProviderName = "modelscope" - Moonshotai ProviderName = "moonshotai" - MoonshotaiCn ProviderName = "moonshotai_cn" - Morph ProviderName = "morph" - Nanogpt ProviderName = "nanogpt" - Ncompass ProviderName = "ncompass" - Nearai ProviderName = "nearai" - Nebius ProviderName = "nebius" - Neon ProviderName = "neon" - Neuralwatt ProviderName = "neuralwatt" - Nextbit ProviderName = "nextbit" - NlpCloud ProviderName = "nlp_cloud" - NousResearch ProviderName = "nous_research" - Novita ProviderName = "novita" - Nscale ProviderName = "nscale" - NvidiaNim ProviderName = "nvidia_nim" - Oci ProviderName = "oci" - Ofox ProviderName = "ofox" - Ohmygpt ProviderName = "ohmygpt" - OllamaCloud ProviderName = "ollama_cloud" - Openaimax ProviderName = "openaimax" - Openaisb ProviderName = "openaisb" - Opencode ProviderName = "opencode" - OpencodeGo ProviderName = "opencode_go" - OpencodeZen ProviderName = "opencode_zen" - Orcarouter ProviderName = "orcarouter" - Ovhcloud ProviderName = "ovhcloud" - Parasail ProviderName = "parasail" - Perfxcloud ProviderName = "perfxcloud" - Perplexity ProviderName = "perplexity" - PerplexityAgent ProviderName = "perplexity_agent" - Petals ProviderName = "petals" - Pinstripes ProviderName = "pinstripes" - Pioneer ProviderName = "pioneer" - Poe ProviderName = "poe" - Poolside ProviderName = "poolside" - Portkey ProviderName = "portkey" - Ppinfra ProviderName = "ppinfra" - Predibase ProviderName = "predibase" - PrivatemodeAi ProviderName = "privatemode_ai" - Publicai ProviderName = "publicai" - QihangAi ProviderName = "qihang_ai" - Qihoo360 ProviderName = "qihoo360" - QiniuAi ProviderName = "qiniu_ai" - RegoloAi ProviderName = "regolo_ai" - RekaAi ProviderName = "reka_ai" - Requesty ProviderName = "requesty" - Reve ProviderName = "reve" - RoutingRun ProviderName = "routing_run" - Sakana ProviderName = "sakana" - Sambanova ProviderName = "sambanova" - Sarvam ProviderName = "sarvam" - Scaleway ProviderName = "scaleway" - ScxAi ProviderName = "scx_ai" - Siliconflow ProviderName = "siliconflow" - Snowflake ProviderName = "snowflake" - SnowflakeCortex ProviderName = "snowflake_cortex" - Stackit ProviderName = "stackit" - Stepfun ProviderName = "stepfun" - StepfunAiStepPlan ProviderName = "stepfun_ai_step_plan" - StepfunStepPlan ProviderName = "stepfun_step_plan" - Subconscious ProviderName = "subconscious" - Submodel ProviderName = "submodel" - Synthetic ProviderName = "synthetic" - Tencent ProviderName = "tencent" - TencentCodingPlan ProviderName = "tencent_coding_plan" - TencentTokenPlan ProviderName = "tencent_token_plan" - TencentTokenPlanEnterpriseAuto ProviderName = "tencent_token_plan_enterprise_auto" - TencentTokenPlanEnterprisePro ProviderName = "tencent_token_plan_enterprise_pro" - TencentTokenPlanGeneralPersonal ProviderName = "tencent_token_plan_general_personal" - TencentTokenPlanHyPersonal ProviderName = "tencent_token_plan_hy_personal" - TencentTokenhub ProviderName = "tencent_tokenhub" - Tensormesh ProviderName = "tensormesh" - TheGridAi ProviderName = "the_grid_ai" - Thinkingmachines ProviderName = "thinkingmachines" - Tinfoil ProviderName = "tinfoil" - Togetherai ProviderName = "togetherai" - Tokenflux ProviderName = "tokenflux" - Tokenpony ProviderName = "tokenpony" - Trustedrouter ProviderName = "trustedrouter" - Tundra ProviderName = "tundra" - UmansAi ProviderName = "umans_ai" - Unorouter ProviderName = "unorouter" - Upstage ProviderName = "upstage" - V0 ProviderName = "v0" - Venice ProviderName = "venice" - Vercel ProviderName = "vercel" - Vivgrid ProviderName = "vivgrid" - VolcEngine ProviderName = "volc_engine" - Vultr ProviderName = "vultr" - Wafer ProviderName = "wafer" - Wandb ProviderName = "wandb" - XiaomiTokenPlanAms ProviderName = "xiaomi_token_plan_ams" - XiaomiTokenPlanCn ProviderName = "xiaomi_token_plan_cn" - XiaomiTokenPlanSgp ProviderName = "xiaomi_token_plan_sgp" - Xiaomimimo ProviderName = "xiaomimimo" - Xpersona ProviderName = "xpersona" - Xunfei ProviderName = "xunfei" - Zai ProviderName = "zai" - ZaiCodingPlan ProviderName = "zai_coding_plan" - Zeldoc ProviderName = "zeldoc" - Zenmux ProviderName = "zenmux" - ZhipuV4 ProviderName = "zhipu_v4" - ZhipuaiCodingPlan ProviderName = "zhipuai_coding_plan" -) diff --git a/bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java b/bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java deleted file mode 100644 index 0c3ffc1fb..000000000 --- a/bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java +++ /dev/null @@ -1,260 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package ai.arcships.aimux; - -/** Names of all built-in OpenAI-compatible providers. */ -public final class ProviderName { - private ProviderName() {} - - public static final String ABACUS = "abacus"; - public static final String ABLITERATIONAI = "abliteration_ai"; - public static final String AI21 = "ai21"; - public static final String AI302 = "ai302"; - public static final String AIROUTER = "ai_router"; - public static final String AIAND = "aiand"; - public static final String AIBADGR = "aibadgr"; - public static final String AIGC2D = "aigc2d"; - public static final String AIHUBMIX = "aihubmix"; - public static final String AILS = "ails"; - public static final String AIML = "aiml"; - public static final String AKIIO = "aki_io"; - public static final String ALBERT = "albert"; - public static final String ALIBABA = "alibaba"; - public static final String ALIBABACODINGPLAN = "alibaba_coding_plan"; - public static final String ALIBABACODINGPLANCN = "alibaba_coding_plan_cn"; - public static final String ALIBABATOKENPLAN = "alibaba_token_plan"; - public static final String ALIBABATOKENPLANCN = "alibaba_token_plan_cn"; - public static final String AMBIENT = "ambient"; - public static final String ANYAPI = "anyapi"; - public static final String ANYSCALE = "anyscale"; - public static final String APERTIS = "apertis"; - public static final String API2D = "api2d"; - public static final String API2GPT = "api2gpt"; - public static final String APISERPENT = "apiserpent"; - public static final String ATLASCLOUD = "atlascloud"; - public static final String ATOMICCHAT = "atomic_chat"; - public static final String AURIKO = "auriko"; - public static final String AZUREAI = "azure_ai"; - public static final String BAICHUAN = "baichuan"; - public static final String BAIDU = "baidu"; - public static final String BAIDUV2 = "baidu_v2"; - public static final String BAILING = "bailing"; - public static final String BASETEN = "baseten"; - public static final String BERGET = "berget"; - public static final String BIGMODEL = "bigmodel"; - public static final String BLUECLAW = "blueclaw"; - public static final String BYTEDANCE = "bytedance"; - public static final String BYTEPLUS = "byteplus"; - public static final String BYTEZ = "bytez"; - public static final String CANOPYWAVE = "canopywave"; - public static final String CEREBRAS = "cerebras"; - public static final String CHATGPT = "chatgpt"; - public static final String CHERRYIN = "cherryin"; - public static final String CHUTES = "chutes"; - public static final String CLARIFAI = "clarifai"; - public static final String CLAUDINIO = "claudinio"; - public static final String CLINEPASS = "cline_pass"; - public static final String CLOSEAI = "closeai"; - public static final String CLOUDFERROSHERLOCK = "cloudferro_sherlock"; - public static final String CLOUDFLARE = "cloudflare"; - public static final String CLOUDFLAREWORKERSAI = "cloudflare_workers_ai"; - public static final String CODESTRAL = "codestral"; - public static final String COMETAPI = "cometapi"; - public static final String COMMANDCODE = "commandcode"; - public static final String COMPACTIFAI = "compactifai"; - public static final String COPILOT = "copilot"; - public static final String CORTECS = "cortecs"; - public static final String COZE = "coze"; - public static final String CROF = "crof"; - public static final String CROSSMODEL = "crossmodel"; - public static final String CRUSOE = "crusoe"; - public static final String DAOXE = "daoxe"; - public static final String DARKBLOOM = "darkbloom"; - public static final String DATABRICKS = "databricks"; - public static final String DATAROBOT = "datarobot"; - public static final String DEEPBRICKS = "deepbricks"; - public static final String DEEPINFRA = "deepinfra"; - public static final String DEEPSEEK = "deepseek"; - public static final String DIGITALOCEAN = "digitalocean"; - public static final String DINFERENCE = "dinference"; - public static final String DOUBAO = "doubao"; - public static final String DOUBLEWORD = "doubleword"; - public static final String DRUN = "drun"; - public static final String EBCLOUD = "ebcloud"; - public static final String EMBERCLOUD = "embercloud"; - public static final String EMPIRIOLABS = "empiriolabs"; - public static final String EVROC = "evroc"; - public static final String FASTCRW = "fastcrw"; - public static final String FASTGPT = "fastgpt"; - public static final String FASTROUTER = "fastrouter"; - public static final String FEATHERLESSAI = "featherless_ai"; - public static final String FIREPASS = "firepass"; - public static final String FIREWORKS = "fireworks"; - public static final String FREEMODEL = "freemodel"; - public static final String FRIENDLIAI = "friendliai"; - public static final String FROGBOT = "frogbot"; - public static final String GALADRIEL = "galadriel"; - public static final String GDC = "gdc"; - public static final String GIGACHAT = "gigachat"; - public static final String GITHUB = "github"; - public static final String GMI = "gmi"; - public static final String GMICLOUD = "gmicloud"; - public static final String GONKA24 = "gonka24"; - public static final String GRADIENTAI = "gradient_ai"; - public static final String GROQ = "groq"; - public static final String HELICONE = "helicone"; - public static final String HEROKU = "heroku"; - public static final String HETZNER = "hetzner"; - public static final String HOSTEDVLLM = "hosted_vllm"; - public static final String HPCAI = "hpc_ai"; - public static final String HYPERBOLIC = "hyperbolic"; - public static final String IFLOWCN = "iflowcn"; - public static final String INCEPTION = "inception"; - public static final String INCEPTRON = "inceptron"; - public static final String INFERENCENET = "inference_net"; - public static final String INFERENCEHUB = "inferencehub"; - public static final String INFERX = "inferx"; - public static final String INFINITY = "infinity"; - public static final String IONET = "io_net"; - public static final String JIEKOU = "jiekou"; - public static final String KENARI = "kenari"; - public static final String KILO = "kilo"; - public static final String KIMI = "kimi"; - public static final String KIMIFORCODING = "kimi_for_coding"; - public static final String KIRO = "kiro"; - public static final String KLUSTERAI = "kluster_ai"; - public static final String KRUTRIM = "krutrim"; - public static final String KUAECLOUDCODINGPLAN = "kuae_cloud_coding_plan"; - public static final String LAMBDAAI = "lambda_ai"; - public static final String LEMONADE = "lemonade"; - public static final String LEMONFOXAI = "lemonfox_ai"; - public static final String LIBERTAI = "libertai"; - public static final String LILAC = "lilac"; - public static final String LINGYIWANWU = "lingyiwanwu"; - public static final String LLAMA = "llama"; - public static final String LLAMAGATE = "llamagate"; - public static final String LLMGATEWAY = "llmgateway"; - public static final String LLMTR = "llmtr"; - public static final String LONGCAT = "longcat"; - public static final String LUCIDQUERY = "lucidquery"; - public static final String LYNKR = "lynkr"; - public static final String MATTERAI = "matterai"; - public static final String MEGANOVA = "meganova"; - public static final String MERGEGATEWAY = "merge_gateway"; - public static final String META = "meta"; - public static final String METALLAMA = "meta_llama"; - public static final String MIMO = "mimo"; - public static final String MINIMAX = "minimax"; - public static final String MINIMAXCN = "minimax_cn"; - public static final String MINIMAXCNCODINGPLAN = "minimax_cn_coding_plan"; - public static final String MINIMAXCODINGPLAN = "minimax_coding_plan"; - public static final String MIRA = "mira"; - public static final String MIXLAYER = "mixlayer"; - public static final String MOARK = "moark"; - public static final String MODAL = "modal"; - public static final String MODELORACLEAI = "model_oracle_ai"; - public static final String MODELSCOPE = "modelscope"; - public static final String MOONSHOTAI = "moonshotai"; - public static final String MOONSHOTAICN = "moonshotai_cn"; - public static final String MORPH = "morph"; - public static final String NANOGPT = "nanogpt"; - public static final String NCOMPASS = "ncompass"; - public static final String NEARAI = "nearai"; - public static final String NEBIUS = "nebius"; - public static final String NEON = "neon"; - public static final String NEURALWATT = "neuralwatt"; - public static final String NEXTBIT = "nextbit"; - public static final String NLPCLOUD = "nlp_cloud"; - public static final String NOUSRESEARCH = "nous_research"; - public static final String NOVITA = "novita"; - public static final String NSCALE = "nscale"; - public static final String NVIDIANIM = "nvidia_nim"; - public static final String OCI = "oci"; - public static final String OFOX = "ofox"; - public static final String OHMYGPT = "ohmygpt"; - public static final String OLLAMACLOUD = "ollama_cloud"; - public static final String OPENAIMAX = "openaimax"; - public static final String OPENAISB = "openaisb"; - public static final String OPENCODE = "opencode"; - public static final String OPENCODEGO = "opencode_go"; - public static final String OPENCODEZEN = "opencode_zen"; - public static final String ORCAROUTER = "orcarouter"; - public static final String OVHCLOUD = "ovhcloud"; - public static final String PARASAIL = "parasail"; - public static final String PERFXCLOUD = "perfxcloud"; - public static final String PERPLEXITY = "perplexity"; - public static final String PERPLEXITYAGENT = "perplexity_agent"; - public static final String PETALS = "petals"; - public static final String PINSTRIPES = "pinstripes"; - public static final String PIONEER = "pioneer"; - public static final String POE = "poe"; - public static final String POOLSIDE = "poolside"; - public static final String PORTKEY = "portkey"; - public static final String PPINFRA = "ppinfra"; - public static final String PREDIBASE = "predibase"; - public static final String PRIVATEMODEAI = "privatemode_ai"; - public static final String PUBLICAI = "publicai"; - public static final String QIHANGAI = "qihang_ai"; - public static final String QIHOO360 = "qihoo360"; - public static final String QINIUAI = "qiniu_ai"; - public static final String REGOLOAI = "regolo_ai"; - public static final String REKAAI = "reka_ai"; - public static final String REQUESTY = "requesty"; - public static final String REVE = "reve"; - public static final String ROUTINGRUN = "routing_run"; - public static final String SAKANA = "sakana"; - public static final String SAMBANOVA = "sambanova"; - public static final String SARVAM = "sarvam"; - public static final String SCALEWAY = "scaleway"; - public static final String SCXAI = "scx_ai"; - public static final String SILICONFLOW = "siliconflow"; - public static final String SNOWFLAKE = "snowflake"; - public static final String SNOWFLAKECORTEX = "snowflake_cortex"; - public static final String STACKIT = "stackit"; - public static final String STEPFUN = "stepfun"; - public static final String STEPFUNAISTEPPLAN = "stepfun_ai_step_plan"; - public static final String STEPFUNSTEPPLAN = "stepfun_step_plan"; - public static final String SUBCONSCIOUS = "subconscious"; - public static final String SUBMODEL = "submodel"; - public static final String SYNTHETIC = "synthetic"; - public static final String TENCENT = "tencent"; - public static final String TENCENTCODINGPLAN = "tencent_coding_plan"; - public static final String TENCENTTOKENPLAN = "tencent_token_plan"; - public static final String TENCENTTOKENPLANENTERPRISEAUTO = "tencent_token_plan_enterprise_auto"; - public static final String TENCENTTOKENPLANENTERPRISEPRO = "tencent_token_plan_enterprise_pro"; - public static final String TENCENTTOKENPLANGENERALPERSONAL = "tencent_token_plan_general_personal"; - public static final String TENCENTTOKENPLANHYPERSONAL = "tencent_token_plan_hy_personal"; - public static final String TENCENTTOKENHUB = "tencent_tokenhub"; - public static final String TENSORMESH = "tensormesh"; - public static final String THEGRIDAI = "the_grid_ai"; - public static final String THINKINGMACHINES = "thinkingmachines"; - public static final String TINFOIL = "tinfoil"; - public static final String TOGETHERAI = "togetherai"; - public static final String TOKENFLUX = "tokenflux"; - public static final String TOKENPONY = "tokenpony"; - public static final String TRUSTEDROUTER = "trustedrouter"; - public static final String TUNDRA = "tundra"; - public static final String UMANSAI = "umans_ai"; - public static final String UNOROUTER = "unorouter"; - public static final String UPSTAGE = "upstage"; - public static final String V0 = "v0"; - public static final String VENICE = "venice"; - public static final String VERCEL = "vercel"; - public static final String VIVGRID = "vivgrid"; - public static final String VOLCENGINE = "volc_engine"; - public static final String VULTR = "vultr"; - public static final String WAFER = "wafer"; - public static final String WANDB = "wandb"; - public static final String XIAOMITOKENPLANAMS = "xiaomi_token_plan_ams"; - public static final String XIAOMITOKENPLANCN = "xiaomi_token_plan_cn"; - public static final String XIAOMITOKENPLANSGP = "xiaomi_token_plan_sgp"; - public static final String XIAOMIMIMO = "xiaomimimo"; - public static final String XPERSONA = "xpersona"; - public static final String XUNFEI = "xunfei"; - public static final String ZAI = "zai"; - public static final String ZAICODINGPLAN = "zai_coding_plan"; - public static final String ZELDOC = "zeldoc"; - public static final String ZENMUX = "zenmux"; - public static final String ZHIPUV4 = "zhipu_v4"; - public static final String ZHIPUAICODINGPLAN = "zhipuai_coding_plan"; -} diff --git a/bindings/java/src/test/java/ai/arcships/aimux/ModelTest.java b/bindings/java/src/test/java/ai/arcships/aimux/ModelTest.java index 470189df2..0edddeec5 100644 --- a/bindings/java/src/test/java/ai/arcships/aimux/ModelTest.java +++ b/bindings/java/src/test/java/ai/arcships/aimux/ModelTest.java @@ -60,15 +60,6 @@ void providerCreatesModelInstanceFromRegistry() { } } - @Test - void providerCreatesModelWithProviderNameConstant() { - // Recommended typed spelling: ProviderName.GROQ constant (key is - // validated on the first API call, not construction). - try (Model model = Model.provider(ProviderName.GROQ, "sk-test-fake-key", "llama-3.3-70b", null)) { - assertThat(model).isNotNull(); - } - } - // ── generation ────────────────────────────────────────────────────────── @Test diff --git a/bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt b/bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt deleted file mode 100644 index ad55711e8..000000000 --- a/bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt +++ /dev/null @@ -1,258 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package ai.arcships.aimux - -/** Names of all built-in OpenAI-compatible providers. */ -object ProviderName { - const val ABACUS = "abacus" - const val ABLITERATIONAI = "abliteration_ai" - const val AI21 = "ai21" - const val AI302 = "ai302" - const val AIROUTER = "ai_router" - const val AIAND = "aiand" - const val AIBADGR = "aibadgr" - const val AIGC2D = "aigc2d" - const val AIHUBMIX = "aihubmix" - const val AILS = "ails" - const val AIML = "aiml" - const val AKIIO = "aki_io" - const val ALBERT = "albert" - const val ALIBABA = "alibaba" - const val ALIBABACODINGPLAN = "alibaba_coding_plan" - const val ALIBABACODINGPLANCN = "alibaba_coding_plan_cn" - const val ALIBABATOKENPLAN = "alibaba_token_plan" - const val ALIBABATOKENPLANCN = "alibaba_token_plan_cn" - const val AMBIENT = "ambient" - const val ANYAPI = "anyapi" - const val ANYSCALE = "anyscale" - const val APERTIS = "apertis" - const val API2D = "api2d" - const val API2GPT = "api2gpt" - const val APISERPENT = "apiserpent" - const val ATLASCLOUD = "atlascloud" - const val ATOMICCHAT = "atomic_chat" - const val AURIKO = "auriko" - const val AZUREAI = "azure_ai" - const val BAICHUAN = "baichuan" - const val BAIDU = "baidu" - const val BAIDUV2 = "baidu_v2" - const val BAILING = "bailing" - const val BASETEN = "baseten" - const val BERGET = "berget" - const val BIGMODEL = "bigmodel" - const val BLUECLAW = "blueclaw" - const val BYTEDANCE = "bytedance" - const val BYTEPLUS = "byteplus" - const val BYTEZ = "bytez" - const val CANOPYWAVE = "canopywave" - const val CEREBRAS = "cerebras" - const val CHATGPT = "chatgpt" - const val CHERRYIN = "cherryin" - const val CHUTES = "chutes" - const val CLARIFAI = "clarifai" - const val CLAUDINIO = "claudinio" - const val CLINEPASS = "cline_pass" - const val CLOSEAI = "closeai" - const val CLOUDFERROSHERLOCK = "cloudferro_sherlock" - const val CLOUDFLARE = "cloudflare" - const val CLOUDFLAREWORKERSAI = "cloudflare_workers_ai" - const val CODESTRAL = "codestral" - const val COMETAPI = "cometapi" - const val COMMANDCODE = "commandcode" - const val COMPACTIFAI = "compactifai" - const val COPILOT = "copilot" - const val CORTECS = "cortecs" - const val COZE = "coze" - const val CROF = "crof" - const val CROSSMODEL = "crossmodel" - const val CRUSOE = "crusoe" - const val DAOXE = "daoxe" - const val DARKBLOOM = "darkbloom" - const val DATABRICKS = "databricks" - const val DATAROBOT = "datarobot" - const val DEEPBRICKS = "deepbricks" - const val DEEPINFRA = "deepinfra" - const val DEEPSEEK = "deepseek" - const val DIGITALOCEAN = "digitalocean" - const val DINFERENCE = "dinference" - const val DOUBAO = "doubao" - const val DOUBLEWORD = "doubleword" - const val DRUN = "drun" - const val EBCLOUD = "ebcloud" - const val EMBERCLOUD = "embercloud" - const val EMPIRIOLABS = "empiriolabs" - const val EVROC = "evroc" - const val FASTCRW = "fastcrw" - const val FASTGPT = "fastgpt" - const val FASTROUTER = "fastrouter" - const val FEATHERLESSAI = "featherless_ai" - const val FIREPASS = "firepass" - const val FIREWORKS = "fireworks" - const val FREEMODEL = "freemodel" - const val FRIENDLIAI = "friendliai" - const val FROGBOT = "frogbot" - const val GALADRIEL = "galadriel" - const val GDC = "gdc" - const val GIGACHAT = "gigachat" - const val GITHUB = "github" - const val GMI = "gmi" - const val GMICLOUD = "gmicloud" - const val GONKA24 = "gonka24" - const val GRADIENTAI = "gradient_ai" - const val GROQ = "groq" - const val HELICONE = "helicone" - const val HEROKU = "heroku" - const val HETZNER = "hetzner" - const val HOSTEDVLLM = "hosted_vllm" - const val HPCAI = "hpc_ai" - const val HYPERBOLIC = "hyperbolic" - const val IFLOWCN = "iflowcn" - const val INCEPTION = "inception" - const val INCEPTRON = "inceptron" - const val INFERENCENET = "inference_net" - const val INFERENCEHUB = "inferencehub" - const val INFERX = "inferx" - const val INFINITY = "infinity" - const val IONET = "io_net" - const val JIEKOU = "jiekou" - const val KENARI = "kenari" - const val KILO = "kilo" - const val KIMI = "kimi" - const val KIMIFORCODING = "kimi_for_coding" - const val KIRO = "kiro" - const val KLUSTERAI = "kluster_ai" - const val KRUTRIM = "krutrim" - const val KUAECLOUDCODINGPLAN = "kuae_cloud_coding_plan" - const val LAMBDAAI = "lambda_ai" - const val LEMONADE = "lemonade" - const val LEMONFOXAI = "lemonfox_ai" - const val LIBERTAI = "libertai" - const val LILAC = "lilac" - const val LINGYIWANWU = "lingyiwanwu" - const val LLAMA = "llama" - const val LLAMAGATE = "llamagate" - const val LLMGATEWAY = "llmgateway" - const val LLMTR = "llmtr" - const val LONGCAT = "longcat" - const val LUCIDQUERY = "lucidquery" - const val LYNKR = "lynkr" - const val MATTERAI = "matterai" - const val MEGANOVA = "meganova" - const val MERGEGATEWAY = "merge_gateway" - const val META = "meta" - const val METALLAMA = "meta_llama" - const val MIMO = "mimo" - const val MINIMAX = "minimax" - const val MINIMAXCN = "minimax_cn" - const val MINIMAXCNCODINGPLAN = "minimax_cn_coding_plan" - const val MINIMAXCODINGPLAN = "minimax_coding_plan" - const val MIRA = "mira" - const val MIXLAYER = "mixlayer" - const val MOARK = "moark" - const val MODAL = "modal" - const val MODELORACLEAI = "model_oracle_ai" - const val MODELSCOPE = "modelscope" - const val MOONSHOTAI = "moonshotai" - const val MOONSHOTAICN = "moonshotai_cn" - const val MORPH = "morph" - const val NANOGPT = "nanogpt" - const val NCOMPASS = "ncompass" - const val NEARAI = "nearai" - const val NEBIUS = "nebius" - const val NEON = "neon" - const val NEURALWATT = "neuralwatt" - const val NEXTBIT = "nextbit" - const val NLPCLOUD = "nlp_cloud" - const val NOUSRESEARCH = "nous_research" - const val NOVITA = "novita" - const val NSCALE = "nscale" - const val NVIDIANIM = "nvidia_nim" - const val OCI = "oci" - const val OFOX = "ofox" - const val OHMYGPT = "ohmygpt" - const val OLLAMACLOUD = "ollama_cloud" - const val OPENAIMAX = "openaimax" - const val OPENAISB = "openaisb" - const val OPENCODE = "opencode" - const val OPENCODEGO = "opencode_go" - const val OPENCODEZEN = "opencode_zen" - const val ORCAROUTER = "orcarouter" - const val OVHCLOUD = "ovhcloud" - const val PARASAIL = "parasail" - const val PERFXCLOUD = "perfxcloud" - const val PERPLEXITY = "perplexity" - const val PERPLEXITYAGENT = "perplexity_agent" - const val PETALS = "petals" - const val PINSTRIPES = "pinstripes" - const val PIONEER = "pioneer" - const val POE = "poe" - const val POOLSIDE = "poolside" - const val PORTKEY = "portkey" - const val PPINFRA = "ppinfra" - const val PREDIBASE = "predibase" - const val PRIVATEMODEAI = "privatemode_ai" - const val PUBLICAI = "publicai" - const val QIHANGAI = "qihang_ai" - const val QIHOO360 = "qihoo360" - const val QINIUAI = "qiniu_ai" - const val REGOLOAI = "regolo_ai" - const val REKAAI = "reka_ai" - const val REQUESTY = "requesty" - const val REVE = "reve" - const val ROUTINGRUN = "routing_run" - const val SAKANA = "sakana" - const val SAMBANOVA = "sambanova" - const val SARVAM = "sarvam" - const val SCALEWAY = "scaleway" - const val SCXAI = "scx_ai" - const val SILICONFLOW = "siliconflow" - const val SNOWFLAKE = "snowflake" - const val SNOWFLAKECORTEX = "snowflake_cortex" - const val STACKIT = "stackit" - const val STEPFUN = "stepfun" - const val STEPFUNAISTEPPLAN = "stepfun_ai_step_plan" - const val STEPFUNSTEPPLAN = "stepfun_step_plan" - const val SUBCONSCIOUS = "subconscious" - const val SUBMODEL = "submodel" - const val SYNTHETIC = "synthetic" - const val TENCENT = "tencent" - const val TENCENTCODINGPLAN = "tencent_coding_plan" - const val TENCENTTOKENPLAN = "tencent_token_plan" - const val TENCENTTOKENPLANENTERPRISEAUTO = "tencent_token_plan_enterprise_auto" - const val TENCENTTOKENPLANENTERPRISEPRO = "tencent_token_plan_enterprise_pro" - const val TENCENTTOKENPLANGENERALPERSONAL = "tencent_token_plan_general_personal" - const val TENCENTTOKENPLANHYPERSONAL = "tencent_token_plan_hy_personal" - const val TENCENTTOKENHUB = "tencent_tokenhub" - const val TENSORMESH = "tensormesh" - const val THEGRIDAI = "the_grid_ai" - const val THINKINGMACHINES = "thinkingmachines" - const val TINFOIL = "tinfoil" - const val TOGETHERAI = "togetherai" - const val TOKENFLUX = "tokenflux" - const val TOKENPONY = "tokenpony" - const val TRUSTEDROUTER = "trustedrouter" - const val TUNDRA = "tundra" - const val UMANSAI = "umans_ai" - const val UNOROUTER = "unorouter" - const val UPSTAGE = "upstage" - const val V0 = "v0" - const val VENICE = "venice" - const val VERCEL = "vercel" - const val VIVGRID = "vivgrid" - const val VOLCENGINE = "volc_engine" - const val VULTR = "vultr" - const val WAFER = "wafer" - const val WANDB = "wandb" - const val XIAOMITOKENPLANAMS = "xiaomi_token_plan_ams" - const val XIAOMITOKENPLANCN = "xiaomi_token_plan_cn" - const val XIAOMITOKENPLANSGP = "xiaomi_token_plan_sgp" - const val XIAOMIMIMO = "xiaomimimo" - const val XPERSONA = "xpersona" - const val XUNFEI = "xunfei" - const val ZAI = "zai" - const val ZAICODINGPLAN = "zai_coding_plan" - const val ZELDOC = "zeldoc" - const val ZENMUX = "zenmux" - const val ZHIPUV4 = "zhipu_v4" - const val ZHIPUAICODINGPLAN = "zhipuai_coding_plan" -} diff --git a/bindings/kotlin/src/test/kotlin/ai/arcships/aimux/ModelTest.kt b/bindings/kotlin/src/test/kotlin/ai/arcships/aimux/ModelTest.kt index 33bfe2e85..61aa7d1d3 100644 --- a/bindings/kotlin/src/test/kotlin/ai/arcships/aimux/ModelTest.kt +++ b/bindings/kotlin/src/test/kotlin/ai/arcships/aimux/ModelTest.kt @@ -36,15 +36,6 @@ class ModelTest { } } - @Test - fun `provider creates model with ProviderName constant (recommended)`() { - // Recommended typed spelling: ProviderName.GROQ constant (key is - // validated on the first API call, not construction). - Model.provider(name = ProviderName.GROQ, apiKey = "sk-test-fake-key", modelId = "llama-3.3-70b").use { model -> - assertThat(model).isNotNull - } - } - @Test fun `generateText rejects malformed prompt JSON with IllegalArgumentException`() { Model.openai("sk-test-fake-key", "gpt-4o-mini").use { model -> diff --git a/bindings/node/package.json b/bindings/node/package.json index 6df016099..30ce4df5f 100644 --- a/bindings/node/package.json +++ b/bindings/node/package.json @@ -40,7 +40,7 @@ "scripts": { "build": "napi build --platform --release", "build:debug": "napi build --platform", - "build:typed": "tsc -p tsconfig.json", + "build:typed": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json", "test": "ava", "prepublishOnly": "npm run build:typed && napi prepublish -t npm --no-gh-release" }, diff --git a/bindings/node/src/index.ts b/bindings/node/src/index.ts index 17694d3ea..38505815e 100644 --- a/bindings/node/src/index.ts +++ b/bindings/node/src/index.ts @@ -131,11 +131,6 @@ export { // `AimuxResult` implementation type. export const recordingTryFlush: () => void = native.recordingTryFlush export const initRecording: (dir: string) => void = native.initRecording -// Both meanings: the `ProviderName` const object (runtime, for `ProviderName.groq`) -// and the derived string-union type. A value export resolves at runtime, so the -// specifier needs the real `.ts` extension for Node's type-stripping test runs; -// tsc rewrites it to `.js` on emit (rewriteRelativeImportExtensions). -export { ProviderName } from './types/ProviderName.ts' // Public type surface — typed objects, no `any`. export type { diff --git a/bindings/node/src/types/ProviderName.ts b/bindings/node/src/types/ProviderName.ts deleted file mode 100644 index 34fccb295..000000000 --- a/bindings/node/src/types/ProviderName.ts +++ /dev/null @@ -1,262 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/** - * Names of all built-in OpenAI-compatible providers. - * Use `ProviderName.groq` etc. as the `name` argument of `provider()`. - */ -export const ProviderName = { - abacus: 'abacus', - abliteration_ai: 'abliteration_ai', - ai21: 'ai21', - ai302: 'ai302', - ai_router: 'ai_router', - aiand: 'aiand', - aibadgr: 'aibadgr', - aigc2d: 'aigc2d', - aihubmix: 'aihubmix', - ails: 'ails', - aiml: 'aiml', - aki_io: 'aki_io', - albert: 'albert', - alibaba: 'alibaba', - alibaba_coding_plan: 'alibaba_coding_plan', - alibaba_coding_plan_cn: 'alibaba_coding_plan_cn', - alibaba_token_plan: 'alibaba_token_plan', - alibaba_token_plan_cn: 'alibaba_token_plan_cn', - ambient: 'ambient', - anyapi: 'anyapi', - anyscale: 'anyscale', - apertis: 'apertis', - api2d: 'api2d', - api2gpt: 'api2gpt', - apiserpent: 'apiserpent', - atlascloud: 'atlascloud', - atomic_chat: 'atomic_chat', - auriko: 'auriko', - azure_ai: 'azure_ai', - baichuan: 'baichuan', - baidu: 'baidu', - baidu_v2: 'baidu_v2', - bailing: 'bailing', - baseten: 'baseten', - berget: 'berget', - bigmodel: 'bigmodel', - blueclaw: 'blueclaw', - bytedance: 'bytedance', - byteplus: 'byteplus', - bytez: 'bytez', - canopywave: 'canopywave', - cerebras: 'cerebras', - chatgpt: 'chatgpt', - cherryin: 'cherryin', - chutes: 'chutes', - clarifai: 'clarifai', - claudinio: 'claudinio', - cline_pass: 'cline_pass', - closeai: 'closeai', - cloudferro_sherlock: 'cloudferro_sherlock', - cloudflare: 'cloudflare', - cloudflare_workers_ai: 'cloudflare_workers_ai', - codestral: 'codestral', - cometapi: 'cometapi', - commandcode: 'commandcode', - compactifai: 'compactifai', - copilot: 'copilot', - cortecs: 'cortecs', - coze: 'coze', - crof: 'crof', - crossmodel: 'crossmodel', - crusoe: 'crusoe', - daoxe: 'daoxe', - darkbloom: 'darkbloom', - databricks: 'databricks', - datarobot: 'datarobot', - deepbricks: 'deepbricks', - deepinfra: 'deepinfra', - deepseek: 'deepseek', - digitalocean: 'digitalocean', - dinference: 'dinference', - doubao: 'doubao', - doubleword: 'doubleword', - drun: 'drun', - ebcloud: 'ebcloud', - embercloud: 'embercloud', - empiriolabs: 'empiriolabs', - evroc: 'evroc', - fastcrw: 'fastcrw', - fastgpt: 'fastgpt', - fastrouter: 'fastrouter', - featherless_ai: 'featherless_ai', - firepass: 'firepass', - fireworks: 'fireworks', - freemodel: 'freemodel', - friendliai: 'friendliai', - frogbot: 'frogbot', - galadriel: 'galadriel', - gdc: 'gdc', - gigachat: 'gigachat', - github: 'github', - gmi: 'gmi', - gmicloud: 'gmicloud', - gonka24: 'gonka24', - gradient_ai: 'gradient_ai', - groq: 'groq', - helicone: 'helicone', - heroku: 'heroku', - hetzner: 'hetzner', - hosted_vllm: 'hosted_vllm', - hpc_ai: 'hpc_ai', - hyperbolic: 'hyperbolic', - iflowcn: 'iflowcn', - inception: 'inception', - inceptron: 'inceptron', - inference_net: 'inference_net', - inferencehub: 'inferencehub', - inferx: 'inferx', - infinity: 'infinity', - io_net: 'io_net', - jiekou: 'jiekou', - kenari: 'kenari', - kilo: 'kilo', - kimi: 'kimi', - kimi_for_coding: 'kimi_for_coding', - kiro: 'kiro', - kluster_ai: 'kluster_ai', - krutrim: 'krutrim', - kuae_cloud_coding_plan: 'kuae_cloud_coding_plan', - lambda_ai: 'lambda_ai', - lemonade: 'lemonade', - lemonfox_ai: 'lemonfox_ai', - libertai: 'libertai', - lilac: 'lilac', - lingyiwanwu: 'lingyiwanwu', - llama: 'llama', - llamagate: 'llamagate', - llmgateway: 'llmgateway', - llmtr: 'llmtr', - longcat: 'longcat', - lucidquery: 'lucidquery', - lynkr: 'lynkr', - matterai: 'matterai', - meganova: 'meganova', - merge_gateway: 'merge_gateway', - meta: 'meta', - meta_llama: 'meta_llama', - mimo: 'mimo', - minimax: 'minimax', - minimax_cn: 'minimax_cn', - minimax_cn_coding_plan: 'minimax_cn_coding_plan', - minimax_coding_plan: 'minimax_coding_plan', - mira: 'mira', - mixlayer: 'mixlayer', - moark: 'moark', - modal: 'modal', - model_oracle_ai: 'model_oracle_ai', - modelscope: 'modelscope', - moonshotai: 'moonshotai', - moonshotai_cn: 'moonshotai_cn', - morph: 'morph', - nanogpt: 'nanogpt', - ncompass: 'ncompass', - nearai: 'nearai', - nebius: 'nebius', - neon: 'neon', - neuralwatt: 'neuralwatt', - nextbit: 'nextbit', - nlp_cloud: 'nlp_cloud', - nous_research: 'nous_research', - novita: 'novita', - nscale: 'nscale', - nvidia_nim: 'nvidia_nim', - oci: 'oci', - ofox: 'ofox', - ohmygpt: 'ohmygpt', - ollama_cloud: 'ollama_cloud', - openaimax: 'openaimax', - openaisb: 'openaisb', - opencode: 'opencode', - opencode_go: 'opencode_go', - opencode_zen: 'opencode_zen', - orcarouter: 'orcarouter', - ovhcloud: 'ovhcloud', - parasail: 'parasail', - perfxcloud: 'perfxcloud', - perplexity: 'perplexity', - perplexity_agent: 'perplexity_agent', - petals: 'petals', - pinstripes: 'pinstripes', - pioneer: 'pioneer', - poe: 'poe', - poolside: 'poolside', - portkey: 'portkey', - ppinfra: 'ppinfra', - predibase: 'predibase', - privatemode_ai: 'privatemode_ai', - publicai: 'publicai', - qihang_ai: 'qihang_ai', - qihoo360: 'qihoo360', - qiniu_ai: 'qiniu_ai', - regolo_ai: 'regolo_ai', - reka_ai: 'reka_ai', - requesty: 'requesty', - reve: 'reve', - routing_run: 'routing_run', - sakana: 'sakana', - sambanova: 'sambanova', - sarvam: 'sarvam', - scaleway: 'scaleway', - scx_ai: 'scx_ai', - siliconflow: 'siliconflow', - snowflake: 'snowflake', - snowflake_cortex: 'snowflake_cortex', - stackit: 'stackit', - stepfun: 'stepfun', - stepfun_ai_step_plan: 'stepfun_ai_step_plan', - stepfun_step_plan: 'stepfun_step_plan', - subconscious: 'subconscious', - submodel: 'submodel', - synthetic: 'synthetic', - tencent: 'tencent', - tencent_coding_plan: 'tencent_coding_plan', - tencent_token_plan: 'tencent_token_plan', - tencent_token_plan_enterprise_auto: 'tencent_token_plan_enterprise_auto', - tencent_token_plan_enterprise_pro: 'tencent_token_plan_enterprise_pro', - tencent_token_plan_general_personal: 'tencent_token_plan_general_personal', - tencent_token_plan_hy_personal: 'tencent_token_plan_hy_personal', - tencent_tokenhub: 'tencent_tokenhub', - tensormesh: 'tensormesh', - the_grid_ai: 'the_grid_ai', - thinkingmachines: 'thinkingmachines', - tinfoil: 'tinfoil', - togetherai: 'togetherai', - tokenflux: 'tokenflux', - tokenpony: 'tokenpony', - trustedrouter: 'trustedrouter', - tundra: 'tundra', - umans_ai: 'umans_ai', - unorouter: 'unorouter', - upstage: 'upstage', - v0: 'v0', - venice: 'venice', - vercel: 'vercel', - vivgrid: 'vivgrid', - volc_engine: 'volc_engine', - vultr: 'vultr', - wafer: 'wafer', - wandb: 'wandb', - xiaomi_token_plan_ams: 'xiaomi_token_plan_ams', - xiaomi_token_plan_cn: 'xiaomi_token_plan_cn', - xiaomi_token_plan_sgp: 'xiaomi_token_plan_sgp', - xiaomimimo: 'xiaomimimo', - xpersona: 'xpersona', - xunfei: 'xunfei', - zai: 'zai', - zai_coding_plan: 'zai_coding_plan', - zeldoc: 'zeldoc', - zenmux: 'zenmux', - zhipu_v4: 'zhipu_v4', - zhipuai_coding_plan: 'zhipuai_coding_plan', -} as const - -export type ProviderName = typeof ProviderName[keyof typeof ProviderName] diff --git a/bindings/python/python/aimux/provider_name.py b/bindings/python/python/aimux/provider_name.py deleted file mode 100644 index ed4e18356..000000000 --- a/bindings/python/python/aimux/provider_name.py +++ /dev/null @@ -1,8 +0,0 @@ -"""ProviderName — GENERATED by `scripts/gen_provider_names.py`. - -Do not edit manually; single source of truth is `provider-registry.json`. -""" - -from typing import Literal - -ProviderName = Literal['abacus', 'abliteration_ai', 'ai21', 'ai302', 'ai_router', 'aiand', 'aibadgr', 'aigc2d', 'aihubmix', 'ails', 'aiml', 'aki_io', 'albert', 'alibaba', 'alibaba_coding_plan', 'alibaba_coding_plan_cn', 'alibaba_token_plan', 'alibaba_token_plan_cn', 'ambient', 'anyapi', 'anyscale', 'apertis', 'api2d', 'api2gpt', 'apiserpent', 'atlascloud', 'atomic_chat', 'auriko', 'azure_ai', 'baichuan', 'baidu', 'baidu_v2', 'bailing', 'baseten', 'berget', 'bigmodel', 'blueclaw', 'bytedance', 'byteplus', 'bytez', 'canopywave', 'cerebras', 'chatgpt', 'cherryin', 'chutes', 'clarifai', 'claudinio', 'cline_pass', 'closeai', 'cloudferro_sherlock', 'cloudflare', 'cloudflare_workers_ai', 'codestral', 'cometapi', 'commandcode', 'compactifai', 'copilot', 'cortecs', 'coze', 'crof', 'crossmodel', 'crusoe', 'daoxe', 'darkbloom', 'databricks', 'datarobot', 'deepbricks', 'deepinfra', 'deepseek', 'digitalocean', 'dinference', 'doubao', 'doubleword', 'drun', 'ebcloud', 'embercloud', 'empiriolabs', 'evroc', 'fastcrw', 'fastgpt', 'fastrouter', 'featherless_ai', 'firepass', 'fireworks', 'freemodel', 'friendliai', 'frogbot', 'galadriel', 'gdc', 'gigachat', 'github', 'gmi', 'gmicloud', 'gonka24', 'gradient_ai', 'groq', 'helicone', 'heroku', 'hetzner', 'hosted_vllm', 'hpc_ai', 'hyperbolic', 'iflowcn', 'inception', 'inceptron', 'inference_net', 'inferencehub', 'inferx', 'infinity', 'io_net', 'jiekou', 'kenari', 'kilo', 'kimi', 'kimi_for_coding', 'kiro', 'kluster_ai', 'krutrim', 'kuae_cloud_coding_plan', 'lambda_ai', 'lemonade', 'lemonfox_ai', 'libertai', 'lilac', 'lingyiwanwu', 'llama', 'llamagate', 'llmgateway', 'llmtr', 'longcat', 'lucidquery', 'lynkr', 'matterai', 'meganova', 'merge_gateway', 'meta', 'meta_llama', 'mimo', 'minimax', 'minimax_cn', 'minimax_cn_coding_plan', 'minimax_coding_plan', 'mira', 'mixlayer', 'moark', 'modal', 'model_oracle_ai', 'modelscope', 'moonshotai', 'moonshotai_cn', 'morph', 'nanogpt', 'ncompass', 'nearai', 'nebius', 'neon', 'neuralwatt', 'nextbit', 'nlp_cloud', 'nous_research', 'novita', 'nscale', 'nvidia_nim', 'oci', 'ofox', 'ohmygpt', 'ollama_cloud', 'openaimax', 'openaisb', 'opencode', 'opencode_go', 'opencode_zen', 'orcarouter', 'ovhcloud', 'parasail', 'perfxcloud', 'perplexity', 'perplexity_agent', 'petals', 'pinstripes', 'pioneer', 'poe', 'poolside', 'portkey', 'ppinfra', 'predibase', 'privatemode_ai', 'publicai', 'qihang_ai', 'qihoo360', 'qiniu_ai', 'regolo_ai', 'reka_ai', 'requesty', 'reve', 'routing_run', 'sakana', 'sambanova', 'sarvam', 'scaleway', 'scx_ai', 'siliconflow', 'snowflake', 'snowflake_cortex', 'stackit', 'stepfun', 'stepfun_ai_step_plan', 'stepfun_step_plan', 'subconscious', 'submodel', 'synthetic', 'tencent', 'tencent_coding_plan', 'tencent_token_plan', 'tencent_token_plan_enterprise_auto', 'tencent_token_plan_enterprise_pro', 'tencent_token_plan_general_personal', 'tencent_token_plan_hy_personal', 'tencent_tokenhub', 'tensormesh', 'the_grid_ai', 'thinkingmachines', 'tinfoil', 'togetherai', 'tokenflux', 'tokenpony', 'trustedrouter', 'tundra', 'umans_ai', 'unorouter', 'upstage', 'v0', 'venice', 'vercel', 'vivgrid', 'volc_engine', 'vultr', 'wafer', 'wandb', 'xiaomi_token_plan_ams', 'xiaomi_token_plan_cn', 'xiaomi_token_plan_sgp', 'xiaomimimo', 'xpersona', 'xunfei', 'zai', 'zai_coding_plan', 'zeldoc', 'zenmux', 'zhipu_v4', 'zhipuai_coding_plan'] diff --git a/bindings/swift/Sources/Aimux/ProviderName.swift b/bindings/swift/Sources/Aimux/ProviderName.swift deleted file mode 100644 index 5ac314b03..000000000 --- a/bindings/swift/Sources/Aimux/ProviderName.swift +++ /dev/null @@ -1,257 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/// Names of all built-in OpenAI-compatible providers. -public enum ProviderName: String, CaseIterable, Sendable { - case Abacus = "abacus" - case AbliterationAi = "abliteration_ai" - case Ai21 = "ai21" - case Ai302 = "ai302" - case AiRouter = "ai_router" - case Aiand = "aiand" - case Aibadgr = "aibadgr" - case Aigc2d = "aigc2d" - case Aihubmix = "aihubmix" - case Ails = "ails" - case Aiml = "aiml" - case AkiIo = "aki_io" - case Albert = "albert" - case Alibaba = "alibaba" - case AlibabaCodingPlan = "alibaba_coding_plan" - case AlibabaCodingPlanCn = "alibaba_coding_plan_cn" - case AlibabaTokenPlan = "alibaba_token_plan" - case AlibabaTokenPlanCn = "alibaba_token_plan_cn" - case Ambient = "ambient" - case Anyapi = "anyapi" - case Anyscale = "anyscale" - case Apertis = "apertis" - case Api2d = "api2d" - case Api2gpt = "api2gpt" - case Apiserpent = "apiserpent" - case Atlascloud = "atlascloud" - case AtomicChat = "atomic_chat" - case Auriko = "auriko" - case AzureAi = "azure_ai" - case Baichuan = "baichuan" - case Baidu = "baidu" - case BaiduV2 = "baidu_v2" - case Bailing = "bailing" - case Baseten = "baseten" - case Berget = "berget" - case Bigmodel = "bigmodel" - case Blueclaw = "blueclaw" - case Bytedance = "bytedance" - case Byteplus = "byteplus" - case Bytez = "bytez" - case Canopywave = "canopywave" - case Cerebras = "cerebras" - case Chatgpt = "chatgpt" - case Cherryin = "cherryin" - case Chutes = "chutes" - case Clarifai = "clarifai" - case Claudinio = "claudinio" - case ClinePass = "cline_pass" - case Closeai = "closeai" - case CloudferroSherlock = "cloudferro_sherlock" - case Cloudflare = "cloudflare" - case CloudflareWorkersAi = "cloudflare_workers_ai" - case Codestral = "codestral" - case Cometapi = "cometapi" - case Commandcode = "commandcode" - case Compactifai = "compactifai" - case Copilot = "copilot" - case Cortecs = "cortecs" - case Coze = "coze" - case Crof = "crof" - case Crossmodel = "crossmodel" - case Crusoe = "crusoe" - case Daoxe = "daoxe" - case Darkbloom = "darkbloom" - case Databricks = "databricks" - case Datarobot = "datarobot" - case Deepbricks = "deepbricks" - case Deepinfra = "deepinfra" - case Deepseek = "deepseek" - case Digitalocean = "digitalocean" - case Dinference = "dinference" - case Doubao = "doubao" - case Doubleword = "doubleword" - case Drun = "drun" - case Ebcloud = "ebcloud" - case Embercloud = "embercloud" - case Empiriolabs = "empiriolabs" - case Evroc = "evroc" - case Fastcrw = "fastcrw" - case Fastgpt = "fastgpt" - case Fastrouter = "fastrouter" - case FeatherlessAi = "featherless_ai" - case Firepass = "firepass" - case Fireworks = "fireworks" - case Freemodel = "freemodel" - case Friendliai = "friendliai" - case Frogbot = "frogbot" - case Galadriel = "galadriel" - case Gdc = "gdc" - case Gigachat = "gigachat" - case Github = "github" - case Gmi = "gmi" - case Gmicloud = "gmicloud" - case Gonka24 = "gonka24" - case GradientAi = "gradient_ai" - case Groq = "groq" - case Helicone = "helicone" - case Heroku = "heroku" - case Hetzner = "hetzner" - case HostedVllm = "hosted_vllm" - case HpcAi = "hpc_ai" - case Hyperbolic = "hyperbolic" - case Iflowcn = "iflowcn" - case Inception = "inception" - case Inceptron = "inceptron" - case InferenceNet = "inference_net" - case Inferencehub = "inferencehub" - case Inferx = "inferx" - case Infinity = "infinity" - case IoNet = "io_net" - case Jiekou = "jiekou" - case Kenari = "kenari" - case Kilo = "kilo" - case Kimi = "kimi" - case KimiForCoding = "kimi_for_coding" - case Kiro = "kiro" - case KlusterAi = "kluster_ai" - case Krutrim = "krutrim" - case KuaeCloudCodingPlan = "kuae_cloud_coding_plan" - case LambdaAi = "lambda_ai" - case Lemonade = "lemonade" - case LemonfoxAi = "lemonfox_ai" - case Libertai = "libertai" - case Lilac = "lilac" - case Lingyiwanwu = "lingyiwanwu" - case Llama = "llama" - case Llamagate = "llamagate" - case Llmgateway = "llmgateway" - case Llmtr = "llmtr" - case Longcat = "longcat" - case Lucidquery = "lucidquery" - case Lynkr = "lynkr" - case Matterai = "matterai" - case Meganova = "meganova" - case MergeGateway = "merge_gateway" - case Meta = "meta" - case MetaLlama = "meta_llama" - case Mimo = "mimo" - case Minimax = "minimax" - case MinimaxCn = "minimax_cn" - case MinimaxCnCodingPlan = "minimax_cn_coding_plan" - case MinimaxCodingPlan = "minimax_coding_plan" - case Mira = "mira" - case Mixlayer = "mixlayer" - case Moark = "moark" - case Modal = "modal" - case ModelOracleAi = "model_oracle_ai" - case Modelscope = "modelscope" - case Moonshotai = "moonshotai" - case MoonshotaiCn = "moonshotai_cn" - case Morph = "morph" - case Nanogpt = "nanogpt" - case Ncompass = "ncompass" - case Nearai = "nearai" - case Nebius = "nebius" - case Neon = "neon" - case Neuralwatt = "neuralwatt" - case Nextbit = "nextbit" - case NlpCloud = "nlp_cloud" - case NousResearch = "nous_research" - case Novita = "novita" - case Nscale = "nscale" - case NvidiaNim = "nvidia_nim" - case Oci = "oci" - case Ofox = "ofox" - case Ohmygpt = "ohmygpt" - case OllamaCloud = "ollama_cloud" - case Openaimax = "openaimax" - case Openaisb = "openaisb" - case Opencode = "opencode" - case OpencodeGo = "opencode_go" - case OpencodeZen = "opencode_zen" - case Orcarouter = "orcarouter" - case Ovhcloud = "ovhcloud" - case Parasail = "parasail" - case Perfxcloud = "perfxcloud" - case Perplexity = "perplexity" - case PerplexityAgent = "perplexity_agent" - case Petals = "petals" - case Pinstripes = "pinstripes" - case Pioneer = "pioneer" - case Poe = "poe" - case Poolside = "poolside" - case Portkey = "portkey" - case Ppinfra = "ppinfra" - case Predibase = "predibase" - case PrivatemodeAi = "privatemode_ai" - case Publicai = "publicai" - case QihangAi = "qihang_ai" - case Qihoo360 = "qihoo360" - case QiniuAi = "qiniu_ai" - case RegoloAi = "regolo_ai" - case RekaAi = "reka_ai" - case Requesty = "requesty" - case Reve = "reve" - case RoutingRun = "routing_run" - case Sakana = "sakana" - case Sambanova = "sambanova" - case Sarvam = "sarvam" - case Scaleway = "scaleway" - case ScxAi = "scx_ai" - case Siliconflow = "siliconflow" - case Snowflake = "snowflake" - case SnowflakeCortex = "snowflake_cortex" - case Stackit = "stackit" - case Stepfun = "stepfun" - case StepfunAiStepPlan = "stepfun_ai_step_plan" - case StepfunStepPlan = "stepfun_step_plan" - case Subconscious = "subconscious" - case Submodel = "submodel" - case Synthetic = "synthetic" - case Tencent = "tencent" - case TencentCodingPlan = "tencent_coding_plan" - case TencentTokenPlan = "tencent_token_plan" - case TencentTokenPlanEnterpriseAuto = "tencent_token_plan_enterprise_auto" - case TencentTokenPlanEnterprisePro = "tencent_token_plan_enterprise_pro" - case TencentTokenPlanGeneralPersonal = "tencent_token_plan_general_personal" - case TencentTokenPlanHyPersonal = "tencent_token_plan_hy_personal" - case TencentTokenhub = "tencent_tokenhub" - case Tensormesh = "tensormesh" - case TheGridAi = "the_grid_ai" - case Thinkingmachines = "thinkingmachines" - case Tinfoil = "tinfoil" - case Togetherai = "togetherai" - case Tokenflux = "tokenflux" - case Tokenpony = "tokenpony" - case Trustedrouter = "trustedrouter" - case Tundra = "tundra" - case UmansAi = "umans_ai" - case Unorouter = "unorouter" - case Upstage = "upstage" - case V0 = "v0" - case Venice = "venice" - case Vercel = "vercel" - case Vivgrid = "vivgrid" - case VolcEngine = "volc_engine" - case Vultr = "vultr" - case Wafer = "wafer" - case Wandb = "wandb" - case XiaomiTokenPlanAms = "xiaomi_token_plan_ams" - case XiaomiTokenPlanCn = "xiaomi_token_plan_cn" - case XiaomiTokenPlanSgp = "xiaomi_token_plan_sgp" - case Xiaomimimo = "xiaomimimo" - case Xpersona = "xpersona" - case Xunfei = "xunfei" - case Zai = "zai" - case ZaiCodingPlan = "zai_coding_plan" - case Zeldoc = "zeldoc" - case Zenmux = "zenmux" - case ZhipuV4 = "zhipu_v4" - case ZhipuaiCodingPlan = "zhipuai_coding_plan" -} diff --git a/bindings/swift/Tests/AimuxTests/AimuxTests.swift b/bindings/swift/Tests/AimuxTests/AimuxTests.swift index 325d48225..1753dce86 100644 --- a/bindings/swift/Tests/AimuxTests/AimuxTests.swift +++ b/bindings/swift/Tests/AimuxTests/AimuxTests.swift @@ -28,15 +28,6 @@ final class AimuxTests: XCTestCase { XCTAssertNotNil(model) } - func testProviderModelCreationWithProviderName() throws { - // Recommended typed spelling: ProviderName enum case (key is - // validated on the first API call, not construction). - let model = try Model.provider( - name: ProviderName.Groq.rawValue, apiKey: "sk-test-fake-key", modelId: "llama-3.3-70b" - ) - XCTAssertNotNil(model) - } - func testInvalidPromptThrows() throws { let model = try Model.openai(apiKey: "sk-test-fake-key", modelId: "gpt-4o-mini") XCTAssertThrowsError(try model.generateText(prompt: "{invalid json}")) diff --git a/docs/API.md b/docs/API.md index 596590771..eda312d76 100644 --- a/docs/API.md +++ b/docs/API.md @@ -70,22 +70,11 @@ One function in every binding: ```text provider(name, api_key?, model_id, config?) // all languages - name — provider name; 推荐使用类型化 ProviderName(见下),字符串同样可用 + name — registry provider name as a string api_key — optional; omitted/None reads the provider's env var config — optional overrides (base_url / headers / maxRetries / body_overrides) ``` -- **ProviderName** (Rust enum, TS const object, Go/Java/Kotlin consts, Swift - enum, Dart consts) — IDE-completable and typo-proof: - - ```text - Rust: provider(ProviderName::Groq, ...) TS: provider(ProviderName.groq, ...) - Go: Provider(string(ProviderName.Groq), ...) Java: Model.provider(ProviderName.GROQ, ...) - Swift: Aimux.provider(name: ProviderName.groq.rawValue, ...) - Dart: Model.provider(ProviderName.groq, ...) - ``` - - 字符串形式(`provider("groq", ...)`)在全部语言中同样可用——两种写法等价。 - Full list (name / env var / base URL): [providers.md](api/providers.md) - Custom endpoint: registry name + `base_url` override, or the OpenAI constructor with a base URL diff --git a/docs/PROJECT-OVERVIEW.md b/docs/PROJECT-OVERVIEW.md index a53a672eb..3207e2521 100644 --- a/docs/PROJECT-OVERVIEW.md +++ b/docs/PROJECT-OVERVIEW.md @@ -29,8 +29,8 @@ aimux does not do agent loops, RAG, or orchestration — it focuses solely on un > **Provider access (RFC-0017 phase 4)**: all OpenAI-compatible providers are > registry-backed — `provider-registry.json` is the single source of truth, and -> every binding exposes `provider(name, ...)` with a typed `ProviderName` -> (enum/union/consts). The per-provider shell types (`XxxConfig`/`XxxProvider`) +> every binding exposes the string-keyed `provider(name, ...)`. The +> per-provider shell types (`XxxConfig`/`XxxProvider`) > were retired in phase 4. --- diff --git a/docs/api/flutter.md b/docs/api/flutter.md index 3ad62229a..39d70832b 100644 --- a/docs/api/flutter.md +++ b/docs/api/flutter.md @@ -47,8 +47,7 @@ model.close(); ## Providers -All 251 registry-backed OpenAI-compatible providers are reachable by name; -`ProviderName` holds the constants: +All 251 registry-backed OpenAI-compatible providers are reachable by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed factories @@ -56,18 +55,16 @@ All 251 registry-backed OpenAI-compatible providers are reachable by name; > Full list: [providers.md](providers.md). ```dart -// 推荐:ProviderName.groq 常量(补全 + 防拼写错误) -final model = Model.provider(ProviderName.groq, 'llama-3.3-70b'); +final model = Model.provider('groq', 'llama-3.3-70b'); final result = model.generateText('Hello'); model.close(); -// 字符串形式同样可用 + 可选 config JSON ({"base_url": "..."}): +// Optional config JSON ({"base_url": "..."}): final model2 = Model.provider('groq', 'llama-3.3-70b', apiKey: 'sk-...'); model2.close(); ``` -Unknown names throw `NoSuchProviderError` (payload: the provider id); valid -names come from the generated `ProviderName` constants. +Unknown names throw `NoSuchProviderError` (payload: the provider id). ## Errors diff --git a/docs/api/go.md b/docs/api/go.md index e9319bc3e..da8ef02af 100644 --- a/docs/api/go.md +++ b/docs/api/go.md @@ -155,8 +155,7 @@ The producer closes `Parts()` after the blocking native call returns. ## Providers -All 251 registry-backed OpenAI-compatible providers are reachable by name; -`aimux.ProviderName` holds typed constants: +All 251 registry-backed OpenAI-compatible providers are reachable by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed constructors @@ -164,12 +163,11 @@ All 251 registry-backed OpenAI-compatible providers are reachable by name; > Full list: [providers.md](providers.md). ```go -// 推荐:aimux.Groq 类型常量(类型检查 + 补全) -model, err := aimux.Provider(string(aimux.Groq), "", "llama-3.3-70b") +model, err := aimux.Provider("groq", "", "llama-3.3-70b") if err != nil { log.Fatal(err) } defer model.Close() -// 字符串形式同样可用 + base URL 覆盖: +// Base URL override: model2, err := aimux.ProviderWithBase("groq", "sk-...", "llama-3.3-70b", "https://relay.example/v1") defer model2.Close() diff --git a/docs/api/java.md b/docs/api/java.md index 4e340f1ec..c1314c719 100644 --- a/docs/api/java.md +++ b/docs/api/java.md @@ -33,8 +33,7 @@ try (Model model = Model.openaiWithBase("sk-...", "gpt-4o", "http://localhost:30 ## Providers -All 251 registry-backed OpenAI-compatible providers are reachable by name; -`ProviderName` holds the constants: +All 251 registry-backed OpenAI-compatible providers are reachable by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed factories @@ -43,22 +42,19 @@ All 251 registry-backed OpenAI-compatible providers are reachable by name; ```java import ai.arcships.aimux.Model; -import ai.arcships.aimux.ProviderName; -// 推荐:ProviderName.GROQ 常量(类型检查 + 补全) -try (Model model = Model.providerFromEnv(ProviderName.GROQ, "llama-3.3-70b")) { +try (Model model = Model.providerFromEnv("groq", "llama-3.3-70b")) { String result = model.generateText("\"Hello\""); } -// 字符串形式同样可用 + 可选 config JSON ({"base_url": "..."}): +// Optional config JSON ({"base_url": "..."}): try (Model model = Model.provider("groq", "sk-...", "llama-3.3-70b", null)) { String result = model.generateText("\"Hello\""); } ``` `deepseek(apiKey, modelId)` remains as a shortcut (registry-backed). -Unknown names throw `NoSuchProviderError` naming the requested provider -(valid names come from the generated `ProviderName` constants). +Unknown names throw `NoSuchProviderError` naming the requested provider. ## Errors diff --git a/docs/api/kotlin.md b/docs/api/kotlin.md index eba623342..154ce3aa8 100644 --- a/docs/api/kotlin.md +++ b/docs/api/kotlin.md @@ -27,8 +27,7 @@ Model.openai("sk-...", "gpt-4o", "http://localhost:3000").use { model -> ## Providers -All 251 registry-backed OpenAI-compatible providers are reachable by name; -`ai.arcships.aimux.ProviderName` holds the constants: +All 251 registry-backed OpenAI-compatible providers are reachable by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed factories @@ -36,19 +35,17 @@ All 251 registry-backed OpenAI-compatible providers are reachable by name; > Full list: [providers.md](providers.md). ```kotlin -// 推荐:ProviderName.GROQ 常量(类型检查 + 补全) -Model.provider(name = ProviderName.GROQ, modelId = "llama-3.3-70b").use { model -> +Model.provider(name = "groq", modelId = "llama-3.3-70b").use { model -> val result = model.generateText("\"Hello\"") } -// 字符串形式同样可用 + 可选 config JSON ({"base_url": "..."}): +// Optional config JSON ({"base_url": "..."}): Model.provider(name = "groq", apiKey = "sk-...", modelId = "llama-3.3-70b").use { model -> val result = model.generateText("\"Hello\"") } ``` -Unknown names throw `NoSuchProviderError` naming the requested provider -(valid names come from the generated `ProviderName` constants). +Unknown names throw `NoSuchProviderError` naming the requested provider. ## Errors diff --git a/docs/api/node.md b/docs/api/node.md index a6dd4f771..6895ccdea 100644 --- a/docs/api/node.md +++ b/docs/api/node.md @@ -22,16 +22,13 @@ console.log(result.text) ## Providers All 251 built-in OpenAI-compatible providers are registry-backed. Look them up -by name; the `ProviderName` type is a string-literal union generated from -`provider-registry.json`, so your IDE autocompletes and typo'd names fail -type-checking: +by string name; the current list is generated from `provider_registry.json` in +[providers.md](providers.md): ```typescript -import { provider, generateText, ProviderName } from '@arcships/aimux' +import { provider, generateText } from '@arcships/aimux' -// 推荐:ProviderName.groq 写法(IDE 补全 + 类型检查) -const model = await provider(ProviderName.groq, undefined, 'llama-3.3-70b') -// 字符串形式同样可用: +const model = await provider('groq', undefined, 'llama-3.3-70b') const relay = await provider('groq', 'sk-...', 'llama-3.3-70b', { baseUrl: 'https://relay.example/v1', maxRetries: 0, diff --git a/docs/api/providers.md b/docs/api/providers.md index 0b7133baf..c970a359e 100644 --- a/docs/api/providers.md +++ b/docs/api/providers.md @@ -9,7 +9,7 @@ | category | count | |----------|-------| -| Registry-backed OpenAI-compatible (`provider(name, ...)` / `ProviderName`) | 251 | +| Registry-backed OpenAI-compatible (`provider(name, ...)`) | 251 | | Non-registry: Native protocol providers | 14 | | Non-registry: OpenAI-compatible thin wrappers (second batch) | 5 | | Non-registry: Speech-only providers (TTS) | 4 | @@ -28,7 +28,7 @@ | Non-registry: Search-only providers (web search modality) | 11 | | **Total providers** | **328** | -**251 registry-backed OpenAI-compatible providers** (construct via `provider(name, ...)` / `ProviderName`) + **77 non-registry providers** (construct via the typed factories listed below). +**251 registry-backed OpenAI-compatible providers** (construct via `provider(name, ...)`) + **77 non-registry providers** (construct via the typed factories listed below). ## Registry-backed (OpenAI-compatible) — 251 diff --git a/docs/api/reference.md b/docs/api/reference.md index 3e4133a34..a1796fd3b 100644 --- a/docs/api/reference.md +++ b/docs/api/reference.md @@ -16,7 +16,6 @@ | `ReasoningEffort` | [types.rs](../../aimux-core/src/types.rs) | [ReasoningEffort.ts](../../bindings/node/src/types/ReasoningEffort.ts) | 7 levels, passed through verbatim | | `AbortSignal` | [abort_signal.rs](../../aimux-core/src/abort_signal.rs) | — (runtime handle) | Rust: options field; Node: `AbortBridge` + JS `AbortSignal` | | `ProviderOptions` | [provider.rs](../../aimux-providers/src/provider.rs) | `ProviderConfig` (per binding) | `base_url` / `headers` / `organization` / `project` / `max_retries` / `body_overrides` | -| `ProviderName` | [provider_name.rs](../../aimux-providers/src/provider_name.rs) | [ProviderName.ts](../../bindings/node/src/types/ProviderName.ts) | one constant per registry provider (count: [providers.md](providers.md)); also generated for Go / Python / Java / Kotlin / Swift / Dart (`scripts/gen_provider_names.py`) | | `GenerateTextResult` | [generate.rs](../../aimux-core/src/generate.rs) | [GenerateTextResult.ts](../../bindings/node/src/types/GenerateTextResult.ts) | `text`, `tool_calls`, `usage`, `warnings`, `raw` | | `StreamTextResult` | [generate.rs](../../aimux-core/src/generate.rs) | — | use `StreamPart` while iterating | | `StreamPart` | [stream_part.rs](../../aimux-core/src/stream_part.rs) | [StreamPart.ts](../../bindings/node/src/types/StreamPart.ts) | TextDelta / ToolCallDelta / Finish / … | @@ -86,7 +85,7 @@ Per-modality entry points are trait methods on the model types |----------|-------| | `generateText(model, prompt, options?, signal?)` / `streamText(...)` | typed wrappers; `signal` = `AbortSignal` | | `openai()` / `anthropic()` / `deepseek()` / `google()` | native typed path; `deepseek()` is registry-backed | -| `provider(name, apiKey?, modelId, config?)` | registry-backed (rows in [providers.md](providers.md)); typed `ProviderName` | +| `provider(name, apiKey?, modelId, config?)` | registry-backed; names listed in [providers.md](providers.md) | | `openaiEmbedding` / `cohereEmbedding` / `googleEmbedding` | embeddings | | `openaiSpeech` / `openaiTranscription` | speech / STT | | `openaiImage` / `googleImage` / `googleVideo` | image / video | @@ -108,7 +107,7 @@ Per-modality entry points are trait methods on the model types | Function | Notes | |----------|-------| -| `Provider(name, apiKey?, modelId, config?)` | registry-backed; typed `ProviderName` | +| `Provider(name, apiKey?, modelId, config?)` | registry-backed; names listed in [providers.md](providers.md) | | `NewOpenAI` / `NewAnthropic` / `NewDeepSeek` | native typed path (+ `WithBase` variants) | | `NewOpenAIEmbedding` / `NewCohereEmbedding` / `NewGoogleEmbedding` | embeddings | | `NewOpenAISpeech` / `NewOpenAITranscription` | speech / STT | diff --git a/docs/api/rust.md b/docs/api/rust.md index fbdc04ba5..4614f3c25 100644 --- a/docs/api/rust.md +++ b/docs/api/rust.md @@ -25,7 +25,7 @@ async fn main() -> Result<(), AiMuxError> { ## Providers All 251 built-in OpenAI-compatible providers are registry-backed: no per-provider -`XxxConfig`/`XxxProvider` types. Look them up by name (or by the `ProviderName` enum): +`XxxConfig`/`XxxProvider` types. Look them up by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed factories @@ -34,7 +34,7 @@ All 251 built-in OpenAI-compatible providers are registry-backed: no per-provide > Full list: [providers.md](providers.md). ```rust -use aimux_providers::{provider, provider_from_env, ProviderName, ProviderOptions}; +use aimux_providers::{provider, provider_from_env, ProviderOptions}; // Key from the provider's env var (GROQ_API_KEY etc.), base URL & profile from // the registry — replaces the retired `XxxConfig::from_env()`. @@ -48,14 +48,11 @@ let model = provider( Some(ProviderOptions { base_url: Some("https://relay.example/v1".into()), ..Default::default() }), )?; -// Typed name (推荐——IDE-completable, compile-checked): -let model = provider(ProviderName::Groq, None, "llama-3.3-70b", None)?; -// 字符串形式同样可用(弱类型兼容): -let model = provider_from_env("groq", "llama-3.3-70b", None)?; ``` -`ProviderName` is generated from `provider_registry.json` (251 variants, `as_str`/ -`from_str`/`ALL`). Unknown names fail with `AiMuxError::NoSuchProvider { provider_id }`. +Names come from `provider_registry.json`; the current list is in +[providers.md](providers.md). Unknown names fail with +`AiMuxError::NoSuchProvider { provider_id }`. ## Text Generation diff --git a/docs/api/swift.md b/docs/api/swift.md index 568cbe13e..e87e054d6 100644 --- a/docs/api/swift.md +++ b/docs/api/swift.md @@ -31,8 +31,7 @@ print(result) ## Providers -All 251 registry-backed OpenAI-compatible providers are reachable by name; -`ProviderName` is an enum with one case per provider: +All 251 registry-backed OpenAI-compatible providers are reachable by string name: > **Scope:** `provider(name)` covers only the 251 registry OpenAI-compatible > providers; Anthropic/Google/multimodal/local → typed factories @@ -40,16 +39,14 @@ All 251 registry-backed OpenAI-compatible providers are reachable by name; > Full list: [providers.md](providers.md). ```swift -// 推荐:ProviderName enum case(类型检查 + 补全) -let model = try Model.provider(name: ProviderName.Groq.rawValue, modelId: "llama-3.3-70b") +let model = try Model.provider(name: "groq", modelId: "llama-3.3-70b") let result = try model.generateText(prompt: "\"Hello\"") -// 字符串形式同样可用 + 可选 config JSON ({"base_url": "..."}): +// Optional config JSON ({"base_url": "..."}): let model2 = try Model.provider(name: "groq", apiKey: "sk-...", modelId: "llama-3.3-70b") ``` -Unknown names throw `.noSuchProvider` (payload: the provider id); valid names -come from the generated `ProviderName` enum. +Unknown names throw `.noSuchProvider` (payload: the provider id). ## Text Generation diff --git a/docs/contributing/adding-a-provider.md b/docs/contributing/adding-a-provider.md index da09fb1ec..080eb4793 100644 --- a/docs/contributing/adding-a-provider.md +++ b/docs/contributing/adding-a-provider.md @@ -37,14 +37,13 @@ case 1. flags rides in per-call `body_overrides` (RFC-0017); if the quirk changes auth or error shapes, it is case 2. -2. Run both generators and commit their output: +2. Regenerate the provider documentation and commit its output: ```sh - python scripts/gen_provider_names.py # ProviderName in 8 languages python scripts/gen_providers_doc.py # docs/api/providers.md (totals + list) ``` - CI runs both with `--check` in the `contract-tests` job and fails if the + CI runs it with `--check` in the `contract-tests` job and fails if the committed output is stale. 3. Derive replay cassettes: add a tuple to `PROVIDERS` in @@ -123,8 +122,8 @@ case 1. - **A generator may stay in `scripts/` only if its output carries a "GENERATED — do not edit" header and CI runs it with `--check`.** Today - that is `gen_provider_names.py` and `gen_providers_doc.py` (the - `contract-tests` job). `gen_ts_types.py` regenerates the ts-rs TypeScript + that is `gen_providers_doc.py` (the `contract-tests` job). + `gen_ts_types.py` regenerates the ts-rs TypeScript types through `cargo test -p aimux-core --lib export` (the export tests are the gate). - `docs/api/providers.md` is the single source of truth for provider counts diff --git a/docs/external-provider-config-research.md b/docs/external-provider-config-research.md index 5d4eb2350..6676c5855 100644 --- a/docs/external-provider-config-research.md +++ b/docs/external-provider-config-research.md @@ -134,8 +134,8 @@ a/b/d 三者**共用同一个运行时覆盖层**(见 §4),实现上是同一机 - 新增一个**运行时覆盖层** `OVERLAYS: RwLock>`(或 `OnceLock<...>` 包 `RwLock`)。 - `provider()` 查找顺序改为:**覆盖层 → 内置 registry**;找到条目后,后端组装管线(`OpenAIConfig` 构造 + `ProviderOptions` 叠加)完全复用,零改动。 -- 内置 registry 仍是 `include_str!` 编译期嵌入(保留 RFC-0017 的"单一数据源 + 类型派生"不变);覆盖层只承载外部新增/覆盖条目。 -- **这是纯增量改动**:不动 `provider_registry.json`、不动 `gen_provider_names.py`、不动 `ProviderName` 派生(外部名字不属于编译期枚举,走字符串路径即可)。 +- 内置 registry 仍是 `include_str!` 编译期嵌入;覆盖层只承载外部新增/覆盖条目。 +- **这是纯增量改动**:不动 `provider_registry.json`;内置与外部名字都走字符串路径。 ### 4.2 Provider / LanguageModel trait 是否 object-safe(能否动态注册)? diff --git a/docs/internal/phase4-audit.md b/docs/internal/phase4-audit.md index a6d6ce119..d21b84b6c 100644 --- a/docs/internal/phase4-audit.md +++ b/docs/internal/phase4-audit.md @@ -5,6 +5,7 @@ > 审计方式:只读代码/测试核查 + `cargo test -p aimux-providers --tests` 实测(EXIT=0,2769 绿) > 范围:RFC-0017 阶段 4(registry JSON 唯一数据源 + `provider(name,...)` 统一入口 + ProviderName 派生类型 + C ABI 符号)在 8 语言绑定 + C ABI 的覆盖一致性与测试落库情况 > 说明:审计 prompt 写"8 个绑定"但枚举了 9 项(Rust/Node/Python/Go/Java/Kotlin/Swift/Flutter/C ABI),本报告按 9 行呈现。 +> **后续变更**: 2026-09-29 删除生成式 `ProviderName` 及 `scripts/gen_provider_names.py`;本报告中关于 ProviderName 派生类型与其防漂移测试的条目(b / d / P2)已不再适用,provider 名字统一为字符串,现行列表见 [docs/api/providers.md](../api/providers.md)。 --- diff --git a/docs/plan/structured-error-business-semantics.md b/docs/plan/structured-error-business-semantics.md index 8fa770b99..706117df3 100644 --- a/docs/plan/structured-error-business-semantics.md +++ b/docs/plan/structured-error-business-semantics.md @@ -36,7 +36,7 @@ disagree. | RFC-0016 §7.1 | Request deadlines surface as `AiMuxError::Timeout` and are not retried. | | RFC-0016 §7.6 R2/R4 and §7.7 S1/S2 | User cancellation surfaces as `AiMuxError::Aborted`; abort must remain responsive during body reads, retry backoff, and provider polling waits. | | RFC-0016 alignment goal | Retryability follows the AI SDK response policy: 408, 409, 429, and 5xx are retryable; ordinary 4xx are not. | -| RFC-0017 §3 stage 4 | Unknown registry names must identify the requested provider and direct callers to the generated `ProviderName` surface. The runtime error must not carry all 250 automatically registered names. | +| RFC-0017 §3 stage 4 | Unknown registry names must identify the requested provider. The runtime error must not carry all automatically registered names; discovery uses the generated provider documentation. | | RFC-0018 §3.2 | Codex subscription 401 remains the specialized `TokenExpired` action signal. Do not fold it back into a generic 401 `ApiCall`. | ### 2.2 Final error classification table @@ -98,11 +98,11 @@ disagree. 2. Remove both `available` and stored `message`. Display text must be derived from `provider_id`, so the payload cannot contain contradictory facts. 3. In `provider_handle`, construct only `provider_id`. -4. Remove the now-unused `ProviderName` import and fix the stale `provider()` - doc comment that still promises the full provider list. +4. Fix the stale `provider()` doc comment that still promises the full + provider list in the error. 5. Update RFC-0017 stage-4 wording and acceptance item. The accepted behavior is: the error names the unknown provider; discoverable valid names come from - generated `ProviderName`. The error payload does not contain 250 names. + generated provider documentation. The error payload does not contain the registry. 6. Regenerate or mechanically update the checked-in TS wire type. Do not add a compatibility union for the old payload. @@ -387,7 +387,7 @@ Clean only residue directly invalidated by this work: - `scripts/gen_responses_convert.py` if it still emits a removed `AiMuxError::Provider` constructor; - stale Rustdoc references to `AiMuxError::Unsupported` / `AiMuxError::Json`; -- the unused `ProviderName` import created by removing the available list. +- stale provider-name discovery references after removing the available list. Do not turn this into a general documentation sweep. @@ -425,4 +425,3 @@ boundaries are: - [ ] Codex subscription 401 still maps to `TokenExpired`. - [ ] No binding compatibility work or unrelated API expansion was added. - [ ] Focused checks in §9 pass and `git diff --check` is clean. - diff --git a/docs/quality-audit/p2-provider-abstraction-audit.md b/docs/quality-audit/p2-provider-abstraction-audit.md index b00b6f642..b6b4c1a9b 100644 --- a/docs/quality-audit/p2-provider-abstraction-audit.md +++ b/docs/quality-audit/p2-provider-abstraction-audit.md @@ -4,6 +4,8 @@ **范围**: `aimux-providers` crate(46.6k 行,78 模块声明,251 registry 条目) **方法**: 只读源码审计(`read`/`grep`/`glob`),未运行 `cargo` 命令 +> **后续变更**: 2026-09-29 删除生成式 `ProviderName` 及 `scripts/gen_provider_names.py`;本报告中关于 `gen_provider_names.py` → `provider_name.rs` 生成链路与 `provider_name_matches_registry_json` 防漂移测试的描述已不再适用,provider 名字统一为字符串,运行期列表由 registry 导出(`provider_names()`),现行列表见 [docs/api/providers.md](../api/providers.md)。 + --- ## 一、概述 diff --git a/docs/quality-audit/p4-release-v021-head-review.md b/docs/quality-audit/p4-release-v021-head-review.md index 547f6afee..b2a33c6a7 100644 --- a/docs/quality-audit/p4-release-v021-head-review.md +++ b/docs/quality-audit/p4-release-v021-head-review.md @@ -13,6 +13,8 @@ > **验证基线**: 各代理分别执行 `cargo check -p aimux-core/-p aimux-provider-utils/-p aimux-providers/-p aimux-ffi/-p aimux-cli/-p aimux-replay` > 全部通过;`cargo test -p aimux-providers --test list_models_test` 22/22 通过; > `gen_provider_names.py --check` 通过(8 文件 / 251 名称);`git diff --check` 无 whitespace error。 +> +> **后续变更**: 2026-09-29 删除生成式 `ProviderName` 及 `scripts/gen_provider_names.py`;本报告验证基线与门禁表中的 `gen_provider_names.py --check` 已不再适用,provider 名字统一为字符串,运行期列表由 registry 导出(`provider_names()`),现行列表见 [docs/api/providers.md](../api/providers.md)。 --- diff --git a/docs/quality-audit/p6-rfc-consistency-round3-review.md b/docs/quality-audit/p6-rfc-consistency-round3-review.md index 2fc490104..bc6acbcce 100644 --- a/docs/quality-audit/p6-rfc-consistency-round3-review.md +++ b/docs/quality-audit/p6-rfc-consistency-round3-review.md @@ -11,6 +11,8 @@ > > **日期**: 2026-08-07 > **关联**: [p4-release-v021-head-review.md](p4-release-v021-head-review.md)、[p5-native-providers-round2-review.md](p5-native-providers-round2-review.md) +> +> **后续变更**: 2026-09-29 删除生成式 `ProviderName` 及 `scripts/gen_provider_names.py`;本报告范围②与门禁对照中的 provider 名称生成漂移检查(`gen_provider_names.py --check`)已不再适用,provider 名字统一为字符串,运行期列表由 registry 导出(`provider_names()`),现行列表见 [docs/api/providers.md](../api/providers.md)。 --- diff --git a/rfc/0017-provider-config-dx.md b/rfc/0017-provider-config-dx.md index 6a64c3a7d..2dfc6d04a 100644 --- a/rfc/0017-provider-config-dx.md +++ b/rfc/0017-provider-config-dx.md @@ -344,18 +344,15 @@ await generateText(model, prompt, { **目标**:把"新增/修正 provider"从库行为变成纯用户行为;补上绑定层(除 Rust 外)对 250 家 registry 的暴露缺口(现状:Node/Python/Go 等只有 openai/anthropic/deepseek 三个工厂)。 -**架构定稿(2026-08-02, v2)**:`provider-registry.json` 是**唯一数据源**——内置 provider 的构造数据(base_url/env_var/profile)全部从 JSON 查条目获得。Rust 250 个编译期类型壳(`XxxConfig`/`XxxProvider`)**退役**(crates.io 发布仅一天,破坏零成本,0.x 内处理)——统一改为名字驱动入口 + 各语言 `ProviderName` 派生类型。 +**架构定稿(2026-09-29, v3)**:`provider-registry.json` 是**唯一数据源**——内置 provider 的构造数据(base_url/env_var/profile)全部从 JSON 查条目获得。Rust 250 个编译期类型壳(`XxxConfig`/`XxxProvider`)与各语言的生成式名字枚举均已退役——统一改为字符串名字驱动入口。 **改动**: 1. `provider-registry.json` — 唯一数据源(250 家:name/display/base_url/env_var/profile 全字段),由阶段 3 调研数据生成;Rust `include_str!` embed,各绑定打包同一份 -2. **名字类型声明**(checked-in 派生文件,脚本 `scripts/gen_provider_names.py` 从 JSON 生成,无 build.rs): - - TS: `type ProviderName = 'groq' | 'deepseek' | ...`(字面量 union → IDE 补全 + 编译期检查) - - Rust: `pub enum ProviderName { Groq, DeepSeek, ... }`(250 变体 + `as_str()`/`FromStr`/`Display`) - - Go/Python/Swift/Kotlin/Java: 各语言常量/枚举/Literal 形态 +2. **名字发现**:不再生成 8 语言静态副本;Rust/web 可通过 `provider_names()` 遍历内置 registry,用户文档由 `gen_providers_doc.py` 从同一 JSON 生成 3. **统一入口**(各语言一致): - - `provider(name: ProviderName, api_key: Option, model_id, config?)` — 名字 → 查 JSON → 构造;`api_key=None` 时自动读 JSON 条目的 env_var(替代旧 `from_env()`) + - `provider(name: string, api_key: Option, model_id, config?)` — 名字 → 查 JSON → 构造;`api_key=None` 时自动读 JSON 条目的 env_var(替代旧 `from_env()`) - config 可覆盖 JSON 条目字段(base_url/headers/maxRetries/bodyOverrides 等,替代旧 `with_base_url`) - - 未知名字 → 明确错误:`NoSuchProvider { provider_id }`,显示 "No such provider: xxx";可用名字通过生成的 `ProviderName` 发现,错误载荷不携带 250 个名字 + - 未知名字 → 明确错误:`NoSuchProvider { provider_id }`,显示 "No such provider: xxx";错误载荷不携带 250 个名字 4. **`createProvider(config)`**(各语言):用户用基础类(`OpenAIConfig`/`OpenAIProvider`)手工构造自己的薄封装——**与内置表无关**的纯用户侧 API;用于自定义 relay / 内置表外厂商 5. 边界特例(§2.6):认证流程特殊者(GigaChat/copilot)标记 unsupported 或后续 auth 钩子;伪兼容(coze/zai_coding_plan)修正分类 6. 校验:启动时对 registry JSON 做 schema 校验(必填字段/base_url 合法性) @@ -373,14 +370,14 @@ await generateText(model, prompt, { | 基础类构造(createProvider 地基) | `OpenAIConfig`/`OpenAIProvider` 保留 | **验收**: -- [x] 任意语言 `provider(ProviderName::Groq, key, "llama-3.3-70b")` 可用,profile 差异生效(Rust/Node/Python 冒烟 ✅;Go/Java/Kotlin/Swift/Flutter 代码就绪,环境受限未运行) -- [x] `ProviderName` 类型生成正确且被测试锁定(250 名字与 JSON 一致,`provider_name_roundtrip` 测试) +- [x] 任意语言 `provider("groq", key, "llama-3.3-70b")` 可用,profile 差异生效 +- [x] `provider_names()` 与生成的 provider 文档均直接读取 registry,不维护静态名字副本 - [x] 用户覆盖内置条目生效(`ProviderOptions.base_url` 等;Rust `base_url_override_is_applied` + Node/Python/Go/C 的 config 参数) - [x] `createProvider` 等价能力:基础类 `OpenAIConfig`/`OpenAIProvider` 保留 + 各绑定 config 参数覆盖(Rust/Node/Python/Go/C 均实现) -- [x] 未知名字报错指明所请求的 provider(`NoSuchProvider { provider_id }`);可用列表由生成的 `ProviderName` 提供,不进错误载荷(Node/Python 冒烟验证) +- [x] 未知名字报错指明所请求的 provider(`NoSuchProvider { provider_id }`),不把可用名字列表放进错误载荷 - [x] 7 处 registry base_url 错误通过数据修正落地(stage2-004 完成) -**实施状态(2026-08-02)**:✅ 完成——registry JSON 唯一数据源;250 壳类型退役(发布一天零成本);`provider(name)` 入口 + `ProviderName` 派生类型(Rust enum/TS union);C ABI `aimux_provider_new`/`aimux_provider_from_env`;8 语言绑定统一入口;全量测试 2769 绿;Node/Python E2E 冒烟通过。 +**实施状态(2026-09-29)**:✅ 完成——registry JSON 唯一数据源;250 壳类型与 8 语言名字派生退役;字符串 `provider(name)` 入口、C ABI `aimux_provider_new`/`aimux_provider_from_env` 与 8 语言绑定统一入口保留。 --- @@ -436,4 +433,4 @@ await generateText(model, prompt, { 6. **退役 DeepSeek 特化的迁移**:0.x minor bump + 用户手册迁移说明(reasoning:'none' → bodyOverrides)。 7. **registry JSON 化的校验时机**:启动时 schema 校验替代编译期校验,错误发现延后——是否可接受?校验规则集(必填字段/base_url 合法/profile 字段范围)需定义。 8. **认证流程特殊厂商**(GigaChat OAuth/copilot device-flow)的落地形态:auth 钩子(代码扩展点)还是暂不支持仅文档化。 -9. ~~**Rust 编译期类型与 JSON 的单一事实来源**~~:**已解决(2026-08-02)**——JSON 为唯一源;类型壳**退役**(发布一天零成本),统一 `provider(name)` 入口 + `ProviderName` 派生类型,无宏生成、无双源、无 build.rs。 +9. ~~**Rust 编译期类型与 JSON 的单一事实来源**~~:**已解决(2026-09-29)**——JSON 为唯一源;类型壳与静态名字枚举均退役,统一字符串 `provider(name)` 入口,无宏生成、无双源、无 build.rs。 diff --git a/rfc/0020-external-provider-config.md b/rfc/0020-external-provider-config.md index a0a7819b2..5a2397a97 100644 --- a/rfc/0020-external-provider-config.md +++ b/rfc/0020-external-provider-config.md @@ -4,6 +4,7 @@ > **Date**: 2026-08-05 > **Scope**: `aimux-providers` 新增运行时覆盖层,允许外部(配置文件 / 编程式 API)注册、覆盖 OpenAI 兼容 provider 条目;各 binding 薄透传 > **Related**: [RFC-0017](0017-provider-config-dx.md) 配置 DX(本 RFC 落地其 §363 预留的"用户覆盖内置条目"语义)、[RFC-0019](0019-session-affinity.md) 会话亲和、[调研报告](../docs/external-provider-config-research.md) +> **后续变更**: 2026-09-29 删除生成式 `ProviderName`;内置与外部名字现在都走字符串入口,不改变本 RFC 的 overlay 语义。 --- @@ -23,7 +24,7 @@ RFC-0017 阶段 4 已预留语义([0017-provider-config-dx.md:363](0017-provider ## 2. Design Goals -1. **零破坏性**:不动 `provider_registry.json`、不动 `gen_provider_names.py`、不动 `ProviderName` 派生、不动 `provider()` 签名(新参数全 `Option`)。 +1. **零破坏性**:不动 `provider_registry.json`、不动 `provider()` 签名(新参数全 `Option`)。 2. **后端管线零改动**:外部配置只影响"查条目"一步;查到后 `OpenAIConfig` 构造 + `ProviderOptions` 叠加 + `OpenAIProvider::new(config).language_model(id)` 完全复用。 3. **8 语言同步受益**:Rust core 一处落地,各 binding 薄透传(RFC-0017 阶段 4 已验证此分发模式)。 4. **仅 OpenAI 兼容协议**:原生协议(anthropic/google/bedrock…)是代码实现,无法用配置数据描述(RFC-0017 §2.6 分层定论)。 @@ -50,7 +51,7 @@ static OVERLAYS: Lazy>> = // 3. 未命中 → NoSuchProvider ``` -内置 registry 仍是 `include_str!` 编译期嵌入(`OnceLock>` 不变);覆盖层只承载外部新增/覆盖条目。外部名字不属于编译期 `ProviderName` 枚举,走字符串路径——`provider()` 本就接受 `&str`,无需改签名。 +内置 registry 仍是 `include_str!` 编译期嵌入(`OnceLock>` 不变);覆盖层只承载外部新增/覆盖条目。内置与外部名字都走字符串路径——`provider()` 接受 `&str`,无需改签名。 ### 3.2 配置条目 schema @@ -261,7 +262,7 @@ const char* aimux_register_providers(const char* config_json); 2. **不做动态发现 / 网关路由**。增删 provider 可行(覆盖层可变),但"动态发现"(运行时探测可用 provider)属网关职责,aimux 定位是接入层不做(RFC-0019 §1.4)。 3. **不做 deep-merge 覆盖语义**。整体替换,简单可预期。 4. **不做配置热重载 / 文件监听**。MVP 是启动期加载注册,进程生命周期内固定。 -5. **不改 `ProviderName` 枚举**。外部名字走字符串路径,不属于编译期派生。 +5. **不维护编译期名字枚举**。内置与外部名字统一走字符串路径。 --- diff --git a/scripts/gen_provider_names.py b/scripts/gen_provider_names.py deleted file mode 100644 index b47c27ea2..000000000 --- a/scripts/gen_provider_names.py +++ /dev/null @@ -1,250 +0,0 @@ -"""Generate ProviderName derived types from provider-registry.json (RFC-0017 phase 4). - -Produces (all checked-in, one per language): -- aimux-providers/src/provider_name.rs (Rust enum) -- bindings/node/src/types/ProviderName.ts (TS string-literal union) -- bindings/go/provider_name.go (Go const group) -- bindings/python/python/aimux/provider_name.py (Python Literal) -- bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java (Java String consts) -- bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt (Kotlin const object) -- bindings/swift/Sources/Aimux/ProviderName.swift (Swift enum) -- bindings/flutter/lib/provider_name.dart (Dart const class) - -Usage: uv run python scripts/gen_provider_names.py -Idempotent: overwrites outputs. -""" - -import json -import sys -from pathlib import Path - -ROOT = Path(__file__).resolve().parent.parent -JSON = ROOT / "aimux-providers" / "src" / "provider_registry.json" - - -def to_variant(name: str) -> str: - """snake_case provider name -> PascalCase (abacus->Abacus, reka_ai->RekaAi).""" - parts = name.split("_") - out = [] - for p in parts: - if not p: - continue - if p[0].isdigit(): - out.append(p) - else: - out.append(p[0].upper() + p[1:]) - return "".join(out) - - -def gen_rs(names): - variants = "\n".join(f" {to_variant(n)}," for n in names) - arms_str = "\n".join(f' Self::{to_variant(n)} => "{n}",' for n in names) - arms_from = "\n".join(f' "{n}" => Ok(Self::{to_variant(n)}),' for n in names) - all_list = "\n".join(f" Self::{to_variant(n)}," for n in names) - return f"""//! Provider name enum — GENERATED by `scripts/gen_provider_names.py`. -//! Do not edit manually; single source of truth is `provider_registry.json`. - -/// Names of all built-in OpenAI-compatible providers (registry-backed). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum ProviderName {{ -{variants} -}} - -impl ProviderName {{ - /// All provider names, sorted. - pub const ALL: &'static [ProviderName] = &[ -{all_list} - ]; - - /// The registry name (snake_case), e.g. `ProviderName::Groq -> "groq"`. - #[must_use] - pub fn as_str(self) -> &'static str {{ - match self {{ -{arms_str} - }} - }} - - /// All registry names (for error messages / docs). - #[must_use] - pub const fn all_names() -> &'static str {{ - "{','.join(names)}" - }} -}} - -impl std::str::FromStr for ProviderName {{ - type Err = (); - - fn from_str(name: &str) -> Result {{ - match name {{ -{arms_from} - _ => Err(()), - }} - }} -}} - -impl AsRef for ProviderName {{ - fn as_ref(&self) -> &str {{ - self.as_str() - }} -}} - -impl std::fmt::Display for ProviderName {{ - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {{ - f.write_str(self.as_str()) - }} -}} -""" - - -def gen_ts(names): - props = "\n".join(f" {n}: '{n}'," for n in names) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/** - * Names of all built-in OpenAI-compatible providers. - * Use `ProviderName.groq` etc. as the `name` argument of `provider()`. - */ -export const ProviderName = {{ -{props} -}} as const - -export type ProviderName = typeof ProviderName[keyof typeof ProviderName] -""" - - -def gen_go(names): - # gofmt-aligned const block: pad variant names to the widest one. - width = max(len(to_variant(n)) for n in names) - consts = "\n".join( - f'\t{to_variant(n):<{width}} ProviderName = "{n}"' for n in names - ) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package aimux - -// ProviderName is the registry name of a built-in OpenAI-compatible provider. -type ProviderName string - -const ( -{consts} -) -""" - - -def gen_py(names): - lit = ", ".join(f"{n!r}" for n in names) - return f'''"""ProviderName — GENERATED by `scripts/gen_provider_names.py`. - -Do not edit manually; single source of truth is `provider-registry.json`. -""" - -from typing import Literal - -ProviderName = Literal[{lit}] -''' - - -def gen_java(names): - consts = "\n".join( - f' public static final String {to_variant(n).upper()} = "{n}";' - for n in names - ) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package ai.arcships.aimux; - -/** Names of all built-in OpenAI-compatible providers. */ -public final class ProviderName {{ - private ProviderName() {{}} - -{consts} -}} -""" - - -def gen_kotlin(names): - consts = "\n".join( - f' const val {to_variant(n).upper()} = "{n}"' for n in names - ) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. -package ai.arcships.aimux - -/** Names of all built-in OpenAI-compatible providers. */ -object ProviderName {{ -{consts} -}} -""" - - -def gen_swift(names): - cases = "\n".join(f' case {to_variant(n)} = "{n}"' for n in names) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/// Names of all built-in OpenAI-compatible providers. -public enum ProviderName: String, CaseIterable, Sendable {{ -{cases} -}} -""" - - -def gen_dart(names): - consts = "\n".join(f" static const {to_variant(n)} = '{n}';" for n in names) - return f"""// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/// Names of all built-in OpenAI-compatible providers. -class ProviderName {{ - ProviderName._(); -{consts} -}} -""" - - -OUTPUTS = { - "aimux-providers/src/provider_name.rs": gen_rs, - "bindings/node/src/types/ProviderName.ts": gen_ts, - "bindings/go/provider_name.go": gen_go, - "bindings/python/python/aimux/provider_name.py": gen_py, - "bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java": gen_java, - "bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt": gen_kotlin, - "bindings/swift/Sources/Aimux/ProviderName.swift": gen_swift, - "bindings/flutter/lib/provider_name.dart": gen_dart, -} - - -def main() -> int: - check = "--check" in sys.argv[1:] - entries = json.loads(JSON.read_text(encoding="utf-8")) - names = sorted(e["name"] for e in entries) - stale = [] - for rel, gen in OUTPUTS.items(): - out = ROOT / rel - text = gen(names) - if check: - on_disk = out.read_text(encoding="utf-8") if out.is_file() else None - if on_disk != text: - stale.append(rel) - continue - out.parent.mkdir(parents=True, exist_ok=True) - out.write_text(text, encoding="utf-8") - print(f"{len(names)} names -> {out.relative_to(ROOT)}") - if stale: - for rel in stale: - print(f"STALE: {rel}", file=sys.stderr) - print( - "generated ProviderName files are out of sync — " - "run scripts/gen_provider_names.py and commit the result", - file=sys.stderr, - ) - return 1 - if check: - print(f"{len(OUTPUTS)} files up to date ({len(names)} names)") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/scripts/gen_providers_doc.py b/scripts/gen_providers_doc.py index ad4db61b8..e62626cad 100644 --- a/scripts/gen_providers_doc.py +++ b/scripts/gen_providers_doc.py @@ -7,8 +7,8 @@ A `pub mod` in lib.rs counts as a provider module iff its `pub use` re-exports a typed surface (`*Provider` / `*Config` / `*Model`). Registry machinery -(`provider`, `provider_name`), `replay` and `catalogue` export none of these -and are excluded without a hand-kept list. +(`provider`), `replay` and `catalogue` export none of these and are excluded +without a hand-kept list. The generated page carries the provider totals (registry rows, per-category typed providers, grand total); other docs reference it instead of repeating @@ -64,10 +64,10 @@ def parse_lib_rs(): while k < len(lines) and lines[k].strip() == "": k += 1 if k < len(lines) and lines[k].strip().startswith("pub mod "): - # registry machinery (provider / provider_name) has its own - # doc comment block — never treat it as a section header + # registry machinery (provider) has its own doc comment + # block — never treat it as a section header first_mod = lines[k].strip().split()[2].rstrip(";") - if first_mod in ("provider", "provider_name"): + if first_mod == "provider": i = j continue if pending: @@ -131,9 +131,8 @@ def is_provider_module(module): """True when the module re-exports a typed provider surface. A provider module exposes `*Provider` / `*Config` / `*Model` types. - Registry machinery (`provider`, `provider_name`), `replay` and - `catalogue` re-export none of these, so they are excluded without a - hand-kept deny-list (#177). + Registry machinery (`provider`), `replay` and `catalogue` re-export + none of these, so they are excluded without a hand-kept deny-list (#177). """ return any(e.endswith(("Provider", "Config", "Model")) for e in module_exports(module)) @@ -180,7 +179,7 @@ def build_page(): w("") w("| category | count |") w("|----------|-------|") - w(f"| Registry-backed OpenAI-compatible (`provider(name, ...)` / `ProviderName`) | {len(registry)} |") + w(f"| Registry-backed OpenAI-compatible (`provider(name, ...)`) | {len(registry)} |") for title, mods in sections: # First sentence only — some lib.rs section comments run on; the full # title stays on the section heading below. The lookahead keeps @@ -191,7 +190,7 @@ def build_page(): w("") w( f"**{len(registry)} registry-backed OpenAI-compatible providers** " - f"(construct via `provider(name, ...)` / `ProviderName`) + " + f"(construct via `provider(name, ...)`) + " f"**{non_registry} non-registry providers** " "(construct via the typed factories listed below)." ) diff --git a/scripts/gen_ts_types.py b/scripts/gen_ts_types.py index 26a0da907..2babf2928 100755 --- a/scripts/gen_ts_types.py +++ b/scripts/gen_ts_types.py @@ -27,11 +27,6 @@ ROOT = Path(__file__).resolve().parent.parent TYPES_DIR = ROOT / "bindings" / "node" / "src" / "types" TYPES_TS = ROOT / "bindings" / "node" / "src" / "types.ts" -# ProviderName.ts is generated by scripts/gen_provider_names.py and re-exported -# from index.ts directly as a value + type; it is not a ts-rs product, and this -# aggregate is type-only (it would erase the const), so it lives outside the -# generated set: never compared, never deleted, never re-exported here. -EXCLUDED = {"ProviderName.ts"} def normalize_generated(content: str) -> str: @@ -79,8 +74,8 @@ def aggregate(files: dict[str, str]) -> str: def sync(expected: dict[str, str]) -> None: - """Make TYPES_DIR match expected exactly (EXCLUDED files untouched).""" - for rel in manifest(TYPES_DIR, EXCLUDED).keys() - expected.keys(): + """Make TYPES_DIR match expected exactly.""" + for rel in manifest(TYPES_DIR).keys() - expected.keys(): (TYPES_DIR / rel).unlink() for rel, content in expected.items(): path = TYPES_DIR / rel @@ -112,7 +107,7 @@ def main() -> int: print(f"{len(expected)} files written to {TYPES_DIR.relative_to(ROOT)}") return 0 - actual = manifest(TYPES_DIR, EXCLUDED) if TYPES_DIR.is_dir() else {} + actual = manifest(TYPES_DIR) if TYPES_DIR.is_dir() else {} missing = sorted(expected.keys() - actual.keys()) stale = sorted(actual.keys() - expected.keys()) changed = sorted(k for k in expected.keys() & actual.keys() if expected[k] != actual[k]) diff --git a/scripts/local-ci.sh b/scripts/local-ci.sh index 11bc206c8..d6b3152e3 100755 --- a/scripts/local-ci.sh +++ b/scripts/local-ci.sh @@ -4,7 +4,7 @@ # Mirrors .github/workflows/ci.yml (host jobs only; cross-platform matrix # targets and Flutter example builds stay in CI): # rust cargo fmt + clippy -D warnings + cargo test --workspace -# contract ProviderName drift + Rust contract tests + Node run-node.ts +# contract Rust contract tests + Node run-node.ts # python maturin develop --release + pytest (bindings/python venv) # node npm ci + napi build + npm test + tsc typecheck # go go vet + go test (needs local-ci-setup.sh) @@ -72,9 +72,8 @@ fi # ── contract ─────────────────────────────────────────────────────────────── if want contract; then - section "contract: ProviderName drift + Rust/Node contract tests" - if python3 scripts/gen_provider_names.py --check \ - && cargo test --test contract_test -p aimux-core --quiet \ + section "contract: Rust/Node contract tests" + if cargo test --test contract_test -p aimux-core --quiet \ && node --experimental-strip-types contract-tests/run-node.ts | grep -q '0 failed'; then pass "contract" else diff --git a/tools/aimux-web/src/api/providers.rs b/tools/aimux-web/src/api/providers.rs index 907cb9675..5393794c7 100644 --- a/tools/aimux-web/src/api/providers.rs +++ b/tools/aimux-web/src/api/providers.rs @@ -4,17 +4,15 @@ use axum::Json; use axum::response::{IntoResponse, Response}; use serde_json::{Value, json}; -use aimux_providers::provider_name::ProviderName; - /// Provider names: the six native single-key protocols plus every -/// registry-backed OpenAI-compatible provider (generated enum). +/// registry-backed OpenAI-compatible provider. pub fn provider_names() -> Vec { const NATIVE: [&str; 6] = ["openai", "anthropic", "google", "mistral", "xai", "cohere"]; let mut names: Vec = NATIVE .iter() .map(std::string::ToString::to_string) .collect(); - names.extend(ProviderName::ALL.iter().map(|p| p.as_str().to_string())); + names.extend(aimux_providers::provider_names().map(str::to_owned)); names } diff --git a/tools/aimux-web/web/src/types/ProviderName.ts b/tools/aimux-web/web/src/types/ProviderName.ts deleted file mode 100644 index 34fccb295..000000000 --- a/tools/aimux-web/web/src/types/ProviderName.ts +++ /dev/null @@ -1,262 +0,0 @@ -// ProviderName — GENERATED by `scripts/gen_provider_names.py`. -// Do not edit manually; single source of truth is `provider-registry.json`. - -/** - * Names of all built-in OpenAI-compatible providers. - * Use `ProviderName.groq` etc. as the `name` argument of `provider()`. - */ -export const ProviderName = { - abacus: 'abacus', - abliteration_ai: 'abliteration_ai', - ai21: 'ai21', - ai302: 'ai302', - ai_router: 'ai_router', - aiand: 'aiand', - aibadgr: 'aibadgr', - aigc2d: 'aigc2d', - aihubmix: 'aihubmix', - ails: 'ails', - aiml: 'aiml', - aki_io: 'aki_io', - albert: 'albert', - alibaba: 'alibaba', - alibaba_coding_plan: 'alibaba_coding_plan', - alibaba_coding_plan_cn: 'alibaba_coding_plan_cn', - alibaba_token_plan: 'alibaba_token_plan', - alibaba_token_plan_cn: 'alibaba_token_plan_cn', - ambient: 'ambient', - anyapi: 'anyapi', - anyscale: 'anyscale', - apertis: 'apertis', - api2d: 'api2d', - api2gpt: 'api2gpt', - apiserpent: 'apiserpent', - atlascloud: 'atlascloud', - atomic_chat: 'atomic_chat', - auriko: 'auriko', - azure_ai: 'azure_ai', - baichuan: 'baichuan', - baidu: 'baidu', - baidu_v2: 'baidu_v2', - bailing: 'bailing', - baseten: 'baseten', - berget: 'berget', - bigmodel: 'bigmodel', - blueclaw: 'blueclaw', - bytedance: 'bytedance', - byteplus: 'byteplus', - bytez: 'bytez', - canopywave: 'canopywave', - cerebras: 'cerebras', - chatgpt: 'chatgpt', - cherryin: 'cherryin', - chutes: 'chutes', - clarifai: 'clarifai', - claudinio: 'claudinio', - cline_pass: 'cline_pass', - closeai: 'closeai', - cloudferro_sherlock: 'cloudferro_sherlock', - cloudflare: 'cloudflare', - cloudflare_workers_ai: 'cloudflare_workers_ai', - codestral: 'codestral', - cometapi: 'cometapi', - commandcode: 'commandcode', - compactifai: 'compactifai', - copilot: 'copilot', - cortecs: 'cortecs', - coze: 'coze', - crof: 'crof', - crossmodel: 'crossmodel', - crusoe: 'crusoe', - daoxe: 'daoxe', - darkbloom: 'darkbloom', - databricks: 'databricks', - datarobot: 'datarobot', - deepbricks: 'deepbricks', - deepinfra: 'deepinfra', - deepseek: 'deepseek', - digitalocean: 'digitalocean', - dinference: 'dinference', - doubao: 'doubao', - doubleword: 'doubleword', - drun: 'drun', - ebcloud: 'ebcloud', - embercloud: 'embercloud', - empiriolabs: 'empiriolabs', - evroc: 'evroc', - fastcrw: 'fastcrw', - fastgpt: 'fastgpt', - fastrouter: 'fastrouter', - featherless_ai: 'featherless_ai', - firepass: 'firepass', - fireworks: 'fireworks', - freemodel: 'freemodel', - friendliai: 'friendliai', - frogbot: 'frogbot', - galadriel: 'galadriel', - gdc: 'gdc', - gigachat: 'gigachat', - github: 'github', - gmi: 'gmi', - gmicloud: 'gmicloud', - gonka24: 'gonka24', - gradient_ai: 'gradient_ai', - groq: 'groq', - helicone: 'helicone', - heroku: 'heroku', - hetzner: 'hetzner', - hosted_vllm: 'hosted_vllm', - hpc_ai: 'hpc_ai', - hyperbolic: 'hyperbolic', - iflowcn: 'iflowcn', - inception: 'inception', - inceptron: 'inceptron', - inference_net: 'inference_net', - inferencehub: 'inferencehub', - inferx: 'inferx', - infinity: 'infinity', - io_net: 'io_net', - jiekou: 'jiekou', - kenari: 'kenari', - kilo: 'kilo', - kimi: 'kimi', - kimi_for_coding: 'kimi_for_coding', - kiro: 'kiro', - kluster_ai: 'kluster_ai', - krutrim: 'krutrim', - kuae_cloud_coding_plan: 'kuae_cloud_coding_plan', - lambda_ai: 'lambda_ai', - lemonade: 'lemonade', - lemonfox_ai: 'lemonfox_ai', - libertai: 'libertai', - lilac: 'lilac', - lingyiwanwu: 'lingyiwanwu', - llama: 'llama', - llamagate: 'llamagate', - llmgateway: 'llmgateway', - llmtr: 'llmtr', - longcat: 'longcat', - lucidquery: 'lucidquery', - lynkr: 'lynkr', - matterai: 'matterai', - meganova: 'meganova', - merge_gateway: 'merge_gateway', - meta: 'meta', - meta_llama: 'meta_llama', - mimo: 'mimo', - minimax: 'minimax', - minimax_cn: 'minimax_cn', - minimax_cn_coding_plan: 'minimax_cn_coding_plan', - minimax_coding_plan: 'minimax_coding_plan', - mira: 'mira', - mixlayer: 'mixlayer', - moark: 'moark', - modal: 'modal', - model_oracle_ai: 'model_oracle_ai', - modelscope: 'modelscope', - moonshotai: 'moonshotai', - moonshotai_cn: 'moonshotai_cn', - morph: 'morph', - nanogpt: 'nanogpt', - ncompass: 'ncompass', - nearai: 'nearai', - nebius: 'nebius', - neon: 'neon', - neuralwatt: 'neuralwatt', - nextbit: 'nextbit', - nlp_cloud: 'nlp_cloud', - nous_research: 'nous_research', - novita: 'novita', - nscale: 'nscale', - nvidia_nim: 'nvidia_nim', - oci: 'oci', - ofox: 'ofox', - ohmygpt: 'ohmygpt', - ollama_cloud: 'ollama_cloud', - openaimax: 'openaimax', - openaisb: 'openaisb', - opencode: 'opencode', - opencode_go: 'opencode_go', - opencode_zen: 'opencode_zen', - orcarouter: 'orcarouter', - ovhcloud: 'ovhcloud', - parasail: 'parasail', - perfxcloud: 'perfxcloud', - perplexity: 'perplexity', - perplexity_agent: 'perplexity_agent', - petals: 'petals', - pinstripes: 'pinstripes', - pioneer: 'pioneer', - poe: 'poe', - poolside: 'poolside', - portkey: 'portkey', - ppinfra: 'ppinfra', - predibase: 'predibase', - privatemode_ai: 'privatemode_ai', - publicai: 'publicai', - qihang_ai: 'qihang_ai', - qihoo360: 'qihoo360', - qiniu_ai: 'qiniu_ai', - regolo_ai: 'regolo_ai', - reka_ai: 'reka_ai', - requesty: 'requesty', - reve: 'reve', - routing_run: 'routing_run', - sakana: 'sakana', - sambanova: 'sambanova', - sarvam: 'sarvam', - scaleway: 'scaleway', - scx_ai: 'scx_ai', - siliconflow: 'siliconflow', - snowflake: 'snowflake', - snowflake_cortex: 'snowflake_cortex', - stackit: 'stackit', - stepfun: 'stepfun', - stepfun_ai_step_plan: 'stepfun_ai_step_plan', - stepfun_step_plan: 'stepfun_step_plan', - subconscious: 'subconscious', - submodel: 'submodel', - synthetic: 'synthetic', - tencent: 'tencent', - tencent_coding_plan: 'tencent_coding_plan', - tencent_token_plan: 'tencent_token_plan', - tencent_token_plan_enterprise_auto: 'tencent_token_plan_enterprise_auto', - tencent_token_plan_enterprise_pro: 'tencent_token_plan_enterprise_pro', - tencent_token_plan_general_personal: 'tencent_token_plan_general_personal', - tencent_token_plan_hy_personal: 'tencent_token_plan_hy_personal', - tencent_tokenhub: 'tencent_tokenhub', - tensormesh: 'tensormesh', - the_grid_ai: 'the_grid_ai', - thinkingmachines: 'thinkingmachines', - tinfoil: 'tinfoil', - togetherai: 'togetherai', - tokenflux: 'tokenflux', - tokenpony: 'tokenpony', - trustedrouter: 'trustedrouter', - tundra: 'tundra', - umans_ai: 'umans_ai', - unorouter: 'unorouter', - upstage: 'upstage', - v0: 'v0', - venice: 'venice', - vercel: 'vercel', - vivgrid: 'vivgrid', - volc_engine: 'volc_engine', - vultr: 'vultr', - wafer: 'wafer', - wandb: 'wandb', - xiaomi_token_plan_ams: 'xiaomi_token_plan_ams', - xiaomi_token_plan_cn: 'xiaomi_token_plan_cn', - xiaomi_token_plan_sgp: 'xiaomi_token_plan_sgp', - xiaomimimo: 'xiaomimimo', - xpersona: 'xpersona', - xunfei: 'xunfei', - zai: 'zai', - zai_coding_plan: 'zai_coding_plan', - zeldoc: 'zeldoc', - zenmux: 'zenmux', - zhipu_v4: 'zhipu_v4', - zhipuai_coding_plan: 'zhipuai_coding_plan', -} as const - -export type ProviderName = typeof ProviderName[keyof typeof ProviderName]