From 103d23a3655e97efe2eb5450b882cc13a9b03875 Mon Sep 17 00:00:00 2001 From: chenhaonan Date: Tue, 29 Sep 2026 14:30:03 +0800 Subject: [PATCH 01/10] refactor(providers): remove generated provider name types Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-01a0eb91-5e79-775e-975e-b85e2ac49ab6 (cherry picked from commit 7f68ac3686d78f1f614e1f313cccce4c10aa9222) --- .github/workflows/ci.yml | 2 - README.md | 10 +- aimux-providers/src/lib.rs | 3 +- aimux-providers/src/provider.rs | 64 +- aimux-providers/src/provider_name.rs | 1053 ----------------- bindings/flutter/lib/provider_name.dart | 258 ---- bindings/go/provider_name.go | 260 ---- .../java/ai/arcships/aimux/ProviderName.java | 260 ---- .../java/ai/arcships/aimux/ModelTest.java | 9 - .../kotlin/ai/arcships/aimux/ProviderName.kt | 258 ---- .../kotlin/ai/arcships/aimux/ModelTest.kt | 9 - bindings/node/package.json | 2 +- bindings/node/src/index.ts | 5 - bindings/node/src/types/ProviderName.ts | 262 ---- bindings/python/python/aimux/provider_name.py | 8 - .../swift/Sources/Aimux/ProviderName.swift | 257 ---- .../swift/Tests/AimuxTests/AimuxTests.swift | 9 - docs/API.md | 13 +- docs/PROJECT-OVERVIEW.md | 4 +- docs/api/flutter.md | 11 +- docs/api/go.md | 8 +- docs/api/java.md | 12 +- docs/api/kotlin.md | 11 +- docs/api/node.md | 11 +- docs/api/providers.md | 4 +- docs/api/reference.md | 5 +- docs/api/rust.md | 13 +- docs/api/swift.md | 11 +- docs/contributing/adding-a-provider.md | 9 +- docs/external-provider-config-research.md | 4 +- .../structured-error-business-semantics.md | 11 +- rfc/0017-provider-config-dx.md | 21 +- rfc/0020-external-provider-config.md | 7 +- scripts/gen_provider_names.py | 250 ---- scripts/gen_providers_doc.py | 4 +- scripts/gen_ts_types.py | 11 +- scripts/local-ci.sh | 7 +- tools/aimux-web/src/api/providers.rs | 6 +- 38 files changed, 90 insertions(+), 3072 deletions(-) delete mode 100644 aimux-providers/src/provider_name.rs delete mode 100644 bindings/flutter/lib/provider_name.dart delete mode 100644 bindings/go/provider_name.go delete mode 100644 bindings/java/src/main/java/ai/arcships/aimux/ProviderName.java delete mode 100644 bindings/kotlin/src/main/kotlin/ai/arcships/aimux/ProviderName.kt delete mode 100644 bindings/node/src/types/ProviderName.ts delete mode 100644 bindings/python/python/aimux/provider_name.py delete mode 100644 bindings/swift/Sources/Aimux/ProviderName.swift delete mode 100644 scripts/gen_provider_names.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26fe5a904..398d4339e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -396,8 +396,6 @@ jobs: runs-on: ubuntu-latest 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/README.md b/README.md index 02ee0ed0d..f0654816a 100644 --- a/README.md +++ b/README.md @@ -275,18 +275,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/aimux-providers/src/lib.rs b/aimux-providers/src/lib.rs index 90e926f31..102dec8f4 100644 --- a/aimux-providers/src/lib.rs +++ b/aimux-providers/src/lib.rs @@ -35,11 +35,10 @@ 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_from_env, provider_handle, + load_providers_from_json, provider, provider_from_env, provider_handle, 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 ea74bc148..887ac44c3 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,12 @@ pub fn provider_from_env( provider(name, None, model_id, options) } +/// Names of all built-in registry providers. +#[must_use] +pub fn provider_names() -> impl Iterator { + registry().iter().map(|entry| entry.name.as_str()) +} + /// Public lookup of a registered provider's runtime profile — used by tests /// that assert registry wiring (e.g. `max_tokens_key`) without constructing a /// model. Returns `None` for unknown provider names. @@ -608,7 +614,6 @@ pub fn provider_registry_entry(name: &str) -> Option { #[cfg(test)] mod tests { use super::*; - use crate::provider_name::ProviderName; #[test] fn provider_builds_groq_model() { @@ -637,23 +642,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] @@ -784,38 +778,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/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/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..47c34b180 100644 --- a/scripts/gen_providers_doc.py +++ b/scripts/gen_providers_doc.py @@ -180,7 +180,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 +191,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 } From 837aaaf69913930c518ff0a885621e8cc30604f4 Mon Sep 17 00:00:00 2001 From: chenhaonan Date: Wed, 30 Sep 2026 00:02:41 +0800 Subject: [PATCH 02/10] docs(changelog): record removal of generated ProviderName as breaking Co-Authored-By: Claude Sonnet 5.5 (cherry picked from commit 758d0bcbee451f48b8daa47703281403bb1a2369) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 95230304773bc7eb6556c8fabf8efb06fa19c5c0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 16:31:05 +0000 Subject: [PATCH 03/10] fix(providers): drop the redundant #[must_use] on provider_names() The returned impl Iterator is already must_use, so clippy's double_must_use rejected it. (provider.rs part of commit 83974246716cf8e1585c02177b0c87fa4917701e) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa --- aimux-providers/src/provider.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/aimux-providers/src/provider.rs b/aimux-providers/src/provider.rs index 887ac44c3..f067b4ffd 100644 --- a/aimux-providers/src/provider.rs +++ b/aimux-providers/src/provider.rs @@ -595,7 +595,6 @@ pub fn provider_from_env( } /// Names of all built-in registry providers. -#[must_use] pub fn provider_names() -> impl Iterator { registry().iter().map(|entry| entry.name.as_str()) } From 94c48aba4141239b80c15da0a3fbf65c29e13cfd Mon Sep 17 00:00:00 2001 From: cunninghamcard-bit Date: Thu, 1 Oct 2026 05:32:52 +0000 Subject: [PATCH 04/10] chore: drop stale provider_name references left after the ProviderName removal - scripts/gen_providers_doc.py: the `provider_name` module no longer exists; the docstrings and the section-header guard now name only `provider`. `--check` output is unchanged. - docs/internal/phase4-audit.md: add a follow-up note (same style as RFC-0020) so the historical audit no longer reads as if the generated ProviderName types and their drift tests still exist. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS (cherry picked from commit dfcd54f4da70f1d02866f3027363f6359cad0bb8) --- docs/internal/phase4-audit.md | 1 + scripts/gen_providers_doc.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) 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/scripts/gen_providers_doc.py b/scripts/gen_providers_doc.py index 47c34b180..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)) From 1434ae15e603c44607a6afb013dd6dcb326c6aa3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 04:49:24 +0000 Subject: [PATCH 05/10] docs(roadmap): Node drops the ProviderName string-literal union too The A2 line said Node would keep a generated string-literal union for completion. It does not: overlay-registered provider names can never be part of a compile-time union, so keeping one would keep the second name path this PR removes. Record the actual A2 scope. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS (cherry picked from commit 3e2d9fc7dce2bcb8b91407617d5fcd7e49a33cb0) --- ROADMAP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index c952fa816..bcd4c3d8e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -58,7 +58,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 周) From 28a036f266910a499599e8ea9b3ab9941d4e9b72 Mon Sep 17 00:00:00 2001 From: chenhaonan Date: Tue, 29 Sep 2026 14:14:03 +0800 Subject: [PATCH 06/10] refactor(web): consume generated core types directly Amp-Thread-ID: https://ampcode.com/threads/T-01a0eb91-5e79-775e-975e-b85e2ac49ab6 Co-authored-by: Amp (cherry picked from commit dc1cd1439e330e8fd44833984b4ebfb139a6b502) --- tools/aimux-web/README.md | 6 +- tools/aimux-web/web/src/agent/engine.ts | 2 +- tools/aimux-web/web/src/api/client.ts | 8 +- tools/aimux-web/web/src/types/AiMuxError.ts | 27 -- tools/aimux-web/web/src/types/ApiCallError.ts | 66 ----- tools/aimux-web/web/src/types/AspectRatio.ts | 10 - tools/aimux-web/web/src/types/AudioChunk.ts | 6 - tools/aimux-web/web/src/types/AudioData.ts | 9 - tools/aimux-web/web/src/types/AudioInput.ts | 6 - tools/aimux-web/web/src/types/BreakKind.ts | 3 - tools/aimux-web/web/src/types/CallOptions.ts | 114 -------- .../web/src/types/CatalogueSource.ts | 6 - .../aimux-web/web/src/types/ChatCompletion.ts | 10 - .../web/src/types/ChatCompletionChoice.ts | 5 - .../web/src/types/ChatCompletionChunk.ts | 10 - .../src/types/ChatCompletionChunkChoice.ts | 5 - .../src/types/ChatCompletionChunkFunction.ts | 3 - .../src/types/ChatCompletionChunkToolCall.ts | 4 - .../web/src/types/ChatCompletionDelta.ts | 4 - .../web/src/types/ChatCompletionFunction.ts | 3 - .../web/src/types/ChatCompletionMessage.ts | 5 - .../web/src/types/ChatCompletionToolCall.ts | 4 - .../web/src/types/ChatCompletionUsage.ts | 5 - .../web/src/types/CompletionTokensDetails.ts | 3 - tools/aimux-web/web/src/types/ContentPart.ts | 72 ----- .../web/src/types/EmbeddingCallOptions.ts | 21 -- .../web/src/types/EmbeddingResponse.ts | 15 - .../web/src/types/EmbeddingResult.ts | 32 --- .../aimux-web/web/src/types/EmbeddingUsage.ts | 10 - tools/aimux-web/web/src/types/FileBytes.ts | 10 - tools/aimux-web/web/src/types/FileData.ts | 9 - tools/aimux-web/web/src/types/FilePart.ts | 7 - tools/aimux-web/web/src/types/Fingerprint.ts | 20 -- tools/aimux-web/web/src/types/FinishReason.ts | 15 - .../web/src/types/FinishReasonUnified.ts | 6 - tools/aimux-web/web/src/types/FunctionTool.ts | 34 --- .../web/src/types/GenerateContent.ts | 43 --- .../web/src/types/GenerateObjectResult.ts | 49 ---- .../aimux-web/web/src/types/GenerateResult.ts | 44 --- .../web/src/types/GenerateTextOptions.ts | 46 --- .../web/src/types/GenerateTextResult.ts | 82 ------ tools/aimux-web/web/src/types/HttpExchange.ts | 21 -- tools/aimux-web/web/src/types/HttpRecord.ts | 11 - .../web/src/types/ImageCallOptions.ts | 51 ---- tools/aimux-web/web/src/types/ImageFile.ts | 21 -- .../aimux-web/web/src/types/ImageFileData.ts | 6 - tools/aimux-web/web/src/types/ImageOutputs.ts | 12 - .../aimux-web/web/src/types/ImageResponse.ts | 18 -- tools/aimux-web/web/src/types/ImageResult.ts | 33 --- tools/aimux-web/web/src/types/ImageUsage.ts | 20 -- .../web/src/types/InputAudioFormat.ts | 14 - tools/aimux-web/web/src/types/InputRecord.ts | 17 -- .../src/types/LanguageModelPromptMessage.ts | 19 -- .../aimux-web/web/src/types/MessageContent.ts | 7 - tools/aimux-web/web/src/types/Modality.ts | 6 - .../web/src/types/ModelCapabilities.ts | 22 -- tools/aimux-web/web/src/types/ModelCost.ts | 7 - tools/aimux-web/web/src/types/ModelId.ts | 6 - tools/aimux-web/web/src/types/ModelLimits.ts | 18 -- tools/aimux-web/web/src/types/ModelMessage.ts | 8 - .../web/src/types/ModelModalities.ts | 7 - tools/aimux-web/web/src/types/ModelPrompt.ts | 9 - tools/aimux-web/web/src/types/ModelSpec.ts | 26 -- tools/aimux-web/web/src/types/ModelType.ts | 6 - .../aimux-web/web/src/types/OutcomeRecord.ts | 12 - .../aimux-web/web/src/types/OutcomeStatus.ts | 6 - tools/aimux-web/web/src/types/PrefixBreak.ts | 7 - .../web/src/types/PromptTokensDetails.ts | 3 - .../web/src/types/ProviderAuditSpec.ts | 34 --- .../aimux-web/web/src/types/ProviderFamily.ts | 7 - tools/aimux-web/web/src/types/ProviderName.ts | 262 ------------------ .../aimux-web/web/src/types/ProviderRecord.ts | 31 --- tools/aimux-web/web/src/types/ProviderTool.ts | 25 -- .../web/src/types/ReasoningEffort.ts | 9 - .../aimux-web/web/src/types/ReasoningMode.ts | 6 - .../aimux-web/web/src/types/ReasoningPart.ts | 10 - .../aimux-web/web/src/types/ReasoningSpec.ts | 40 --- .../web/src/types/ReasoningVisibility.ts | 6 - tools/aimux-web/web/src/types/Recording.ts | 57 ---- .../web/src/types/RequestCacheHints.ts | 10 - tools/aimux-web/web/src/types/RequestInfo.ts | 13 - .../web/src/types/RerankingCallOptions.ts | 30 -- .../web/src/types/RerankingDocuments.ts | 9 - .../aimux-web/web/src/types/RerankingRank.ts | 14 - .../web/src/types/RerankingResponse.ts | 27 -- .../web/src/types/RerankingResult.ts | 30 -- .../aimux-web/web/src/types/ResponseFormat.ts | 7 - tools/aimux-web/web/src/types/ResponseInfo.ts | 29 -- .../web/src/types/ResponseMetadata.ts | 6 - .../aimux-web/web/src/types/ResponseRecord.ts | 11 - tools/aimux-web/web/src/types/Role.ts | 6 - tools/aimux-web/web/src/types/RuntimeModel.ts | 23 -- .../web/src/types/SearchCallOptions.ts | 43 --- .../aimux-web/web/src/types/SearchResponse.ts | 15 - tools/aimux-web/web/src/types/SearchResult.ts | 31 --- .../web/src/types/SearchResultItem.ts | 32 --- tools/aimux-web/web/src/types/SessionCall.ts | 21 -- .../web/src/types/SessionChainView.ts | 7 - .../aimux-web/web/src/types/SessionSource.ts | 6 - .../web/src/types/SessionStepStat.ts | 28 -- tools/aimux-web/web/src/types/SessionView.ts | 16 -- tools/aimux-web/web/src/types/Size.ts | 10 - tools/aimux-web/web/src/types/SourcePart.ts | 6 - .../web/src/types/SpeechCallOptions.ts | 44 --- .../aimux-web/web/src/types/SpeechRequest.ts | 11 - .../aimux-web/web/src/types/SpeechResponse.ts | 23 -- tools/aimux-web/web/src/types/SpeechResult.ts | 33 --- tools/aimux-web/web/src/types/StreamPart.ts | 66 ----- .../src/types/StreamTextResultAggregated.ts | 75 ----- .../web/src/types/TimeoutConfiguration.ts | 24 -- tools/aimux-web/web/src/types/TimingRecord.ts | 7 - tools/aimux-web/web/src/types/TokenUsage.ts | 30 -- tools/aimux-web/web/src/types/Tool.ts | 10 - tools/aimux-web/web/src/types/ToolCall.ts | 34 --- tools/aimux-web/web/src/types/ToolChoice.ts | 11 - tools/aimux-web/web/src/types/ToolResult.ts | 23 -- tools/aimux-web/web/src/types/TraceFilter.ts | 6 - tools/aimux-web/web/src/types/TraceRecord.ts | 47 ---- tools/aimux-web/web/src/types/TraceStats.ts | 7 - .../web/src/types/TranscriptionCallOptions.ts | 26 -- .../web/src/types/TranscriptionRequest.ts | 10 - .../web/src/types/TranscriptionResponse.ts | 23 -- .../web/src/types/TranscriptionResult.ts | 45 --- .../web/src/types/TranscriptionSegment.ts | 18 -- .../web/src/types/TranscriptionStreamPart.ts | 11 - .../web/src/types/UploadFileCallOptions.ts | 26 -- .../aimux-web/web/src/types/UploadFileData.ts | 11 - .../web/src/types/UploadFileResult.ts | 32 --- tools/aimux-web/web/src/types/Usage.ts | 12 - .../aimux-web/web/src/types/UsageSnapshot.ts | 12 - tools/aimux-web/web/src/types/Verdict.ts | 20 -- .../web/src/types/VerdictConfidence.ts | 6 - tools/aimux-web/web/src/types/VerdictKind.ts | 6 - .../web/src/types/VideoCallOptions.ts | 66 ----- tools/aimux-web/web/src/types/VideoData.ts | 9 - tools/aimux-web/web/src/types/VideoFile.ts | 25 -- .../aimux-web/web/src/types/VideoFileData.ts | 6 - .../web/src/types/VideoFrameImage.ts | 18 -- .../aimux-web/web/src/types/VideoFrameType.ts | 8 - .../aimux-web/web/src/types/VideoResponse.ts | 18 -- tools/aimux-web/web/src/types/VideoResult.ts | 28 -- tools/aimux-web/web/src/types/Warning.ts | 6 - .../web/src/types/WireCallResponse.ts | 2 +- .../web/src/types/WireContentPart.ts | 2 +- tools/aimux-web/web/src/types/WireOptions.ts | 2 +- tools/aimux-web/web/src/types/WireTool.ts | 2 +- .../web/src/types/serde_json/JsonValue.ts | 3 - tools/aimux-web/web/src/views/Replay.vue | 2 +- tools/aimux-web/web/src/views/Sessions.vue | 4 +- tools/aimux-web/web/src/views/Traces.vue | 2 +- 150 files changed, 16 insertions(+), 3045 deletions(-) delete mode 100644 tools/aimux-web/web/src/types/AiMuxError.ts delete mode 100644 tools/aimux-web/web/src/types/ApiCallError.ts delete mode 100644 tools/aimux-web/web/src/types/AspectRatio.ts delete mode 100644 tools/aimux-web/web/src/types/AudioChunk.ts delete mode 100644 tools/aimux-web/web/src/types/AudioData.ts delete mode 100644 tools/aimux-web/web/src/types/AudioInput.ts delete mode 100644 tools/aimux-web/web/src/types/BreakKind.ts delete mode 100644 tools/aimux-web/web/src/types/CallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/CatalogueSource.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletion.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionChoice.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionChunk.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionChunkChoice.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionChunkFunction.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionChunkToolCall.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionDelta.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionFunction.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionMessage.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionToolCall.ts delete mode 100644 tools/aimux-web/web/src/types/ChatCompletionUsage.ts delete mode 100644 tools/aimux-web/web/src/types/CompletionTokensDetails.ts delete mode 100644 tools/aimux-web/web/src/types/ContentPart.ts delete mode 100644 tools/aimux-web/web/src/types/EmbeddingCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/EmbeddingResponse.ts delete mode 100644 tools/aimux-web/web/src/types/EmbeddingResult.ts delete mode 100644 tools/aimux-web/web/src/types/EmbeddingUsage.ts delete mode 100644 tools/aimux-web/web/src/types/FileBytes.ts delete mode 100644 tools/aimux-web/web/src/types/FileData.ts delete mode 100644 tools/aimux-web/web/src/types/FilePart.ts delete mode 100644 tools/aimux-web/web/src/types/Fingerprint.ts delete mode 100644 tools/aimux-web/web/src/types/FinishReason.ts delete mode 100644 tools/aimux-web/web/src/types/FinishReasonUnified.ts delete mode 100644 tools/aimux-web/web/src/types/FunctionTool.ts delete mode 100644 tools/aimux-web/web/src/types/GenerateContent.ts delete mode 100644 tools/aimux-web/web/src/types/GenerateObjectResult.ts delete mode 100644 tools/aimux-web/web/src/types/GenerateResult.ts delete mode 100644 tools/aimux-web/web/src/types/GenerateTextOptions.ts delete mode 100644 tools/aimux-web/web/src/types/GenerateTextResult.ts delete mode 100644 tools/aimux-web/web/src/types/HttpExchange.ts delete mode 100644 tools/aimux-web/web/src/types/HttpRecord.ts delete mode 100644 tools/aimux-web/web/src/types/ImageCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/ImageFile.ts delete mode 100644 tools/aimux-web/web/src/types/ImageFileData.ts delete mode 100644 tools/aimux-web/web/src/types/ImageOutputs.ts delete mode 100644 tools/aimux-web/web/src/types/ImageResponse.ts delete mode 100644 tools/aimux-web/web/src/types/ImageResult.ts delete mode 100644 tools/aimux-web/web/src/types/ImageUsage.ts delete mode 100644 tools/aimux-web/web/src/types/InputAudioFormat.ts delete mode 100644 tools/aimux-web/web/src/types/InputRecord.ts delete mode 100644 tools/aimux-web/web/src/types/LanguageModelPromptMessage.ts delete mode 100644 tools/aimux-web/web/src/types/MessageContent.ts delete mode 100644 tools/aimux-web/web/src/types/Modality.ts delete mode 100644 tools/aimux-web/web/src/types/ModelCapabilities.ts delete mode 100644 tools/aimux-web/web/src/types/ModelCost.ts delete mode 100644 tools/aimux-web/web/src/types/ModelId.ts delete mode 100644 tools/aimux-web/web/src/types/ModelLimits.ts delete mode 100644 tools/aimux-web/web/src/types/ModelMessage.ts delete mode 100644 tools/aimux-web/web/src/types/ModelModalities.ts delete mode 100644 tools/aimux-web/web/src/types/ModelPrompt.ts delete mode 100644 tools/aimux-web/web/src/types/ModelSpec.ts delete mode 100644 tools/aimux-web/web/src/types/ModelType.ts delete mode 100644 tools/aimux-web/web/src/types/OutcomeRecord.ts delete mode 100644 tools/aimux-web/web/src/types/OutcomeStatus.ts delete mode 100644 tools/aimux-web/web/src/types/PrefixBreak.ts delete mode 100644 tools/aimux-web/web/src/types/PromptTokensDetails.ts delete mode 100644 tools/aimux-web/web/src/types/ProviderAuditSpec.ts delete mode 100644 tools/aimux-web/web/src/types/ProviderFamily.ts delete mode 100644 tools/aimux-web/web/src/types/ProviderName.ts delete mode 100644 tools/aimux-web/web/src/types/ProviderRecord.ts delete mode 100644 tools/aimux-web/web/src/types/ProviderTool.ts delete mode 100644 tools/aimux-web/web/src/types/ReasoningEffort.ts delete mode 100644 tools/aimux-web/web/src/types/ReasoningMode.ts delete mode 100644 tools/aimux-web/web/src/types/ReasoningPart.ts delete mode 100644 tools/aimux-web/web/src/types/ReasoningSpec.ts delete mode 100644 tools/aimux-web/web/src/types/ReasoningVisibility.ts delete mode 100644 tools/aimux-web/web/src/types/Recording.ts delete mode 100644 tools/aimux-web/web/src/types/RequestCacheHints.ts delete mode 100644 tools/aimux-web/web/src/types/RequestInfo.ts delete mode 100644 tools/aimux-web/web/src/types/RerankingCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/RerankingDocuments.ts delete mode 100644 tools/aimux-web/web/src/types/RerankingRank.ts delete mode 100644 tools/aimux-web/web/src/types/RerankingResponse.ts delete mode 100644 tools/aimux-web/web/src/types/RerankingResult.ts delete mode 100644 tools/aimux-web/web/src/types/ResponseFormat.ts delete mode 100644 tools/aimux-web/web/src/types/ResponseInfo.ts delete mode 100644 tools/aimux-web/web/src/types/ResponseMetadata.ts delete mode 100644 tools/aimux-web/web/src/types/ResponseRecord.ts delete mode 100644 tools/aimux-web/web/src/types/Role.ts delete mode 100644 tools/aimux-web/web/src/types/RuntimeModel.ts delete mode 100644 tools/aimux-web/web/src/types/SearchCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/SearchResponse.ts delete mode 100644 tools/aimux-web/web/src/types/SearchResult.ts delete mode 100644 tools/aimux-web/web/src/types/SearchResultItem.ts delete mode 100644 tools/aimux-web/web/src/types/SessionCall.ts delete mode 100644 tools/aimux-web/web/src/types/SessionChainView.ts delete mode 100644 tools/aimux-web/web/src/types/SessionSource.ts delete mode 100644 tools/aimux-web/web/src/types/SessionStepStat.ts delete mode 100644 tools/aimux-web/web/src/types/SessionView.ts delete mode 100644 tools/aimux-web/web/src/types/Size.ts delete mode 100644 tools/aimux-web/web/src/types/SourcePart.ts delete mode 100644 tools/aimux-web/web/src/types/SpeechCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/SpeechRequest.ts delete mode 100644 tools/aimux-web/web/src/types/SpeechResponse.ts delete mode 100644 tools/aimux-web/web/src/types/SpeechResult.ts delete mode 100644 tools/aimux-web/web/src/types/StreamPart.ts delete mode 100644 tools/aimux-web/web/src/types/StreamTextResultAggregated.ts delete mode 100644 tools/aimux-web/web/src/types/TimeoutConfiguration.ts delete mode 100644 tools/aimux-web/web/src/types/TimingRecord.ts delete mode 100644 tools/aimux-web/web/src/types/TokenUsage.ts delete mode 100644 tools/aimux-web/web/src/types/Tool.ts delete mode 100644 tools/aimux-web/web/src/types/ToolCall.ts delete mode 100644 tools/aimux-web/web/src/types/ToolChoice.ts delete mode 100644 tools/aimux-web/web/src/types/ToolResult.ts delete mode 100644 tools/aimux-web/web/src/types/TraceFilter.ts delete mode 100644 tools/aimux-web/web/src/types/TraceRecord.ts delete mode 100644 tools/aimux-web/web/src/types/TraceStats.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionRequest.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionResponse.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionResult.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionSegment.ts delete mode 100644 tools/aimux-web/web/src/types/TranscriptionStreamPart.ts delete mode 100644 tools/aimux-web/web/src/types/UploadFileCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/UploadFileData.ts delete mode 100644 tools/aimux-web/web/src/types/UploadFileResult.ts delete mode 100644 tools/aimux-web/web/src/types/Usage.ts delete mode 100644 tools/aimux-web/web/src/types/UsageSnapshot.ts delete mode 100644 tools/aimux-web/web/src/types/Verdict.ts delete mode 100644 tools/aimux-web/web/src/types/VerdictConfidence.ts delete mode 100644 tools/aimux-web/web/src/types/VerdictKind.ts delete mode 100644 tools/aimux-web/web/src/types/VideoCallOptions.ts delete mode 100644 tools/aimux-web/web/src/types/VideoData.ts delete mode 100644 tools/aimux-web/web/src/types/VideoFile.ts delete mode 100644 tools/aimux-web/web/src/types/VideoFileData.ts delete mode 100644 tools/aimux-web/web/src/types/VideoFrameImage.ts delete mode 100644 tools/aimux-web/web/src/types/VideoFrameType.ts delete mode 100644 tools/aimux-web/web/src/types/VideoResponse.ts delete mode 100644 tools/aimux-web/web/src/types/VideoResult.ts delete mode 100644 tools/aimux-web/web/src/types/Warning.ts delete mode 100644 tools/aimux-web/web/src/types/serde_json/JsonValue.ts diff --git a/tools/aimux-web/README.md b/tools/aimux-web/README.md index 06541c334..cf51bfbed 100644 --- a/tools/aimux-web/README.md +++ b/tools/aimux-web/README.md @@ -126,15 +126,15 @@ tools/aimux-web/ └── web/ Vue 3 + shadcn 风格 + Tailwind + markstream-vue ├── src/agent/engine.ts 前端 agent loop 引擎 ├── src/api/client.ts SSE/端点封装 - └── src/types/ d.ts(core 类型来自 ts-rs,见下) + └── src/types/ aimux-web 专用 Wire 类型 ``` ## 前端类型来源 - **core 类型**(`Recording`/`StreamPart`/`TraceRecord`/`SessionView` 等):ts-rs 从 `aimux-core` 生成到 `bindings/node/src/types/`(`scripts/gen_ts_types.py` 管线), - **拷贝**到 `web/src/types/` 供前端使用。改 core 类型后:跑 `scripts/gen_ts_types.py` - 并同步拷贝。 + 前端通过 `import type` 直接使用该受 CI 漂移检查保护的生成目录。改 core 类型后 + 只需运行 `scripts/gen_ts_types.py`。 - **wire 类型**(`Wire*.ts`):是 aimux-web 的 API 契约,**手动维护**在 `web/src/types/`(不 ts-rs 导出,避免污染 node bindings 的导出目录)。 改 `src/wire.rs` 时同步更新对应的 `web/src/types/Wire*.ts`。 diff --git a/tools/aimux-web/web/src/agent/engine.ts b/tools/aimux-web/web/src/agent/engine.ts index 3065e8d45..f8740c7a1 100644 --- a/tools/aimux-web/web/src/agent/engine.ts +++ b/tools/aimux-web/web/src/agent/engine.ts @@ -8,7 +8,7 @@ import { api, callStream, parseStreamPart } from '../api/client' import type { WireCallRequest } from '../types/WireCallRequest' -import type { StreamPart } from '../types/StreamPart' +import type { StreamPart } from '../../../../../bindings/node/src/types/StreamPart' /** A chat message as sent to the backend (loose typing: the backend wire * schema's `JsonValue` is a recursive union that trips TS2589 inside diff --git a/tools/aimux-web/web/src/api/client.ts b/tools/aimux-web/web/src/api/client.ts index dba199ea3..adf2b65f8 100644 --- a/tools/aimux-web/web/src/api/client.ts +++ b/tools/aimux-web/web/src/api/client.ts @@ -2,10 +2,10 @@ import type { WireCallRequest } from '../types/WireCallRequest' import type { WireCallResponse } from '../types/WireCallResponse' -import type { Recording } from '../types/Recording' -import type { TraceRecord } from '../types/TraceRecord' -import type { SessionView } from '../types/SessionView' -import type { StreamPart } from '../types/StreamPart' +import type { Recording } from '../../../../../bindings/node/src/types/Recording' +import type { TraceRecord } from '../../../../../bindings/node/src/types/TraceRecord' +import type { SessionView } from '../../../../../bindings/node/src/types/SessionView' +import type { StreamPart } from '../../../../../bindings/node/src/types/StreamPart' const API = '/api' diff --git a/tools/aimux-web/web/src/types/AiMuxError.ts b/tools/aimux-web/web/src/types/AiMuxError.ts deleted file mode 100644 index 72b4c339d..000000000 --- a/tools/aimux-web/web/src/types/AiMuxError.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ApiCallError } from "./ApiCallError"; - -/** - * Unified error type for all aimux operations. - * - * Variants are cut by *what the caller does about it*, not by where the - * failure came from. `ApiCall` carries the [`ApiCallError`] detail inline - * (unboxed, like async-openai's `ApiError(ApiError)`); the size guard in - * `error_value_golden_test` keeps the enum under clippy's - * `result_large_err` threshold. - * - * Constructed as a named struct literal everywhere - * (`ApiCallError { status_code: .., ..Default::default() }`), the same - * shape as the AI SDK's named-options constructor. - */ -export type AiMuxError = { "ApiCall": ApiCallError } | { "JsonParse": string } | { "InvalidResponseData": string } | { "NoSuchTool": { tool_name: string, available_tools?: Array | null, -/** - * Original argument text, when supplied by the provider. Absent in - * older serialized errors and errors constructed without a call. - */ -tool_input?: string | null, } } | { "InvalidToolInput": { tool_name: string, tool_input: string, cause: string, } } | { "ToolCallRepair": { original_error: AiMuxError, cause: AiMuxError, } } | { "InvalidArgument": string } | { "InvalidPrompt": string } | { "TokenExpired": string } | { "UnsupportedFunctionality": string } | { "NoSuchModel": { model_id: string, -/** - * What kind of model was requested (`"languageModel"`, - * `"imageModel"`, …), the AI SDK's `modelType`. - */ -model_type: string, } } | { "NoSuchProvider": { provider_id: string, } } | { "Timeout": string } | "Aborted" | { "Other": string }; diff --git a/tools/aimux-web/web/src/types/ApiCallError.ts b/tools/aimux-web/web/src/types/ApiCallError.ts deleted file mode 100644 index dfb248300..000000000 --- a/tools/aimux-web/web/src/types/ApiCallError.ts +++ /dev/null @@ -1,66 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * What a failed API call observed — the field set of the AI SDK's - * `APICallError` (`statusCode` / `responseBody`), which this project's error - * taxonomy mirrors (docs/internal/vercel-research/07-kernel-infrastructure.md). - * - * Carried by [`AiMuxError::ApiCall`] alone. There are no per-status - * variants: a 401, 404 or 429 is an `ApiCall` error whose classification is - * read from `status_code`, exactly as the AI SDK reads - * `APICallError.statusCode`. Transport failures (connection reset, DNS, - * body read) are `ApiCall` errors too — no response arrived, so - * `status_code` is `None` and `is_retryable` is `true`, exactly as the AI - * SDK's `handleFetchError` builds an `APICallError` with no `statusCode` - * and `isRetryable: true`. `message` holds the provider's text **only** — - * the status is a field, never baked into the string; `Display` composes - * the human-readable form from the fields at print time, so nothing - * downstream has to parse it back out. - * - * `APICallError` fields not carried in this round: `url` / - * `requestBodyValues` / `responseHeaders` (the request context is not - * available at the error-construction sites today; all fields are - * `#[serde(default)]`, so adding them later is not a breaking change). - */ -export type ApiCallError = { -/** - * HTTP status of the response, when it came from one - * (`APICallError.statusCode`). Always the *observed* status: the HTTP - * layer fills it for every response-derived error; errors built without - * an HTTP exchange leave it `None`. - */ -status_code: number | null, -/** - * Provider's machine-readable code (OpenAI's `code`/`type`, - * e.g. `"rate_limit_exceeded"` vs `"insufficient_quota"`). Never an HTTP - * status. Our normalized take on `APICallError.data`. - */ -provider_code: string | null, -/** - * The provider's message, verbatim. No status prefix. - */ -message: string, -/** - * The raw response body, verbatim (`APICallError.responseBody`) — the - * lossless evidence when `message`/`provider_code` are extractions. - * `None` when the error did not come from a response body. - */ -response_body: string | null, -/** - * Provider-assigned request id, from the `x-request-id` / `request-id` - * response header when one was sent. Filled by the shared HTTP layer. - */ -request_id: string | null, -/** - * Retry hint in milliseconds, distilled from the `retry-after-ms` / - * `retry-after` response headers on a 429. The classification lives in - * `status_code`; this is the matching action input. - */ -retry_after_ms: number | null, -/** - * Whether retrying can help (`APICallError.isRetryable`) — stored at - * construction, exactly like the AI SDK: the response path computes it - * from the status (408/409/429 or 5xx), and the transport path (no response, so - * no status to compute from) sets it to `true` explicitly. - */ -is_retryable: boolean, }; diff --git a/tools/aimux-web/web/src/types/AspectRatio.ts b/tools/aimux-web/web/src/types/AspectRatio.ts deleted file mode 100644 index c466b9b65..000000000 --- a/tools/aimux-web/web/src/types/AspectRatio.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Aspect ratio in `{width}:{height}` format (e.g. `"16:9"`). - * - * Newtype that enforces the `W:H` format used by V4 image and video - * `aspectRatio` options. Aligned with the TS template-literal type - * `` `${number}:${number}` ``. - */ -export type AspectRatio = { width: number, height: number, }; diff --git a/tools/aimux-web/web/src/types/AudioChunk.ts b/tools/aimux-web/web/src/types/AudioChunk.ts deleted file mode 100644 index 062104028..000000000 --- a/tools/aimux-web/web/src/types/AudioChunk.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A chunk of audio in a streaming transcription request. - */ -export type AudioChunk = { "Binary": Array } | { "Base64": string }; diff --git a/tools/aimux-web/web/src/types/AudioData.ts b/tools/aimux-web/web/src/types/AudioData.ts deleted file mode 100644 index b2ae98665..000000000 --- a/tools/aimux-web/web/src/types/AudioData.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Generated audio: a base64-encoded string or raw binary bytes. - * - * The TS result type is `string | Uint8Array`. Providers should return data - * without unnecessary conversion. - */ -export type AudioData = { "Base64": string } | { "Binary": Array }; diff --git a/tools/aimux-web/web/src/types/AudioInput.ts b/tools/aimux-web/web/src/types/AudioInput.ts deleted file mode 100644 index e513ffda3..000000000 --- a/tools/aimux-web/web/src/types/AudioInput.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Audio input: raw bytes or a base64-encoded string. - */ -export type AudioInput = { "Binary": Array } | { "Base64": string }; diff --git a/tools/aimux-web/web/src/types/BreakKind.ts b/tools/aimux-web/web/src/types/BreakKind.ts deleted file mode 100644 index 43aad850d..000000000 --- a/tools/aimux-web/web/src/types/BreakKind.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type BreakKind = "SystemChanged" | "ToolsChanged" | "ConversationReset" | "Unknown"; diff --git a/tools/aimux-web/web/src/types/CallOptions.ts b/tools/aimux-web/web/src/types/CallOptions.ts deleted file mode 100644 index 5e9056a60..000000000 --- a/tools/aimux-web/web/src/types/CallOptions.ts +++ /dev/null @@ -1,114 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { LanguageModelPromptMessage } from "./LanguageModelPromptMessage"; -import type { ReasoningEffort } from "./ReasoningEffort"; -import type { ResponseFormat } from "./ResponseFormat"; -import type { TimeoutConfiguration } from "./TimeoutConfiguration"; -import type { Tool } from "./Tool"; -import type { ToolChoice } from "./ToolChoice"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to `LanguageModel::do_generate` / `do_stream`. - * - * This is the **provider-facing** options struct. Users interact with - * `GenerateTextOptions` (user-facing) which is converted to `CallOptions` - * by the `generate_text` / `stream_text` functions. - */ -export type CallOptions = { -/** - * The standardized prompt (message array). Required. - */ -prompt: Array, -/** - * Maximum tokens to generate. - */ -max_output_tokens: number | null, -/** - * Sampling temperature. - */ -temperature: number | null, -/** - * Stop sequences. - */ -stop_sequences: Array | null, -/** - * Nucleus sampling `top_p`. - */ -top_p: number | null, -/** - * Top-k sampling. - */ -top_k: number | null, -/** - * Presence penalty. - */ -presence_penalty: number | null, -/** - * Frequency penalty. - */ -frequency_penalty: number | null, -/** - * Response format (text or JSON). - */ -response_format: ResponseFormat | null, -/** - * Seed for reproducibility. - */ -seed: number | null, -/** - * Tools available to the model (function tools and/or provider-defined tools). - */ -tools: Array | null, -/** - * How the model should choose tools. - */ -tool_choice: ToolChoice, -/** - * Extra HTTP headers. - */ -headers: { [key in string]: string } | null, -/** - * Provider-specific options (keyed by provider name). - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Top-level reasoning effort. Maps to OpenAI `reasoning_effort` and - * Anthropic `thinking` config. - */ -reasoning: ReasoningEffort | null, -/** - * Per-call request body overrides. Deep-merged into the provider-built - * request body (after any built-in vendor override) before sending. - * `null` values delete the corresponding key. See RFC-0017. - */ -body_overrides: JsonValue | null, -/** - * Per-call retry count override. `None` uses the provider's configured - * `RetryConfig.max_retries`. `Some(0)` disables retries. - */ -max_retries: number | null, -/** - * Per-call timeout configuration (total / first-chunk / chunk idle). - * `None` = no timeouts (provider defaults still apply at the HTTP layer). - */ -timeout: TimeoutConfiguration | null, -/** - * Session identifier, for grouping consecutive calls into a session - * (observability, see RFC-0024). Explicit values take precedence; when - * `None` and the optional session inferer is enabled, one may be inferred. - * Orthogonal to RFC-0019 session-affinity headers: this field is for - * local grouping, while session headers in `headers` are for upstream - * routing — both may share an id value but travel different paths. - */ -session_id: string | null, -/** - * Emit raw provider stream chunks as `StreamPart::Raw` (debugging aid). - * When `Some(true)`, streaming providers yield one `Raw` part per JSON - * SSE event, carrying the **parsed JSON payload** of the event, emitted - * before the parsed parts. Excludes the `[DONE]` sentinel; unparsable - * chunks emit only `Error`. `null`/`Some(false)` = off. - * Currently honored by the OpenAI-compatible family (openai / azure / - * openai-compatible registry providers); other provider families ignore - * it for now (RFC-0016 M2). - */ -include_raw_chunks: boolean | null, }; diff --git a/tools/aimux-web/web/src/types/CatalogueSource.ts b/tools/aimux-web/web/src/types/CatalogueSource.ts deleted file mode 100644 index 5fa0754bc..000000000 --- a/tools/aimux-web/web/src/types/CatalogueSource.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Where a [`ModelSpec`] came from. - */ -export type CatalogueSource = "Anya2a" | "ModelsDev" | "Manual"; diff --git a/tools/aimux-web/web/src/types/ChatCompletion.ts b/tools/aimux-web/web/src/types/ChatCompletion.ts deleted file mode 100644 index 62b7f7f97..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletion.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionChoice } from "./ChatCompletionChoice"; -import type { ChatCompletionUsage } from "./ChatCompletionUsage"; - -/** - * A complete Chat Completion response (non-streaming). - * - * Mirrors the OpenAI `chat.completion` object. - */ -export type ChatCompletion = { id: string, object: string, created: bigint, model: string, choices: Array, usage: ChatCompletionUsage, system_fingerprint: string | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionChoice.ts b/tools/aimux-web/web/src/types/ChatCompletionChoice.ts deleted file mode 100644 index c9f24fde1..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionChoice.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionMessage } from "./ChatCompletionMessage"; -import type { JsonValue } from "./serde_json/JsonValue"; - -export type ChatCompletionChoice = { index: number, message: ChatCompletionMessage, finish_reason: string | null, logprobs: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionChunk.ts b/tools/aimux-web/web/src/types/ChatCompletionChunk.ts deleted file mode 100644 index 97bd66a31..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionChunk.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionChunkChoice } from "./ChatCompletionChunkChoice"; -import type { ChatCompletionUsage } from "./ChatCompletionUsage"; - -/** - * A single Chat Completion chunk (streaming). - * - * Mirrors the OpenAI `chat.completion.chunk` object. - */ -export type ChatCompletionChunk = { id: string, object: string, created: bigint, model: string, choices: Array, usage: ChatCompletionUsage | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionChunkChoice.ts b/tools/aimux-web/web/src/types/ChatCompletionChunkChoice.ts deleted file mode 100644 index e56df7c79..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionChunkChoice.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionDelta } from "./ChatCompletionDelta"; -import type { JsonValue } from "./serde_json/JsonValue"; - -export type ChatCompletionChunkChoice = { index: number, delta: ChatCompletionDelta, finish_reason: string | null, logprobs: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionChunkFunction.ts b/tools/aimux-web/web/src/types/ChatCompletionChunkFunction.ts deleted file mode 100644 index b42f91a3d..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionChunkFunction.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ChatCompletionChunkFunction = { name: string | null, arguments: string | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionChunkToolCall.ts b/tools/aimux-web/web/src/types/ChatCompletionChunkToolCall.ts deleted file mode 100644 index d54deb19f..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionChunkToolCall.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionChunkFunction } from "./ChatCompletionChunkFunction"; - -export type ChatCompletionChunkToolCall = { index: number, id: string | null, type: string | null, function: ChatCompletionChunkFunction, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionDelta.ts b/tools/aimux-web/web/src/types/ChatCompletionDelta.ts deleted file mode 100644 index b668adba8..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionDelta.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionChunkToolCall } from "./ChatCompletionChunkToolCall"; - -export type ChatCompletionDelta = { role: string | null, content: string | null, reasoning_content: string | null, tool_calls: Array | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionFunction.ts b/tools/aimux-web/web/src/types/ChatCompletionFunction.ts deleted file mode 100644 index 58a9fd050..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionFunction.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ChatCompletionFunction = { name: string, arguments: string, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionMessage.ts b/tools/aimux-web/web/src/types/ChatCompletionMessage.ts deleted file mode 100644 index f9e728dc4..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionMessage.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionToolCall } from "./ChatCompletionToolCall"; -import type { JsonValue } from "./serde_json/JsonValue"; - -export type ChatCompletionMessage = { role: string, content: string | null, reasoning_content: string | null, tool_calls: Array | null, annotations: Array | null, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionToolCall.ts b/tools/aimux-web/web/src/types/ChatCompletionToolCall.ts deleted file mode 100644 index e91f0aab5..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionToolCall.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ChatCompletionFunction } from "./ChatCompletionFunction"; - -export type ChatCompletionToolCall = { id: string, type: string, function: ChatCompletionFunction, }; diff --git a/tools/aimux-web/web/src/types/ChatCompletionUsage.ts b/tools/aimux-web/web/src/types/ChatCompletionUsage.ts deleted file mode 100644 index 3306f7cfd..000000000 --- a/tools/aimux-web/web/src/types/ChatCompletionUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CompletionTokensDetails } from "./CompletionTokensDetails"; -import type { PromptTokensDetails } from "./PromptTokensDetails"; - -export type ChatCompletionUsage = { prompt_tokens: number, completion_tokens: number, total_tokens: number, prompt_tokens_details: PromptTokensDetails | null, completion_tokens_details: CompletionTokensDetails | null, }; diff --git a/tools/aimux-web/web/src/types/CompletionTokensDetails.ts b/tools/aimux-web/web/src/types/CompletionTokensDetails.ts deleted file mode 100644 index 4b25482aa..000000000 --- a/tools/aimux-web/web/src/types/CompletionTokensDetails.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type CompletionTokensDetails = { reasoning_tokens: number | null, }; diff --git a/tools/aimux-web/web/src/types/ContentPart.ts b/tools/aimux-web/web/src/types/ContentPart.ts deleted file mode 100644 index 56108da87..000000000 --- a/tools/aimux-web/web/src/types/ContentPart.ts +++ /dev/null @@ -1,72 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A part of a multi-part message. - * - * Shared between `ModelMessage` (user-facing) and `LanguageModelPrompt` (provider-facing). - */ -export type ContentPart = { "type": "text", text: string, -/** - * Provider-specific options for this part (e.g. `openai.promptCacheBreakpoint`). - */ -provider_options?: JsonValue | null, } | { "type": "image", image: Array, media_type: string, provider_options?: JsonValue | null, } | { "type": "file", data: Array, media_type: string, filename?: string | null, provider_options?: JsonValue | null, } | { "type": "file_base64", data: string, media_type: string, filename?: string | null, provider_options?: JsonValue | null, } | { "type": "file_url", url: string, media_type: string, provider_options?: JsonValue | null, } | { "type": "file_reference", media_type: string, reference: JsonValue, filename?: string | null, provider_options?: JsonValue | null, } | { "type": "reasoning", text: string, signature: string | null, -/** - * Provider-specific options for this part (e.g. - * `anthropic.signature`, `anthropic.redactedData`, - * `anthropic.cacheControl`). - */ -provider_options?: JsonValue | null, } | { "type": "tool_call", tool_call_id: string, tool_name: string, -/** - * Arguments as a JSON value (usually an object). - */ -input: JsonValue, -/** - * Whether the tool call is executed by the provider rather than by - * the client. This is part of the prompt contract because providers - * need it to replay server tool calls on a later turn. - */ -provider_executed?: boolean | null, -/** - * Provider-assigned thought signature (e.g. Google Gemini - * `thoughtSignature`). Must be echoed back verbatim on the follow-up - * turn when the tool result is sent. - */ -thought_signature?: string | null, -/** - * Provider-specific options for this part (e.g. - * `anthropic.cacheControl`). - */ -provider_options?: JsonValue | null, } | { "type": "tool_result", tool_call_id: string, -/** - * The tool's output (usually a JSON value or plain text). - * - * Accepts the legacy `output` field name (used by the Vercel AI SDK - * and the 0.1.0 TypeScript bindings) as an alias during deserialization, - * so multi-part tool messages constructed either way round-trip - * correctly. Serialization always emits `result`. - */ -result: JsonValue, -/** - * The name of the tool that produced this result (optional on the - * user-input side; providers that need it can look it up from the - * preceding tool call). - */ -tool_name?: string | null, -/** - * Whether the result is an error or error message. - */ -is_error?: boolean | null, -/** - * Whether the result is preliminary (replaces prior, e.g. image previews). - */ -preliminary?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Provider-specific options for this part (e.g. - * `anthropic.cacheControl`). - */ -provider_options?: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/EmbeddingCallOptions.ts b/tools/aimux-web/web/src/types/EmbeddingCallOptions.ts deleted file mode 100644 index c78a34769..000000000 --- a/tools/aimux-web/web/src/types/EmbeddingCallOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`EmbeddingModel::do_embed`]. - * - * Aligned with V4 `EmbeddingModelV4CallOptions`. - */ -export type EmbeddingCallOptions = { -/** - * List of text values to generate embeddings for. - */ -values: Array, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/EmbeddingResponse.ts b/tools/aimux-web/web/src/types/EmbeddingResponse.ts deleted file mode 100644 index c758f7b32..000000000 --- a/tools/aimux-web/web/src/types/EmbeddingResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Debugging response info specific to embedding calls. - */ -export type EmbeddingResponse = { -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * The response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/EmbeddingResult.ts b/tools/aimux-web/web/src/types/EmbeddingResult.ts deleted file mode 100644 index 81b741d23..000000000 --- a/tools/aimux-web/web/src/types/EmbeddingResult.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EmbeddingResponse } from "./EmbeddingResponse"; -import type { EmbeddingUsage } from "./EmbeddingUsage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`EmbeddingModel::do_embed`]. - * - * Aligned with V4 `EmbeddingModelV4Result`. - */ -export type EmbeddingResult = { -/** - * Generated embeddings, in the same order as the input `values`. - */ -embeddings: Array>, -/** - * Token usage (input tokens only). - */ -usage: EmbeddingUsage | null, -/** - * Additional provider-specific metadata. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Optional response information for debugging. - */ -response: EmbeddingResponse | null, -/** - * Warnings for the call, e.g. unsupported settings. - */ -warnings: Array, }; diff --git a/tools/aimux-web/web/src/types/EmbeddingUsage.ts b/tools/aimux-web/web/src/types/EmbeddingUsage.ts deleted file mode 100644 index 08a49377b..000000000 --- a/tools/aimux-web/web/src/types/EmbeddingUsage.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Token usage for an embedding call. Embeddings only report input tokens. - */ -export type EmbeddingUsage = { -/** - * Number of input tokens consumed. - */ -tokens: number, }; diff --git a/tools/aimux-web/web/src/types/FileBytes.ts b/tools/aimux-web/web/src/types/FileBytes.ts deleted file mode 100644 index b06229434..000000000 --- a/tools/aimux-web/web/src/types/FileBytes.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Either raw bytes or a base64-encoded string. - * - * Providers should pass file data through without unnecessary conversion: if - * the upstream API returns base64, return [`FileBytes::Base64`]; if it - * returns binary, return [`FileBytes::Binary`]. - */ -export type FileBytes = { "Binary": Array } | { "Base64": string }; diff --git a/tools/aimux-web/web/src/types/FileData.ts b/tools/aimux-web/web/src/types/FileData.ts deleted file mode 100644 index 1fdfc2444..000000000 --- a/tools/aimux-web/web/src/types/FileData.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FileBytes } from "./FileBytes"; - -/** - * File data as a tagged discriminated union. - * - * Aligned with V4 `SharedV4FileData`. - */ -export type FileData = { "Data": { data: FileBytes, } } | { "Url": { url: string, } } | { "Reference": { reference: { [key in string]: string }, } } | { "Text": { text: string, } }; diff --git a/tools/aimux-web/web/src/types/FilePart.ts b/tools/aimux-web/web/src/types/FilePart.ts deleted file mode 100644 index b4676404e..000000000 --- a/tools/aimux-web/web/src/types/FilePart.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FileData } from "./FileData"; - -/** - * A file generated by the model, extracted to the top level (M7). - */ -export type FilePart = { data: FileData, media_type: string, }; diff --git a/tools/aimux-web/web/src/types/Fingerprint.ts b/tools/aimux-web/web/src/types/Fingerprint.ts deleted file mode 100644 index 0849548a0..000000000 --- a/tools/aimux-web/web/src/types/Fingerprint.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Serialized-wire fingerprint stored in a `TraceRecord` (hex strings — - * `u128` is not JSON-serializable). - */ -export type Fingerprint = { -/** - * 128-bit hash of the whole denoised body (hex). - */ -body_hash: string, len_bytes: bigint, block_size: bigint, -/** - * Block-hash chain (hex), one entry per block. - */ -block_hashes: Array, -/** - * Token estimate — byte proxy `len_bytes / 4` when no tokenizer is - * attached (RFC-0015 §4.1: W capped at one block in this mode). - */ -token_estimate: bigint, }; diff --git a/tools/aimux-web/web/src/types/FinishReason.ts b/tools/aimux-web/web/src/types/FinishReason.ts deleted file mode 100644 index 3e557eb11..000000000 --- a/tools/aimux-web/web/src/types/FinishReason.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FinishReasonUnified } from "./FinishReasonUnified"; - -/** - * Unified finish reason (why the model stopped generating). - */ -export type FinishReason = { -/** - * The unified reason. - */ -unified: FinishReasonUnified, -/** - * The raw provider-specific reason string. - */ -raw: string | null, }; diff --git a/tools/aimux-web/web/src/types/FinishReasonUnified.ts b/tools/aimux-web/web/src/types/FinishReasonUnified.ts deleted file mode 100644 index cf09e862d..000000000 --- a/tools/aimux-web/web/src/types/FinishReasonUnified.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Unified finish reason enum (aligned with V4 `LanguageModelV4FinishReason`). - */ -export type FinishReasonUnified = "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other"; diff --git a/tools/aimux-web/web/src/types/FunctionTool.ts b/tools/aimux-web/web/src/types/FunctionTool.ts deleted file mode 100644 index a79887e0c..000000000 --- a/tools/aimux-web/web/src/types/FunctionTool.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A tool definition passed to the model in `CallOptions.tools`. - */ -export type FunctionTool = { -/** - * Unique tool name. - */ -name: string, -/** - * Human-readable description. - */ -description: string | null, -/** - * JSON Schema describing the tool's parameters. - */ -input_schema: JsonValue, -/** - * Whether the tool supports strict schema enforcement (OpenAI strict mode). - */ -strict: boolean | null, -/** - * Provider-specific options, keyed by provider name - * (e.g. `{"anthropic": {"eagerInputStreaming": true}}`). Aligned with the - * V4 `providerOptions` field on function tools. - */ -provider_options?: { [key in string]: JsonValue } | null, -/** - * Example inputs for the tool (V4 `inputExamples`), used by some providers - * to emit `input_examples` in the request body. - */ -input_examples?: Array | null, }; diff --git a/tools/aimux-web/web/src/types/GenerateContent.ts b/tools/aimux-web/web/src/types/GenerateContent.ts deleted file mode 100644 index a64676c52..000000000 --- a/tools/aimux-web/web/src/types/GenerateContent.ts +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FileData } from "./FileData"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A content item in the generation result. - */ -export type GenerateContent = { "Text": { text: string, provider_metadata?: JsonValue | null, } } | { "ToolCall": { tool_call_id: string, tool_name: string, input: JsonValue, -/** - * Whether the tool call will be executed by the provider. - * If false/unset, the tool call is executed by the client. - */ -provider_executed?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Provider-assigned thought signature (e.g. Google Gemini - * `thoughtSignature`). Must be echoed back verbatim on the follow-up - * turn when the tool result is sent. - */ -thought_signature?: string | null, -/** - * Additional provider-specific metadata for the tool call. - */ -provider_metadata?: JsonValue | null, } } | { "Source": { id: string, source_type: string, url: string | null, title: string | null, provider_metadata?: JsonValue | null, } } | { "Reasoning": { text: string, provider_metadata: JsonValue | null, } } | { "File": { data: FileData, media_type: string, provider_metadata?: JsonValue | null, } } | { "ToolResult": { tool_call_id: string, tool_name: string, result: JsonValue, -/** - * Whether the result is an error or error message. - */ -is_error?: boolean | null, -/** - * Whether the result is preliminary (replaces prior, e.g. image previews). - */ -preliminary?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Additional provider-specific metadata for the tool result. - */ -provider_metadata?: JsonValue | null, } }; diff --git a/tools/aimux-web/web/src/types/GenerateObjectResult.ts b/tools/aimux-web/web/src/types/GenerateObjectResult.ts deleted file mode 100644 index 8c46e3e1a..000000000 --- a/tools/aimux-web/web/src/types/GenerateObjectResult.ts +++ /dev/null @@ -1,49 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FinishReason } from "./FinishReason"; -import type { GenerateTextResult } from "./GenerateTextResult"; -import type { ResponseMetadata } from "./ResponseMetadata"; -import type { Usage } from "./Usage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Result of `generate_object` (user-facing, M12). The parsed JSON object plus - * convenience fields from the underlying `generate_text` call. - */ -export type GenerateObjectResult = { -/** - * The parsed JSON object returned by the model. - */ -object: JsonValue, -/** - * Why generation stopped. - */ -finish_reason: FinishReason, -/** - * Raw provider-specific finish reason string. - */ -raw_finish_reason: string | null, -/** - * Token usage. - */ -usage: Usage, -/** - * Warnings from the provider. - */ -warnings: Array, -/** - * Concatenated reasoning text (if the model produced reasoning/thinking). - */ -reasoning: string | null, -/** - * Provider-specific metadata (e.g. Anthropic cache info). - */ -provider_metadata: JsonValue | null, -/** - * Response metadata (id, timestamp, model_id). - */ -response: ResponseMetadata, -/** - * The full `generate_text` result (for advanced use). - */ -raw: GenerateTextResult, }; diff --git a/tools/aimux-web/web/src/types/GenerateResult.ts b/tools/aimux-web/web/src/types/GenerateResult.ts deleted file mode 100644 index 4667bfc23..000000000 --- a/tools/aimux-web/web/src/types/GenerateResult.ts +++ /dev/null @@ -1,44 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FinishReason } from "./FinishReason"; -import type { GenerateContent } from "./GenerateContent"; -import type { ResponseMetadata } from "./ResponseMetadata"; -import type { Usage } from "./Usage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Result of `LanguageModel::do_generate` (non-streaming). - */ -export type GenerateResult = { -/** - * Generated content items (text, tool calls, etc.). - */ -content: Array, -/** - * Why generation stopped. - */ -finish_reason: FinishReason, -/** - * Token usage. - */ -usage: Usage, -/** - * Warnings issued by the provider. - */ -warnings: Array, -/** - * Provider-specific metadata. - */ -provider_metadata: JsonValue | null, -/** - * Response metadata (id, timestamp, model_id). - */ -response: ResponseMetadata, -/** - * The request body that was sent (for debugging). - */ -request_body: JsonValue | null, -/** - * Response headers. - */ -response_headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/GenerateTextOptions.ts b/tools/aimux-web/web/src/types/GenerateTextOptions.ts deleted file mode 100644 index 00b49da24..000000000 --- a/tools/aimux-web/web/src/types/GenerateTextOptions.ts +++ /dev/null @@ -1,46 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ReasoningEffort } from "./ReasoningEffort"; -import type { ResponseFormat } from "./ResponseFormat"; -import type { TimeoutConfiguration } from "./TimeoutConfiguration"; -import type { Tool } from "./Tool"; -import type { ToolChoice } from "./ToolChoice"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * User-facing options for `generate_text` and `stream_text`. - * - * Unlike `CallOptions` (provider-facing), this does not include `prompt` - * (passed separately) and defaults are more ergonomic. - */ -export type GenerateTextOptions = { max_output_tokens: number | null, temperature: number | null, stop_sequences: Array | null, top_p: number | null, top_k: number | null, presence_penalty: number | null, frequency_penalty: number | null, response_format: ResponseFormat | null, seed: number | null, tools: Array | null, tool_choice: ToolChoice | null, headers: { [key in string]: string } | null, provider_options: { [key in string]: JsonValue } | null, -/** - * Top-level reasoning effort. - */ -reasoning: ReasoningEffort | null, -/** - * System instructions prepended to the prompt. - */ -instructions: string | null, -/** - * Per-call request body overrides (deep-merged). See RFC-0017. - */ -body_overrides: JsonValue | null, -/** - * Per-call retry count override. `None` = provider default, `Some(0)` = disable. - */ -max_retries: number | null, -/** - * Per-call timeout configuration (total / first-chunk / chunk idle). - */ -timeout: TimeoutConfiguration | null, -/** - * Session identifier, for grouping consecutive calls into a session - * (observability, see RFC-0024). Orthogonal to RFC-0019 session-affinity - * headers. When `None` and the optional session inferer is enabled, one - * may be inferred from prompt-prefix continuation. - */ -session_id: string | null, -/** - * Emit raw provider stream chunks as `StreamPart::Raw` (debugging aid). - */ -include_raw_chunks: boolean | null, }; diff --git a/tools/aimux-web/web/src/types/GenerateTextResult.ts b/tools/aimux-web/web/src/types/GenerateTextResult.ts deleted file mode 100644 index a677b7004..000000000 --- a/tools/aimux-web/web/src/types/GenerateTextResult.ts +++ /dev/null @@ -1,82 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FilePart } from "./FilePart"; -import type { FinishReason } from "./FinishReason"; -import type { GenerateResult } from "./GenerateResult"; -import type { ModelMessage } from "./ModelMessage"; -import type { ReasoningPart } from "./ReasoningPart"; -import type { ResponseMetadata } from "./ResponseMetadata"; -import type { SourcePart } from "./SourcePart"; -import type { ToolCall } from "./ToolCall"; -import type { Usage } from "./Usage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Result of `generate_text` (user-facing). - */ -export type GenerateTextResult = { -/** - * The generated text (concatenated from all text content parts). - */ -text: string, -/** - * Tool calls requested by the model. - */ -tool_calls: Array, -/** - * Why generation stopped. - */ -finish_reason: FinishReason, -/** - * Token usage. - */ -usage: Usage, -/** - * Warnings from the provider. - */ -warnings: Array, -/** - * Raw provider result (for advanced use). - */ -raw: GenerateResult, -/** - * Reasoning / thinking segments from the model. - */ -reasoning: Array, -/** - * Concatenated reasoning text (convenience for `reasoning.iter().map(text).join("")`). - */ -reasoning_text: string, -/** - * Sources / citations (search-preview models). - */ -sources: Array, -/** - * Files generated by the model. - */ -files: Array, -/** - * Assistant messages ready to append to the prompt for the next turn - * (solves the multi-turn "manually build assistant message" footgun). - */ -response_messages: Array, -/** - * The raw provider-specific finish reason string (e.g. "stop", - * "end_turn", "safety"). Useful when `finish_reason.unified` is `Other`. - */ -raw_finish_reason: string | null, -/** - * Provider-specific metadata (e.g. Anthropic cache info). Mirrored from - * `raw.provider_metadata` for top-level convenience. - */ -provider_metadata: JsonValue | null, -/** - * Response metadata (id, timestamp, model_id). Mirrored from - * `raw.response` for top-level convenience. - */ -response: ResponseMetadata, -/** - * Total token usage across all steps. In single-step mode (aimux's - * default), `total_usage` equals `usage`. Provided for AI SDK parity. - */ -total_usage: Usage, }; diff --git a/tools/aimux-web/web/src/types/HttpExchange.ts b/tools/aimux-web/web/src/types/HttpExchange.ts deleted file mode 100644 index 2d87f56c0..000000000 --- a/tools/aimux-web/web/src/types/HttpExchange.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HttpRecord } from "./HttpRecord"; -import type { ResponseRecord } from "./ResponseRecord"; -import type { TimingRecord } from "./TimingRecord"; - -/** - * ③ HTTP 侧:单次 attempt 的 wire 交换。 - */ -export type HttpExchange = { -/** - * 第几次重试(0=首次);per-attempt 递增。 - */ -attempt: number, request: HttpRecord, -/** - * None = 请求失败未获响应。 - */ -response: ResponseRecord | null, timing: TimingRecord, error: string | null, -/** - * 流式:该 exchange 是否已终结(收到 response 补全)。非流式恒 true。 - */ -finalized: boolean, }; diff --git a/tools/aimux-web/web/src/types/HttpRecord.ts b/tools/aimux-web/web/src/types/HttpRecord.ts deleted file mode 100644 index 71c348207..000000000 --- a/tools/aimux-web/web/src/types/HttpRecord.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type HttpRecord = { method: string, url: string, -/** - * 敏感头(authorization/cookie/含 api-key/key/x-amz-security-token 等)已脱敏为 "[REDACTED]"。 - */ -headers: Array<[string, string]>, -/** - * 明文(脱敏后);None = 无 body。 - */ -body: string | null, }; diff --git a/tools/aimux-web/web/src/types/ImageCallOptions.ts b/tools/aimux-web/web/src/types/ImageCallOptions.ts deleted file mode 100644 index d32de9957..000000000 --- a/tools/aimux-web/web/src/types/ImageCallOptions.ts +++ /dev/null @@ -1,51 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AspectRatio } from "./AspectRatio"; -import type { ImageFile } from "./ImageFile"; -import type { Size } from "./Size"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`ImageModel::do_generate`]. - * - * Aligned with V4 `ImageModelV4CallOptions`. - */ -export type ImageCallOptions = { -/** - * Prompt for the image generation. `None` for operations (e.g. upscaling) - * that do not require a prompt. - */ -prompt: string | null, -/** - * Number of images to generate. - */ -n: number, -/** - * Size of the images, in `{width}x{height}` format. - * `None` uses the provider's default size. - */ -size: Size | null, -/** - * Aspect ratio of the images, in `{width}:{height}` format. - * `None` uses the provider's default aspect ratio. - */ -aspect_ratio: AspectRatio | null, -/** - * Seed for deterministic generation. `None` uses the provider's default. - */ -seed: number | null, -/** - * Images for image editing or variation generation. - */ -files: Array | null, -/** - * Mask image for inpainting operations. - */ -mask: ImageFile | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue }, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/ImageFile.ts b/tools/aimux-web/web/src/types/ImageFile.ts deleted file mode 100644 index 545e7cef5..000000000 --- a/tools/aimux-web/web/src/types/ImageFile.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ImageFileData } from "./ImageFileData"; - -/** - * An image file used for image editing or variation generation. - * - * Aligned with V4 `ImageModelV4File`. - */ -export type ImageFile = { "File": { -/** - * IANA media type, e.g. `"image/png"`. - */ -media_type: string, -/** - * File data as base64 string or binary bytes. - */ -data: ImageFileData, } } | { "Url": { -/** - * The URL of the image file. - */ -url: string, } }; diff --git a/tools/aimux-web/web/src/types/ImageFileData.ts b/tools/aimux-web/web/src/types/ImageFileData.ts deleted file mode 100644 index 96be9636f..000000000 --- a/tools/aimux-web/web/src/types/ImageFileData.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * File payload for an [`ImageFile::File`]: base64 string or raw bytes. - */ -export type ImageFileData = { "Base64": string } | { "Binary": Array }; diff --git a/tools/aimux-web/web/src/types/ImageOutputs.ts b/tools/aimux-web/web/src/types/ImageOutputs.ts deleted file mode 100644 index 38be2705b..000000000 --- a/tools/aimux-web/web/src/types/ImageOutputs.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * The generated images, returned as a homogeneous collection. - * - * The TS result type is `Array | Array` — i.e. either all - * base64 strings or all binary blobs, never mixed. This enum models that - * union. Providers should return data without unnecessary conversion: if the - * upstream API returns base64, return [`ImageOutputs::Base64`]; if binary, - * return [`ImageOutputs::Binary`]. - */ -export type ImageOutputs = { "Base64": Array } | { "Binary": Array> }; diff --git a/tools/aimux-web/web/src/types/ImageResponse.ts b/tools/aimux-web/web/src/types/ImageResponse.ts deleted file mode 100644 index 0f5f33dd0..000000000 --- a/tools/aimux-web/web/src/types/ImageResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Response information for an image generation call. - */ -export type ImageResponse = { -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/ImageResult.ts b/tools/aimux-web/web/src/types/ImageResult.ts deleted file mode 100644 index fbf5cbdec..000000000 --- a/tools/aimux-web/web/src/types/ImageResult.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ImageOutputs } from "./ImageOutputs"; -import type { ImageResponse } from "./ImageResponse"; -import type { ImageUsage } from "./ImageUsage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`ImageModel::do_generate`]. - * - * Aligned with V4 `ImageModelV4Result`. - */ -export type ImageResult = { -/** - * Generated images (base64 strings or binary data). - */ -images: ImageOutputs, -/** - * Warnings for the call, e.g. unsupported features. - */ -warnings: Array, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Response information for telemetry and debugging. - */ -response: ImageResponse, -/** - * Optional token usage for the call (if the provider reports it). - */ -usage: ImageUsage | null, }; diff --git a/tools/aimux-web/web/src/types/ImageUsage.ts b/tools/aimux-web/web/src/types/ImageUsage.ts deleted file mode 100644 index 86fb55df9..000000000 --- a/tools/aimux-web/web/src/types/ImageUsage.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Token usage for an image generation call (if the provider reports it). - * - * Aligned with V4 `ImageModelV4Usage`. - */ -export type ImageUsage = { -/** - * Number of input (prompt) tokens used. - */ -input_tokens: number | null, -/** - * Number of output tokens used, if reported. - */ -output_tokens: number | null, -/** - * Total tokens as reported by the provider. - */ -total_tokens: number | null, }; diff --git a/tools/aimux-web/web/src/types/InputAudioFormat.ts b/tools/aimux-web/web/src/types/InputAudioFormat.ts deleted file mode 100644 index c45946104..000000000 --- a/tools/aimux-web/web/src/types/InputAudioFormat.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * The input audio format for a streaming transcription request. - */ -export type InputAudioFormat = { -/** - * Audio format type, e.g. `"audio/pcm"`, `"audio/pcmu"`, `"audio/pcma"`. - */ -format_type: string, -/** - * Sample rate in Hz. Only applicable for formats that require a rate. - */ -rate: number | null, }; diff --git a/tools/aimux-web/web/src/types/InputRecord.ts b/tools/aimux-web/web/src/types/InputRecord.ts deleted file mode 100644 index fb203c0ba..000000000 --- a/tools/aimux-web/web/src/types/InputRecord.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { LanguageModelPromptMessage } from "./LanguageModelPromptMessage"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * ① 输入侧:完整调用参数,足以重建 generate_text 调用。 - */ -export type InputRecord = { -/** - * 完整 prompt(消息数组,含 ContentPart::Image 等多模态)。 - */ -prompt: Array, -/** - * 序列化的 CallOptions(abort_signal/call_id 已 serde skip); - * headers/provider_options/body_overrides 已递归脱敏。 - */ -options: JsonValue, }; diff --git a/tools/aimux-web/web/src/types/LanguageModelPromptMessage.ts b/tools/aimux-web/web/src/types/LanguageModelPromptMessage.ts deleted file mode 100644 index b2e3efa50..000000000 --- a/tools/aimux-web/web/src/types/LanguageModelPromptMessage.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ContentPart } from "./ContentPart"; -import type { Role } from "./Role"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A single provider-facing message. - * - * Unlike `ModelMessage` (which can have string content), this always has - * `content: Vec` — strings are normalized to `ContentPart::Text`. - */ -export type LanguageModelPromptMessage = { role: Role, content: Array, -/** - * Message-level provider-specific options (e.g. - * `anthropic.cacheControl`), applied to the last part of the message when - * converting to a provider prompt. Mirrors the Vercel AI SDK - * `LanguageModelV4Message.providerOptions`. - */ -provider_options: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/MessageContent.ts b/tools/aimux-web/web/src/types/MessageContent.ts deleted file mode 100644 index 93a4c9512..000000000 --- a/tools/aimux-web/web/src/types/MessageContent.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ContentPart } from "./ContentPart"; - -/** - * Message body: either a simple string or multi-part content. - */ -export type MessageContent = string | Array; diff --git a/tools/aimux-web/web/src/types/Modality.ts b/tools/aimux-web/web/src/types/Modality.ts deleted file mode 100644 index babed00ac..000000000 --- a/tools/aimux-web/web/src/types/Modality.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A single input or output modality. - */ -export type Modality = "Text" | "Image" | "Audio" | "Video" | "Pdf" | "Embedding" | "Score" | "Other"; diff --git a/tools/aimux-web/web/src/types/ModelCapabilities.ts b/tools/aimux-web/web/src/types/ModelCapabilities.ts deleted file mode 100644 index e38d3622b..000000000 --- a/tools/aimux-web/web/src/types/ModelCapabilities.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Model-level capability flags (more precise than provider-level `supports_*`). - */ -export type ModelCapabilities = { -/** - * Supports function/tool calling. - */ -tool_call: boolean, -/** - * Supports structured / JSON-schema output. - */ -structured_output: boolean, -/** - * Accepts a `temperature` parameter. - */ -temperature: boolean, -/** - * Accepts multimodal attachments (image/audio/pdf input). - */ -attachment: boolean, }; diff --git a/tools/aimux-web/web/src/types/ModelCost.ts b/tools/aimux-web/web/src/types/ModelCost.ts deleted file mode 100644 index 39e510c55..000000000 --- a/tools/aimux-web/web/src/types/ModelCost.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Pricing (advisory, read-only metadata). Units follow the source catalog - * (anya2a uses USD per 1M tokens). - */ -export type ModelCost = { input?: number | null, output?: number | null, cache_read?: number | null, cache_write?: number | null, }; diff --git a/tools/aimux-web/web/src/types/ModelId.ts b/tools/aimux-web/web/src/types/ModelId.ts deleted file mode 100644 index 3456afef4..000000000 --- a/tools/aimux-web/web/src/types/ModelId.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A model identifier in `"provider/model-name"` format, e.g. `"openai/gpt-4o"`. - */ -export type ModelId = { provider: string, model: string, }; diff --git a/tools/aimux-web/web/src/types/ModelLimits.ts b/tools/aimux-web/web/src/types/ModelLimits.ts deleted file mode 100644 index 8835a50e6..000000000 --- a/tools/aimux-web/web/src/types/ModelLimits.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Token / request limits for a model. - */ -export type ModelLimits = { -/** - * Maximum total context window (input + output), in tokens. - */ -context?: number | null, -/** - * Maximum output tokens. - */ -output?: number | null, -/** - * Maximum input tokens (when distinct from `context`). - */ -input?: number | null, }; diff --git a/tools/aimux-web/web/src/types/ModelMessage.ts b/tools/aimux-web/web/src/types/ModelMessage.ts deleted file mode 100644 index e971ba523..000000000 --- a/tools/aimux-web/web/src/types/ModelMessage.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { MessageContent } from "./MessageContent"; -import type { Role } from "./Role"; - -/** - * A single user-facing chat message. - */ -export type ModelMessage = { role: Role, content: MessageContent, }; diff --git a/tools/aimux-web/web/src/types/ModelModalities.ts b/tools/aimux-web/web/src/types/ModelModalities.ts deleted file mode 100644 index 6196f1f1d..000000000 --- a/tools/aimux-web/web/src/types/ModelModalities.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Modality } from "./Modality"; - -/** - * Input/output modality sets. - */ -export type ModelModalities = { input?: Array, output?: Array, }; diff --git a/tools/aimux-web/web/src/types/ModelPrompt.ts b/tools/aimux-web/web/src/types/ModelPrompt.ts deleted file mode 100644 index 1b7668d01..000000000 --- a/tools/aimux-web/web/src/types/ModelPrompt.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ModelMessage } from "./ModelMessage"; - -/** - * What the user passes as `prompt` to `generate_text` / `stream_text`. - * - * Can be a simple string (converted to a single user message) or a list of messages. - */ -export type ModelPrompt = string | Array; diff --git a/tools/aimux-web/web/src/types/ModelSpec.ts b/tools/aimux-web/web/src/types/ModelSpec.ts deleted file mode 100644 index 58eb9bd31..000000000 --- a/tools/aimux-web/web/src/types/ModelSpec.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CatalogueSource } from "./CatalogueSource"; -import type { ModelCapabilities } from "./ModelCapabilities"; -import type { ModelCost } from "./ModelCost"; -import type { ModelLimits } from "./ModelLimits"; -import type { ModelModalities } from "./ModelModalities"; -import type { ModelType } from "./ModelType"; -import type { ReasoningSpec } from "./ReasoningSpec"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The full static portrait for a model, supplemented from community knowledge. - * - * All fields are advisory — aimux never auto-applies them in the request path. - * The caller reads them to decide how to configure `GenerateTextOptions` / - * `bodyOverrides`. - */ -export type ModelSpec = { display_name?: string | null, type: ModelType, limits: ModelLimits, modalities: ModelModalities, capabilities: ModelCapabilities, reasoning?: ReasoningSpec | null, cost?: ModelCost | null, source: CatalogueSource, -/** - * Provider name (normalized to aimux registry spelling). - */ -provider?: string | null, -/** - * Verbatim source entry, preserved for forward compatibility / debugging. - */ -raw?: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/ModelType.ts b/tools/aimux-web/web/src/types/ModelType.ts deleted file mode 100644 index 00c3284ae..000000000 --- a/tools/aimux-web/web/src/types/ModelType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Coarse model category, used to route to the right modality surface. - */ -export type ModelType = "Chat" | "Completion" | "Embedding" | "Rerank" | "ImageGen" | "ImageEdit" | "Video" | "Audio" | "Other"; diff --git a/tools/aimux-web/web/src/types/OutcomeRecord.ts b/tools/aimux-web/web/src/types/OutcomeRecord.ts deleted file mode 100644 index f76f2ac96..000000000 --- a/tools/aimux-web/web/src/types/OutcomeRecord.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { OutcomeStatus } from "./OutcomeStatus"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * 最终结果摘要。 - */ -export type OutcomeRecord = { status: OutcomeStatus, finish_reason: string | null, error: string | null, -/** - * 序列化的 Usage。 - */ -usage: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/OutcomeStatus.ts b/tools/aimux-web/web/src/types/OutcomeStatus.ts deleted file mode 100644 index ea12e44c2..000000000 --- a/tools/aimux-web/web/src/types/OutcomeStatus.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * 调用终结状态。 - */ -export type OutcomeStatus = "pending" | "success" | "error" | "incomplete" | "cancelled"; diff --git a/tools/aimux-web/web/src/types/PrefixBreak.ts b/tools/aimux-web/web/src/types/PrefixBreak.ts deleted file mode 100644 index 78aa70bdb..000000000 --- a/tools/aimux-web/web/src/types/PrefixBreak.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BreakKind } from "./BreakKind"; - -/** - * A prefix break between two consecutive records of a session. - */ -export type PrefixBreak = { at_record_id: string, prev_record_id: string, lcp_bytes: bigint, expected_break: boolean, kind: BreakKind, }; diff --git a/tools/aimux-web/web/src/types/PromptTokensDetails.ts b/tools/aimux-web/web/src/types/PromptTokensDetails.ts deleted file mode 100644 index 1f93cdbc4..000000000 --- a/tools/aimux-web/web/src/types/PromptTokensDetails.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type PromptTokensDetails = { cached_tokens: number, cache_write_tokens: number | null, }; diff --git a/tools/aimux-web/web/src/types/ProviderAuditSpec.ts b/tools/aimux-web/web/src/types/ProviderAuditSpec.ts deleted file mode 100644 index 6f60f4e92..000000000 --- a/tools/aimux-web/web/src/types/ProviderAuditSpec.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ProviderFamily } from "./ProviderFamily"; - -/** - * Provider audit parameters (RFC-0015 §7 matrix — the part that lives in - * core; display logic belongs to the CLI). - */ -export type ProviderAuditSpec = { -/** - * Provider family for family-specific invariants. - */ -family: ProviderFamily, -/** - * Token quantization granularity; `None` = no quantization. - */ -gran: bigint | null, -/** - * Minimum cache threshold (tokens): below it `claimed` must be 0. - */ -threshold: bigint, -/** - * TTL_idle (ms), conservative upper bound. - */ -ttl_ms: bigint, -/** - * gpt-5.6+ semantics (no quantization, implicit-breakpoint whitelist, - * write/read equality). - */ -model56plus: boolean, -/** - * Claimed-hit ceiling: above this multiple of the client upper bound - * the verdict is overclaim (W) even in shared mode. `None` = use U+τ. - */ -shared_ceiling_mult: number | null, }; diff --git a/tools/aimux-web/web/src/types/ProviderFamily.ts b/tools/aimux-web/web/src/types/ProviderFamily.ts deleted file mode 100644 index 8f0a8815d..000000000 --- a/tools/aimux-web/web/src/types/ProviderFamily.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Provider family (only families with distinct invariants need dispatch; - * gran/threshold/ttl live in `ProviderAuditSpec`). - */ -export type ProviderFamily = "OpenAi" | "DeepSeek" | "Anthropic" | "Bedrock" | "Gemini" | "Vllm" | "Generic"; 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] diff --git a/tools/aimux-web/web/src/types/ProviderRecord.ts b/tools/aimux-web/web/src/types/ProviderRecord.ts deleted file mode 100644 index 4af13e674..000000000 --- a/tools/aimux-web/web/src/types/ProviderRecord.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * ② 配置侧:provider 身份(请求回放重建用)。 - */ -export type ProviderRecord = { -/** - * `model.provider()`,如 "openai"。 - */ -provider: string, -/** - * `model.model_id()`,如 "gpt-4o"。 - */ -model_id: string, -/** - * provider 的 base_url。 - */ -base_url: string | null, -/** - * api_key 来源(不存明文):"env:OPENAI_API_KEY" / "explicit" / "none" / "unknown"。 - */ -api_key_source: string, -/** - * OpenAICompatProfile(能力差异)。 - */ -profile: JsonValue | null, -/** - * ProviderOptions(headers/org/project/...;已脱敏)。 - */ -provider_options: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/ProviderTool.ts b/tools/aimux-web/web/src/types/ProviderTool.ts deleted file mode 100644 index c7770fef8..000000000 --- a/tools/aimux-web/web/src/types/ProviderTool.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A provider-defined tool (e.g. `anthropic.web_search_20250305`, - * `google.googleSearch`). Mirrors the V4 `LanguageModelV4ProviderTool`. - * - * Provider tools are specific to a certain provider. The input and output - * schemas are defined by the provider, and some are executed on the provider's - * servers (e.g. web search, code execution). - */ -export type ProviderTool = { -/** - * The ID of the tool, following the format `.`. - */ -id: string, -/** - * The name of the tool, unique within this model call. - */ -name: string, -/** - * The arguments for configuring the tool. Must match the expected - * arguments defined by the provider for this tool. - */ -args: JsonValue, }; diff --git a/tools/aimux-web/web/src/types/ReasoningEffort.ts b/tools/aimux-web/web/src/types/ReasoningEffort.ts deleted file mode 100644 index b1beb7b01..000000000 --- a/tools/aimux-web/web/src/types/ReasoningEffort.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Reasoning effort level (aligned with V4 `reasoning` option). - * - * Controls how much reasoning/thinking the model performs. Maps to - * OpenAI `reasoning_effort` and Anthropic `thinking` config. - */ -export type ReasoningEffort = "provider-default" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh"; diff --git a/tools/aimux-web/web/src/types/ReasoningMode.ts b/tools/aimux-web/web/src/types/ReasoningMode.ts deleted file mode 100644 index b694e49cb..000000000 --- a/tools/aimux-web/web/src/types/ReasoningMode.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * How reasoning / thinking is controlled for a model. - */ -export type ReasoningMode = "Budget" | "Effort" | "Level" | "Fixed" | "Mixed" | "Toggle" | "Other"; diff --git a/tools/aimux-web/web/src/types/ReasoningPart.ts b/tools/aimux-web/web/src/types/ReasoningPart.ts deleted file mode 100644 index 83feed56b..000000000 --- a/tools/aimux-web/web/src/types/ReasoningPart.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A reasoning / thinking segment, extracted to the top level (M7). - */ -export type ReasoningPart = { -/** - * The reasoning text. - */ -text: string, }; diff --git a/tools/aimux-web/web/src/types/ReasoningSpec.ts b/tools/aimux-web/web/src/types/ReasoningSpec.ts deleted file mode 100644 index 2ce4266a0..000000000 --- a/tools/aimux-web/web/src/types/ReasoningSpec.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ReasoningMode } from "./ReasoningMode"; -import type { ReasoningVisibility } from "./ReasoningVisibility"; - -/** - * Reasoning / thinking portrait for a model (advisory). - */ -export type ReasoningSpec = { -/** - * Whether the model family supports reasoning at all. - */ -supported: boolean, -/** - * Whether reasoning should be on by default. - */ -default_enabled: boolean, -/** - * Primary control mode. - */ -mode: ReasoningMode | null, -/** - * Default effort level (when `mode` is Effort/Mixed). - */ -effort_default?: string | null, -/** - * Supported effort levels. - */ -effort_options?: Array, -/** - * Minimum token budget (when `mode` is Budget/Mixed). - */ -budget_min?: number | null, -/** - * Interleaved reasoning (thinking blocks between tool calls). - */ -interleaved: boolean, -/** - * Output visibility. - */ -visibility: ReasoningVisibility | null, }; diff --git a/tools/aimux-web/web/src/types/ReasoningVisibility.ts b/tools/aimux-web/web/src/types/ReasoningVisibility.ts deleted file mode 100644 index 9738c8a80..000000000 --- a/tools/aimux-web/web/src/types/ReasoningVisibility.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Visibility of reasoning output to the caller. - */ -export type ReasoningVisibility = "Hidden" | "Summary" | "Full" | "Mixed" | "Omitted" | "Other"; diff --git a/tools/aimux-web/web/src/types/Recording.ts b/tools/aimux-web/web/src/types/Recording.ts deleted file mode 100644 index 3bd5bc35c..000000000 --- a/tools/aimux-web/web/src/types/Recording.ts +++ /dev/null @@ -1,57 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HttpExchange } from "./HttpExchange"; -import type { InputRecord } from "./InputRecord"; -import type { OutcomeRecord } from "./OutcomeRecord"; -import type { ProviderRecord } from "./ProviderRecord"; - -/** - * 一次完整调用的录制记录(三层 + call_id 关联)。 - */ -export type Recording = { -/** - * 格式版本。 - */ -schema: number, -/** - * 暴露逻辑调用 ID,关联三层。 - */ -call_id: string, -/** - * ISO 8601 时间戳。 - */ -recorded_at: string, -/** - * ① 输入侧:调用参数(prompt + options)。 - */ -input: InputRecord, -/** - * ② 配置侧:provider 身份与配置。 - */ -provider: ProviderRecord, -/** - * ③ HTTP 侧:实际 wire 交换(per-attempt 一条)。 - */ -exchanges: Array, -/** - * 最终结果摘要(状态 + finish_reason + usage)。 - */ -outcome: OutcomeRecord, -/** - * wire 是否完整(流式 body 未补全时为 false;由 writer 标记)。 - */ -complete: boolean, -/** - * 传输层封闭信号:层 B 声明"不再有 exchange"(P1:层 A 收尾自动发; - * P2:由层 B 发送)。false = 仍可能来 exchange(记录暂不可定稿)。 - */ -transport_closed: boolean, -/** - * 会话归组(RFC-0024 P3):所在会话 id。None = 未归组(无 session_id 且 - * 推断关闭)。由 `Recorder::record_session` 填充,写入 InputRecord 之前 - * 或之后均可(writer 端按 call_id 合并)。 - */ -session_id?: string | null, -/** - * 会话内步号(0 起,由 SessionStore 分配)。与 `session_id` 同生命周期。 - */ -step?: number | null, }; diff --git a/tools/aimux-web/web/src/types/RequestCacheHints.ts b/tools/aimux-web/web/src/types/RequestCacheHints.ts deleted file mode 100644 index 9e3ff369d..000000000 --- a/tools/aimux-web/web/src/types/RequestCacheHints.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Request-side cache hints (best-effort, e.g. Anthropic `cache_control`). - */ -export type RequestCacheHints = { -/** - * Whether any message requested `cache_control` (write) this call. - */ -requested_write: boolean, }; diff --git a/tools/aimux-web/web/src/types/RequestInfo.ts b/tools/aimux-web/web/src/types/RequestInfo.ts deleted file mode 100644 index 098d3be65..000000000 --- a/tools/aimux-web/web/src/types/RequestInfo.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Optional request information for telemetry and debugging. - * - * Aligned with the `request?` object that appears on some V4 model results. - */ -export type RequestInfo = { -/** - * The request body that was sent (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/RerankingCallOptions.ts b/tools/aimux-web/web/src/types/RerankingCallOptions.ts deleted file mode 100644 index 3de78c9a5..000000000 --- a/tools/aimux-web/web/src/types/RerankingCallOptions.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { RerankingDocuments } from "./RerankingDocuments"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`RerankingModel::do_rerank`]. - * - * Aligned with V4 `RerankingModelV4CallOptions`. - */ -export type RerankingCallOptions = { -/** - * Documents to rerank. - */ -documents: RerankingDocuments, -/** - * The query to rerank the documents against. - */ -query: string, -/** - * Optional limit: return only the top `n` documents. - */ -top_n: number | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/RerankingDocuments.ts b/tools/aimux-web/web/src/types/RerankingDocuments.ts deleted file mode 100644 index 2fd5f51f2..000000000 --- a/tools/aimux-web/web/src/types/RerankingDocuments.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Documents to rerank: either a list of texts or a list of JSON objects. - * - * Aligned with V4 `RerankingModelV4CallOptions.documents`. - */ -export type RerankingDocuments = { "Text": { values: Array, } } | { "Object": { values: Array, } }; diff --git a/tools/aimux-web/web/src/types/RerankingRank.ts b/tools/aimux-web/web/src/types/RerankingRank.ts deleted file mode 100644 index 986d3b2e0..000000000 --- a/tools/aimux-web/web/src/types/RerankingRank.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A single reranked entry: the original index and its relevance score. - */ -export type RerankingRank = { -/** - * The index of the document in the original list (before reranking). - */ -index: number, -/** - * The relevance score of the document after reranking. - */ -relevance_score: number, }; diff --git a/tools/aimux-web/web/src/types/RerankingResponse.ts b/tools/aimux-web/web/src/types/RerankingResponse.ts deleted file mode 100644 index 83a869529..000000000 --- a/tools/aimux-web/web/src/types/RerankingResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Optional response information for a reranking call. - */ -export type RerankingResponse = { -/** - * ID for the generated response, if the provider sends one. - */ -id: string | null, -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * Response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/RerankingResult.ts b/tools/aimux-web/web/src/types/RerankingResult.ts deleted file mode 100644 index d72face95..000000000 --- a/tools/aimux-web/web/src/types/RerankingResult.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { RerankingRank } from "./RerankingRank"; -import type { RerankingResponse } from "./RerankingResponse"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`RerankingModel::do_rerank`]. - * - * Aligned with V4 `RerankingModelV4Result`. - */ -export type RerankingResult = { -/** - * Ordered list of reranked documents, sorted by descending relevance - * score. Each entry's `index` refers to the position in the original - * `documents` list. - */ -ranking: Array, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Warnings for the call, e.g. unsupported settings. - */ -warnings: Array | null, -/** - * Optional response information for debugging. - */ -response: RerankingResponse | null, }; diff --git a/tools/aimux-web/web/src/types/ResponseFormat.ts b/tools/aimux-web/web/src/types/ResponseFormat.ts deleted file mode 100644 index 88f2405e1..000000000 --- a/tools/aimux-web/web/src/types/ResponseFormat.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * How the model should format its response. - */ -export type ResponseFormat = "Text" | { "Json": { schema: JsonValue | null, name: string | null, description: string | null, } }; diff --git a/tools/aimux-web/web/src/types/ResponseInfo.ts b/tools/aimux-web/web/src/types/ResponseInfo.ts deleted file mode 100644 index 44514337c..000000000 --- a/tools/aimux-web/web/src/types/ResponseInfo.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Response information for telemetry and debugging. - * - * Aligned with the `response` object that appears on most V4 model results. - * All fields are optional because different providers populate different - * subsets; traits whose TS spec marks `response` as required use - * `ResponseInfo` directly, while those that mark it optional use - * `Option`. - */ -export type ResponseInfo = { -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * The response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/ResponseMetadata.ts b/tools/aimux-web/web/src/types/ResponseMetadata.ts deleted file mode 100644 index 4c2084e8c..000000000 --- a/tools/aimux-web/web/src/types/ResponseMetadata.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Metadata about the API response. - */ -export type ResponseMetadata = { id: string | null, timestamp: string | null, model_id: string | null, }; diff --git a/tools/aimux-web/web/src/types/ResponseRecord.ts b/tools/aimux-web/web/src/types/ResponseRecord.ts deleted file mode 100644 index 28abf8d33..000000000 --- a/tools/aimux-web/web/src/types/ResponseRecord.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ResponseRecord = { status: number, headers: Array<[string, string]>, -/** - * 非流式:完整 JSON;流式:原始 SSE 拼接文本(上限截断)。 - */ -body: string | null, stream_chunks: number | null, -/** - * 首字节延迟(流式)。 - */ -ttfb_ms?: number | null, }; diff --git a/tools/aimux-web/web/src/types/Role.ts b/tools/aimux-web/web/src/types/Role.ts deleted file mode 100644 index c118faae1..000000000 --- a/tools/aimux-web/web/src/types/Role.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Who sent the message. - */ -export type Role = "system" | "user" | "assistant" | "tool"; diff --git a/tools/aimux-web/web/src/types/RuntimeModel.ts b/tools/aimux-web/web/src/types/RuntimeModel.ts deleted file mode 100644 index f12ea8802..000000000 --- a/tools/aimux-web/web/src/types/RuntimeModel.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A model entry returned by a provider's `/models` endpoint (the sparse, - * account-level truth of "what this key can call"). - * - * Carries only what the provider returns — typically just `id`. Configuration - * comes from [`ModelSpec`] (community knowledge); the host merges the two as - * needed (RFC-0027). aimux itself does not combine them. - */ -export type RuntimeModel = { -/** - * Model identifier, e.g. `"gpt-4o"`. - */ -id: string, -/** - * `owned_by` field from OpenAI-compatible `/models` responses. - */ -owned_by?: string | null, -/** - * `created` unix timestamp from OpenAI-compatible `/models` responses. - */ -created?: number | null, }; diff --git a/tools/aimux-web/web/src/types/SearchCallOptions.ts b/tools/aimux-web/web/src/types/SearchCallOptions.ts deleted file mode 100644 index e11420fef..000000000 --- a/tools/aimux-web/web/src/types/SearchCallOptions.ts +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`SearchModel::do_search`]. - */ -export type SearchCallOptions = { -/** - * The search query string. - */ -query: string, -/** - * Maximum number of results to return. - */ -max_results: number | null, -/** - * Whether to include raw page content in results. - * - * Provider support varies; providers that cannot honor this should - * issue a warning rather than erroring. - */ -include_raw_content: boolean | null, -/** - * Optional time range filter (e.g. `"day"`, `"week"`, `"month"`, - * `"year"`). Provider support varies. - */ -time_range: string | null, -/** - * Optional list of domains to include in results. - */ -include_domains: Array | null, -/** - * Optional list of domains to exclude from results. - */ -exclude_domains: Array | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/SearchResponse.ts b/tools/aimux-web/web/src/types/SearchResponse.ts deleted file mode 100644 index 287e4d97b..000000000 --- a/tools/aimux-web/web/src/types/SearchResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Optional response information for a search call. - */ -export type SearchResponse = { -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * The response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/SearchResult.ts b/tools/aimux-web/web/src/types/SearchResult.ts deleted file mode 100644 index d1e49ac60..000000000 --- a/tools/aimux-web/web/src/types/SearchResult.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { SearchResponse } from "./SearchResponse"; -import type { SearchResultItem } from "./SearchResultItem"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`SearchModel::do_search`]. - */ -export type SearchResult = { -/** - * Ordered list of search results. - */ -results: Array, -/** - * An optional direct answer / summary (some providers return - * an AI-generated answer alongside results). - */ -answer: string | null, -/** - * Additional provider-specific metadata. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Warnings for the call. - */ -warnings: Array, -/** - * Optional response information for debugging. - */ -response: SearchResponse | null, }; diff --git a/tools/aimux-web/web/src/types/SearchResultItem.ts b/tools/aimux-web/web/src/types/SearchResultItem.ts deleted file mode 100644 index 5d5c81218..000000000 --- a/tools/aimux-web/web/src/types/SearchResultItem.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A single search result item. - */ -export type SearchResultItem = { -/** - * The title of the result (e.g. page title). - */ -title: string | null, -/** - * The URL of the result. - */ -url: string | null, -/** - * A snippet/summary of the result content. - */ -content: string | null, -/** - * Raw page content (when `include_raw_content` is requested and - * supported by the provider). - */ -raw_content: string | null, -/** - * A relevance score (0.0–1.0) if the provider returns one. - */ -score: number | null, -/** - * Provider-specific metadata for this result. - */ -provider_metadata: { [key in string]: JsonValue } | null, }; diff --git a/tools/aimux-web/web/src/types/SessionCall.ts b/tools/aimux-web/web/src/types/SessionCall.ts deleted file mode 100644 index 695d5a603..000000000 --- a/tools/aimux-web/web/src/types/SessionCall.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A single call within a session (an index entry only — call content lives - * in Recording (RFC-0023) / TraceRecord (RFC-0015)). - */ -export type SessionCall = { -/** - * Call-level unique id. This is the association key for the future - * Recording / TraceRecord `call_id` (RFC-0015/0023): once those land, - * this field carries their value. - */ -call_id: string, -/** - * Step within the session (0-based). - */ -step: number, -/** - * When the call was recorded (RFC 3339 UTC, millisecond precision). - */ -recorded_at: string, }; diff --git a/tools/aimux-web/web/src/types/SessionChainView.ts b/tools/aimux-web/web/src/types/SessionChainView.ts deleted file mode 100644 index 3212b456a..000000000 --- a/tools/aimux-web/web/src/types/SessionChainView.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PrefixBreak } from "./PrefixBreak"; - -/** - * Session chain view (append-only order + prefix stability, RFC-0015 §5.3). - */ -export type SessionChainView = { session_id: string, record_ids: Array, prefix_stability: number, breaks: Array, }; diff --git a/tools/aimux-web/web/src/types/SessionSource.ts b/tools/aimux-web/web/src/types/SessionSource.ts deleted file mode 100644 index cf55dca73..000000000 --- a/tools/aimux-web/web/src/types/SessionSource.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Where a session id came from. - */ -export type SessionSource = "Explicit" | "Inferred"; diff --git a/tools/aimux-web/web/src/types/SessionStepStat.ts b/tools/aimux-web/web/src/types/SessionStepStat.ts deleted file mode 100644 index 1eeb3bf02..000000000 --- a/tools/aimux-web/web/src/types/SessionStepStat.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Verdict } from "./Verdict"; - -/** - * One step of a session's cache-hit trajectory (RFC-0024 §4.3). - */ -export type SessionStepStat = { -/** - * Step within the session (0-based, session order). - */ -step: number, -/** - * The call's id (association key into Recording / replay, RFC-0023). - */ -call_id: string, -/** - * Reported hit rate for this step (`cache_read / input_total`); `None` - * when the call carried no input/cache-read usage. - */ -hit_rate?: number | null, -/** - * Audit verdict (present only when an auditor is attached). - */ -verdict?: Verdict | null, -/** - * Error string for failed calls (failures are part of the session). - */ -error?: string | null, }; diff --git a/tools/aimux-web/web/src/types/SessionView.ts b/tools/aimux-web/web/src/types/SessionView.ts deleted file mode 100644 index 60a153778..000000000 --- a/tools/aimux-web/web/src/types/SessionView.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { SessionCall } from "./SessionCall"; -import type { SessionSource } from "./SessionSource"; - -/** - * Aggregated view of one session (session_id → ordered calls). - */ -export type SessionView = { session_id: string, -/** - * Where the session id came from (first call's source). - */ -source: SessionSource, -/** - * Ordered calls (by step). - */ -calls: Array, }; diff --git a/tools/aimux-web/web/src/types/Size.ts b/tools/aimux-web/web/src/types/Size.ts deleted file mode 100644 index 960627114..000000000 --- a/tools/aimux-web/web/src/types/Size.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Image/video size in `{width}x{height}` format (e.g. `"1024x1024"`). - * - * Newtype that enforces the `WxH` format used by V4 image `size` and video - * `resolution` options. Aligned with the TS template-literal type - * `` `${number}x${number}` ``. - */ -export type Size = { width: number, height: number, }; diff --git a/tools/aimux-web/web/src/types/SourcePart.ts b/tools/aimux-web/web/src/types/SourcePart.ts deleted file mode 100644 index 050ce8115..000000000 --- a/tools/aimux-web/web/src/types/SourcePart.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A source / citation, extracted to the top level (M7). - */ -export type SourcePart = { id: string, source_type: string, url?: string | null, title?: string | null, }; diff --git a/tools/aimux-web/web/src/types/SpeechCallOptions.ts b/tools/aimux-web/web/src/types/SpeechCallOptions.ts deleted file mode 100644 index 39cae2f43..000000000 --- a/tools/aimux-web/web/src/types/SpeechCallOptions.ts +++ /dev/null @@ -1,44 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`SpeechModel::do_generate`]. - * - * Aligned with V4 `SpeechModelV4CallOptions`. - */ -export type SpeechCallOptions = { -/** - * Text to convert to speech. - */ -text: string, -/** - * The voice to use (provider-specific voice ID, name, or other - * identifier). - */ -voice: string | null, -/** - * The desired output format for the audio, e.g. `"mp3"`, `"wav"`. - */ -output_format: string | null, -/** - * Instructions for the speech generation, e.g. - * `"Speak in a slow and steady tone"`. - */ -instructions: string | null, -/** - * The speed of the speech generation. - */ -speed: number | null, -/** - * The language for speech generation (ISO 639-1 code, e.g. `"en"`, or - * `"auto"` for automatic detection). Provider support varies. - */ -language: string | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/SpeechRequest.ts b/tools/aimux-web/web/src/types/SpeechRequest.ts deleted file mode 100644 index 1d5fbe382..000000000 --- a/tools/aimux-web/web/src/types/SpeechRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Optional request information for a speech call. - */ -export type SpeechRequest = { -/** - * Response body (HTTP providers only). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/SpeechResponse.ts b/tools/aimux-web/web/src/types/SpeechResponse.ts deleted file mode 100644 index 9d83fe59d..000000000 --- a/tools/aimux-web/web/src/types/SpeechResponse.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Response information for a speech call. - */ -export type SpeechResponse = { -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * Response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/SpeechResult.ts b/tools/aimux-web/web/src/types/SpeechResult.ts deleted file mode 100644 index ab9b5304f..000000000 --- a/tools/aimux-web/web/src/types/SpeechResult.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AudioData } from "./AudioData"; -import type { SpeechRequest } from "./SpeechRequest"; -import type { SpeechResponse } from "./SpeechResponse"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`SpeechModel::do_generate`]. - * - * Aligned with V4 `SpeechModelV4Result`. - */ -export type SpeechResult = { -/** - * Generated audio (base64 string or binary data). - */ -audio: AudioData, -/** - * Warnings for the call, e.g. unsupported settings. - */ -warnings: Array, -/** - * Optional request information for telemetry and debugging. - */ -request: SpeechRequest | null, -/** - * Response information for telemetry and debugging. - */ -response: SpeechResponse, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, }; diff --git a/tools/aimux-web/web/src/types/StreamPart.ts b/tools/aimux-web/web/src/types/StreamPart.ts deleted file mode 100644 index 8402cfa65..000000000 --- a/tools/aimux-web/web/src/types/StreamPart.ts +++ /dev/null @@ -1,66 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AiMuxError } from "./AiMuxError"; -import type { FileData } from "./FileData"; -import type { FinishReason } from "./FinishReason"; -import type { Usage } from "./Usage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A single chunk in the stream returned by `do_stream`. - */ -export type StreamPart = { "TextStart": { id: string, provider_metadata?: JsonValue | null, } } | { "TextDelta": { id: string, delta: string, provider_metadata?: JsonValue | null, } } | { "TextEnd": { id: string, provider_metadata?: JsonValue | null, } } | { "StreamStart": { warnings: Array, } } | { "Finish": { finish_reason: FinishReason, usage: Usage, provider_metadata: JsonValue | null, } } | { "Error": { error: AiMuxError, } } | { "ToolInputStart": { id: string, tool_name: string, -/** - * Whether the tool call will be executed by the provider. - */ -provider_executed?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Optional title for the tool call. - */ -title?: string | null, provider_metadata?: JsonValue | null, } } | { "ToolInputDelta": { id: string, delta: string, provider_metadata?: JsonValue | null, } } | { "ToolInputEnd": { id: string, provider_metadata?: JsonValue | null, } } | { "ToolCall": { tool_call_id: string, tool_name: string, input: JsonValue, -/** - * Whether the tool call will be executed by the provider. - */ -provider_executed?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Provider-assigned thought signature (e.g. Google Gemini - * `thoughtSignature`). Must be echoed back verbatim on the follow-up - * turn when the tool result is sent. - */ -thought_signature?: string | null, provider_metadata?: JsonValue | null, } } | { "ToolResult": { tool_call_id: string, tool_name: string, result: JsonValue, -/** - * Whether the result is an error or error message. - */ -is_error?: boolean | null, -/** - * Whether the result is preliminary (replaces prior, e.g. image previews). - */ -preliminary?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Additional provider-specific metadata for the tool result. - */ -provider_metadata?: JsonValue | null, } } | { "File": { data: FileData, media_type: string, provider_metadata?: JsonValue | null, } } | { "ReasoningStart": { id: string, -/** - * Provider-specific metadata (e.g. xAI `itemId`). - */ -provider_metadata: JsonValue | null, } } | { "ReasoningDelta": { id: string, delta: string, -/** - * Provider-specific metadata (e.g. xAI `itemId`). - */ -provider_metadata: JsonValue | null, } } | { "ReasoningEnd": { id: string, -/** - * Provider-specific metadata (e.g. xAI `itemId`, `reasoningEncryptedContent`). - */ -provider_metadata: JsonValue | null, } } | { "ResponseMetadata": { id: string | null, timestamp: string | null, model_id: string | null, } } | { "Source": { id: string, source_type: string, url: string | null, title: string | null, provider_metadata?: JsonValue | null, } } | { "Raw": { raw_value: JsonValue, } }; diff --git a/tools/aimux-web/web/src/types/StreamTextResultAggregated.ts b/tools/aimux-web/web/src/types/StreamTextResultAggregated.ts deleted file mode 100644 index ae61b42bc..000000000 --- a/tools/aimux-web/web/src/types/StreamTextResultAggregated.ts +++ /dev/null @@ -1,75 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FilePart } from "./FilePart"; -import type { FinishReason } from "./FinishReason"; -import type { ModelMessage } from "./ModelMessage"; -import type { ReasoningPart } from "./ReasoningPart"; -import type { ResponseMetadata } from "./ResponseMetadata"; -import type { SourcePart } from "./SourcePart"; -import type { ToolCall } from "./ToolCall"; -import type { Usage } from "./Usage"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Aggregated result of `stream_text().consume()` (M11). Mirrors - * `GenerateTextResult`'s user-facing fields (without `raw`, since streaming - * has no `GenerateResult` equivalent). - */ -export type StreamTextResultAggregated = { -/** - * The generated text (concatenated `TextDelta`). - */ -text: string, -/** - * Reasoning / thinking segments. - */ -reasoning: Array, -/** - * Concatenated reasoning text. - */ -reasoning_text: string, -/** - * Tool calls requested by the model. - */ -tool_calls: Array, -/** - * Sources / citations. - */ -sources: Array, -/** - * Files generated by the model. - */ -files: Array, -/** - * Why generation stopped. - */ -finish_reason: FinishReason, -/** - * Raw provider-specific finish reason string. - */ -raw_finish_reason: string | null, -/** - * Token usage. - */ -usage: Usage, -/** - * Total token usage across all steps. In single-step mode (aimux's - * default), `total_usage` equals `usage`. Provided for AI SDK parity. - */ -total_usage: Usage, -/** - * Warnings from the provider. - */ -warnings: Array, -/** - * Provider-specific metadata from the Finish chunk. - */ -provider_metadata: JsonValue | null, -/** - * Response metadata (id, timestamp, model_id) if emitted by the stream. - */ -response: ResponseMetadata | null, -/** - * Assistant messages ready to append for the next turn. - */ -response_messages: Array, }; diff --git a/tools/aimux-web/web/src/types/TimeoutConfiguration.ts b/tools/aimux-web/web/src/types/TimeoutConfiguration.ts deleted file mode 100644 index 8e3a34444..000000000 --- a/tools/aimux-web/web/src/types/TimeoutConfiguration.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Per-call timeout configuration. - * - * Aligned with V4 `LanguageModelV4CallOptions.timeout` - * (`TimeoutConfiguration`). All values are milliseconds; `None` disables the - * corresponding limit. A `total` timeout also covers retry backoff and the - * whole streamed response. - */ -export type TimeoutConfiguration = { -/** - * Overall timeout for the entire call (including retries and, for - * streaming, the whole stream), in milliseconds. - */ -total_ms: number | null, -/** - * Timeout waiting for the first stream chunk (streaming only). - */ -first_chunk_ms: number | null, -/** - * Maximum idle time between consecutive stream chunks (streaming only). - */ -chunk_ms: number | null, }; diff --git a/tools/aimux-web/web/src/types/TimingRecord.ts b/tools/aimux-web/web/src/types/TimingRecord.ts deleted file mode 100644 index b24ae6478..000000000 --- a/tools/aimux-web/web/src/types/TimingRecord.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type TimingRecord = { -/** - * ms 级延迟,TS 用 number(远小于 2^53,避免 bigint)。 - */ -latency_ms: number, ttfb_ms: number | null, }; diff --git a/tools/aimux-web/web/src/types/TokenUsage.ts b/tools/aimux-web/web/src/types/TokenUsage.ts deleted file mode 100644 index ddab251a8..000000000 --- a/tools/aimux-web/web/src/types/TokenUsage.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Token usage detail (with cache breakdown). - */ -export type TokenUsage = { -/** - * Total tokens. - */ -total: number | null, -/** - * Tokens that were not served from cache. - */ -no_cache: number | null, -/** - * Tokens served from cache (read). - */ -cache_read: number | null, -/** - * Tokens written to cache. - */ -cache_write: number | null, -/** - * Text (non-reasoning) tokens (output side). - */ -text: number | null, -/** - * Reasoning tokens (output side). - */ -reasoning: number | null, }; diff --git a/tools/aimux-web/web/src/types/Tool.ts b/tools/aimux-web/web/src/types/Tool.ts deleted file mode 100644 index 5cfcaa975..000000000 --- a/tools/aimux-web/web/src/types/Tool.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FunctionTool } from "./FunctionTool"; -import type { ProviderTool } from "./ProviderTool"; - -/** - * A tool that can be either a user-defined function tool or a - * provider-defined tool. Mirrors the V4 - * `Array`. - */ -export type Tool = { "type": "function" } & FunctionTool | { "type": "provider" } & ProviderTool; diff --git a/tools/aimux-web/web/src/types/ToolCall.ts b/tools/aimux-web/web/src/types/ToolCall.ts deleted file mode 100644 index d16cbbc4d..000000000 --- a/tools/aimux-web/web/src/types/ToolCall.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A tool call requested by the model. - */ -export type ToolCall = { -/** - * Provider-assigned call id. - */ -tool_call_id: string, -/** - * Tool name. - */ -tool_name: string, -/** - * Arguments as a JSON value (usually an object). - */ -input: JsonValue, -/** - * Whether the tool call will be executed by the provider. - */ -provider_executed?: boolean | null, -/** - * Whether the tool is dynamic (defined at runtime, e.g. MCP tools). - */ -dynamic?: boolean | null, -/** - * Provider-assigned thought signature (e.g. Google Gemini - * `thoughtSignature`). Must be echoed back verbatim on the follow-up turn - * when the tool result is sent; thinking models reject the request - * otherwise. - */ -thought_signature?: string | null, }; diff --git a/tools/aimux-web/web/src/types/ToolChoice.ts b/tools/aimux-web/web/src/types/ToolChoice.ts deleted file mode 100644 index b8f658f4a..000000000 --- a/tools/aimux-web/web/src/types/ToolChoice.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * How the model should choose tools. - * - * Wire format aligns with Vercel AI SDK `toolChoice`: - * `"auto" | "none" | "required" | { "type": "tool", "toolName": "..." }`. - * This is a mixed tagged/untagged shape (unit variants as bare strings, - * `Tool` variant as a tagged object), so serde is implemented by hand. - */ -export type ToolChoice = "auto" | "none" | "required" | { type: "tool"; toolName: string }; diff --git a/tools/aimux-web/web/src/types/ToolResult.ts b/tools/aimux-web/web/src/types/ToolResult.ts deleted file mode 100644 index 1398d1a46..000000000 --- a/tools/aimux-web/web/src/types/ToolResult.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of executing a tool call, to be sent back to the model. - */ -export type ToolResult = { -/** - * Must match the corresponding `ToolCall::tool_call_id`. - */ -tool_call_id: string, -/** - * The tool's output (usually a JSON-serializable value or plain text). - */ -result: JsonValue, -/** - * Whether the result is an error or error message. - */ -is_error?: boolean | null, -/** - * Whether the result is preliminary (replaces prior, e.g. image previews). - */ -preliminary?: boolean | null, }; diff --git a/tools/aimux-web/web/src/types/TraceFilter.ts b/tools/aimux-web/web/src/types/TraceFilter.ts deleted file mode 100644 index 314c21083..000000000 --- a/tools/aimux-web/web/src/types/TraceFilter.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Query filter (RFC-0015 §5.3). - */ -export type TraceFilter = { provider: string | null, model: string | null, session_id: string | null, since_unix_ms: bigint | null, }; diff --git a/tools/aimux-web/web/src/types/TraceRecord.ts b/tools/aimux-web/web/src/types/TraceRecord.ts deleted file mode 100644 index fe903fb3f..000000000 --- a/tools/aimux-web/web/src/types/TraceRecord.ts +++ /dev/null @@ -1,47 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Fingerprint } from "./Fingerprint"; -import type { RequestCacheHints } from "./RequestCacheHints"; -import type { UsageSnapshot } from "./UsageSnapshot"; -import type { Verdict } from "./Verdict"; - -/** - * One probed call. Plaintext never persists — fingerprints only. - */ -export type TraceRecord = { provider: string, model: string, request_id: string | null, -/** - * From `CallOptions.session_id` (RFC-0024) — explicit first, inference - * fallback; may also be the layer's default session. - */ -session_id: string | null, -/** - * Call-level unique id (association key for Recording / replay, - * RFC-0023). - */ -call_id: string, -/** - * When the call was sent (epoch ms). - */ -sent_at_unix_ms: number, -/** - * Client-side LCP token upper bound (block upper bound, byte-proxy - * len/4). `None` when no history matched. Consumed by `TraceStats` - * aggregation. - */ -lcp_token_upper?: bigint | null, -/** - * Time to first streamed token (ms). Non-streaming: `None`. - */ -ttft_ms: number | null, fingerprint: Fingerprint, usage: UsageSnapshot, -/** - * Response-side cache headers (e.g. `x-openrouter-cache-status`). - */ -response_cache_headers?: { [key in string]: string } | null, request_cache_hints?: RequestCacheHints | null, -/** - * Audit verdict (`None` when no auditor is attached — the default). - */ -verdict?: Verdict | null, -/** - * Error string when the call failed (still recorded: failures are part - * of the session). - */ -error?: string | null, }; diff --git a/tools/aimux-web/web/src/types/TraceStats.ts b/tools/aimux-web/web/src/types/TraceStats.ts deleted file mode 100644 index 2f836deac..000000000 --- a/tools/aimux-web/web/src/types/TraceStats.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Aggregated statistics (RFC-0015 §5.2 — the two hit rates are reported - * side by side, never merged into a single number). - */ -export type TraceStats = { provider: string, model: string, requests: bigint, input_tokens_total: bigint, claimed_cache_read_total: bigint, claimed_cache_write_total: bigint, reported_hit_rate: number | null, client_upper_bound_hit_rate: number | null, verdict_counts: { [key in string]: bigint }, ttft_p50_ms: bigint | null, ttft_p95_ms: bigint | null, errors: bigint, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionCallOptions.ts b/tools/aimux-web/web/src/types/TranscriptionCallOptions.ts deleted file mode 100644 index 79acc81ee..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionCallOptions.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AudioInput } from "./AudioInput"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`TranscriptionModel::do_generate`]. - * - * Aligned with V4 `TranscriptionModelV4CallOptions`. - */ -export type TranscriptionCallOptions = { -/** - * Audio data to transcribe (raw bytes or a base64-encoded string). - */ -audio: AudioInput, -/** - * The IANA media type of the audio data, e.g. `"audio/mp3"`. - */ -media_type: string, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionRequest.ts b/tools/aimux-web/web/src/types/TranscriptionRequest.ts deleted file mode 100644 index d1dac6010..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Optional request information for a transcription call. - */ -export type TranscriptionRequest = { -/** - * Raw request HTTP body that was sent (JSON stringified). - */ -body: string | null, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionResponse.ts b/tools/aimux-web/web/src/types/TranscriptionResponse.ts deleted file mode 100644 index cdf3331b2..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionResponse.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Response information for a transcription call. - */ -export type TranscriptionResponse = { -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, -/** - * Response body (opaque JSON). - */ -body: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionResult.ts b/tools/aimux-web/web/src/types/TranscriptionResult.ts deleted file mode 100644 index ee229f7c2..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionResult.ts +++ /dev/null @@ -1,45 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TranscriptionRequest } from "./TranscriptionRequest"; -import type { TranscriptionResponse } from "./TranscriptionResponse"; -import type { TranscriptionSegment } from "./TranscriptionSegment"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`TranscriptionModel::do_generate`]. - * - * Aligned with V4 `TranscriptionModelV4Result`. - */ -export type TranscriptionResult = { -/** - * The complete transcribed text from the audio. - */ -text: string, -/** - * Transcript segments with timing information. - */ -segments: Array, -/** - * The detected language (ISO 639-1 code, e.g. `"en"`), if detected. - */ -language: string | null, -/** - * The total duration of the audio in seconds, if determined. - */ -duration_in_seconds: number | null, -/** - * Warnings for the call, e.g. unsupported settings. - */ -warnings: Array, -/** - * Optional request information for telemetry and debugging. - */ -request: TranscriptionRequest | null, -/** - * Response information for telemetry and debugging. - */ -response: TranscriptionResponse, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionSegment.ts b/tools/aimux-web/web/src/types/TranscriptionSegment.ts deleted file mode 100644 index dcb5e02a2..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionSegment.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A transcript segment with timing information. - */ -export type TranscriptionSegment = { -/** - * The text content of this segment. - */ -text: string, -/** - * The start time of this segment in seconds. - */ -start_second: number, -/** - * The end time of this segment in seconds. - */ -end_second: number, }; diff --git a/tools/aimux-web/web/src/types/TranscriptionStreamPart.ts b/tools/aimux-web/web/src/types/TranscriptionStreamPart.ts deleted file mode 100644 index 45228feec..000000000 --- a/tools/aimux-web/web/src/types/TranscriptionStreamPart.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TranscriptionSegment } from "./TranscriptionSegment"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * A single chunk in the stream returned by `do_stream`. - * - * Aligned with V4 `TranscriptionModelV4StreamPart`. - */ -export type TranscriptionStreamPart = { "StreamStart": { warnings: Array, } } | { "TranscriptDelta": { id: string | null, delta: string, provider_metadata: { [key in string]: JsonValue } | null, } } | { "TranscriptPartial": { id: string | null, text: string, start_second: number | null, duration_in_seconds: number | null, channel_index: number | null, provider_metadata: { [key in string]: JsonValue } | null, } } | { "TranscriptFinal": { id: string | null, text: string, start_second: number | null, end_second: number | null, channel_index: number | null, provider_metadata: { [key in string]: JsonValue } | null, } } | { "ResponseMetadata": { timestamp: string | null, model_id: string | null, headers: { [key in string]: string } | null, body: JsonValue | null, } } | { "Finish": { text: string, segments: Array, language: string | null, duration_in_seconds: number | null, provider_metadata: { [key in string]: JsonValue } | null, } } | { "Raw": { raw_value: JsonValue, } } | { "Error": { error: JsonValue, } }; diff --git a/tools/aimux-web/web/src/types/UploadFileCallOptions.ts b/tools/aimux-web/web/src/types/UploadFileCallOptions.ts deleted file mode 100644 index 027e634aa..000000000 --- a/tools/aimux-web/web/src/types/UploadFileCallOptions.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { UploadFileData } from "./UploadFileData"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`Files::upload_file`]. - * - * Aligned with V4 `FilesV4UploadFileCallOptions`. - */ -export type UploadFileCallOptions = { -/** - * The file data (raw bytes/base64 or inline text). - */ -data: UploadFileData, -/** - * The IANA media type of the file, e.g. `"application/pdf"`. - */ -media_type: string, -/** - * The filename of the file. - */ -filename: string | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue } | null, }; diff --git a/tools/aimux-web/web/src/types/UploadFileData.ts b/tools/aimux-web/web/src/types/UploadFileData.ts deleted file mode 100644 index 6b50bff3d..000000000 --- a/tools/aimux-web/web/src/types/UploadFileData.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FileBytes } from "./FileBytes"; - -/** - * File data accepted by [`Files::upload_file`]. - * - * The V4 spec restricts upload input to the `data` and `text` variants of - * `SharedV4FileData` (URLs and provider references are not valid uploads), so - * this is a dedicated two-variant enum rather than the full [`crate::shared::FileData`]. - */ -export type UploadFileData = { "Data": { data: FileBytes, } } | { "Text": { text: string, } }; diff --git a/tools/aimux-web/web/src/types/UploadFileResult.ts b/tools/aimux-web/web/src/types/UploadFileResult.ts deleted file mode 100644 index dc9c7412e..000000000 --- a/tools/aimux-web/web/src/types/UploadFileResult.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Result of [`Files::upload_file`]. - * - * Aligned with V4 `FilesV4UploadFileResult`. - */ -export type UploadFileResult = { -/** - * A provider reference mapping provider names to provider-specific file - * identifiers. - */ -provider_reference: { [key in string]: string }, -/** - * The IANA media type of the uploaded file, if available from the - * provider. - */ -media_type: string | null, -/** - * The filename of the uploaded file, if available from the provider. - */ -filename: string | null, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Warnings from the provider. - */ -warnings: Array, }; diff --git a/tools/aimux-web/web/src/types/Usage.ts b/tools/aimux-web/web/src/types/Usage.ts deleted file mode 100644 index 76961cf7e..000000000 --- a/tools/aimux-web/web/src/types/Usage.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TokenUsage } from "./TokenUsage"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Token usage statistics. - */ -export type Usage = { input_tokens: TokenUsage, output_tokens: TokenUsage, -/** - * Raw usage information from the provider (opaque, provider-specific). - */ -raw?: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/UsageSnapshot.ts b/tools/aimux-web/web/src/types/UsageSnapshot.ts deleted file mode 100644 index 2db90e806..000000000 --- a/tools/aimux-web/web/src/types/UsageSnapshot.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Token usage snapshot (7 flat fields + raw passthrough). - */ -export type UsageSnapshot = { input_total: bigint | null, input_no_cache: bigint | null, cache_read: bigint | null, cache_write: bigint | null, output_total: bigint | null, output_text: bigint | null, output_reasoning: bigint | null, -/** - * Raw provider usage payload (opaque passthrough; numbers only — no - * prompt text). - */ -raw?: JsonValue | null, }; diff --git a/tools/aimux-web/web/src/types/Verdict.ts b/tools/aimux-web/web/src/types/Verdict.ts deleted file mode 100644 index 14b282efa..000000000 --- a/tools/aimux-web/web/src/types/Verdict.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { VerdictConfidence } from "./VerdictConfidence"; -import type { VerdictKind } from "./VerdictKind"; - -/** - * A verdict for one call. - */ -export type Verdict = { kind: VerdictKind, confidence: VerdictConfidence, -/** - * Violated rule ids (R-1.1 / R-1.2 / …). - */ -violated: Array, -/** - * Expected upper bound U (tokens). - */ -expected_max: bigint, claimed: bigint, -/** - * Client-side LCP (bytes). - */ -lcp_bytes: bigint, notes: Array, }; diff --git a/tools/aimux-web/web/src/types/VerdictConfidence.ts b/tools/aimux-web/web/src/types/VerdictConfidence.ts deleted file mode 100644 index 0340dba07..000000000 --- a/tools/aimux-web/web/src/types/VerdictConfidence.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Confidence level. - */ -export type VerdictConfidence = "High" | "Medium" | "Low"; diff --git a/tools/aimux-web/web/src/types/VerdictKind.ts b/tools/aimux-web/web/src/types/VerdictKind.ts deleted file mode 100644 index 9d8c9f985..000000000 --- a/tools/aimux-web/web/src/types/VerdictKind.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Verdict kinds (RFC-0015 §4.1). - */ -export type VerdictKind = "Trusted" | "SuspectOverclaim" | "SuspectUnderclaim" | "Unknown"; diff --git a/tools/aimux-web/web/src/types/VideoCallOptions.ts b/tools/aimux-web/web/src/types/VideoCallOptions.ts deleted file mode 100644 index ecdc9f265..000000000 --- a/tools/aimux-web/web/src/types/VideoCallOptions.ts +++ /dev/null @@ -1,66 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AspectRatio } from "./AspectRatio"; -import type { Size } from "./Size"; -import type { VideoFile } from "./VideoFile"; -import type { VideoFrameImage } from "./VideoFrameImage"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * Options passed to [`VideoModel::do_generate`]. - * - * Aligned with V4 `VideoModelV4CallOptions`. - */ -export type VideoCallOptions = { -/** - * Text prompt for the video generation. `None` when not required. - */ -prompt: string | null, -/** - * Number of videos to generate. Default `1`; most models only support - * `n = 1` due to computational cost. - */ -n: number, -/** - * Aspect ratio, in `{width}:{height}` format (e.g. `"16:9"`). - */ -aspect_ratio: AspectRatio | null, -/** - * Resolution, in `{width}x{height}` format (e.g. `"1280x720"`). - */ -resolution: Size | null, -/** - * Duration of the video in seconds. Typically 3–10 seconds. - */ -duration: number | null, -/** - * Frames per second. Common values: 24, 30, 60. - */ -fps: number | null, -/** - * Seed for deterministic generation. `None` uses a random seed. - */ -seed: number | null, -/** - * Input image for image-to-video generation (the starting frame). - */ -image: VideoFile | null, -/** - * Role-tagged image inputs for first-last-frame generation. - */ -frame_images: Array | null, -/** - * Reference inputs for reference-to-video generation (images or videos). - */ -input_references: Array | null, -/** - * Whether the model should generate audio alongside the video. - */ -generate_audio: boolean | null, -/** - * Additional provider-specific options, keyed by provider name. - */ -provider_options: { [key in string]: JsonValue }, -/** - * Additional HTTP headers to send with the request. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/VideoData.ts b/tools/aimux-web/web/src/types/VideoData.ts deleted file mode 100644 index 443d5449b..000000000 --- a/tools/aimux-web/web/src/types/VideoData.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Generated video data: a URL, base64-encoded string, or binary data. - * - * Aligned with V4 `VideoModelV4VideoData`. Most providers return URLs due to - * large file sizes. - */ -export type VideoData = { "Url": { url: string, media_type: string, } } | { "Base64": { data: string, media_type: string, } } | { "Binary": { data: Array, media_type: string, } }; diff --git a/tools/aimux-web/web/src/types/VideoFile.ts b/tools/aimux-web/web/src/types/VideoFile.ts deleted file mode 100644 index 9d32e3648..000000000 --- a/tools/aimux-web/web/src/types/VideoFile.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { VideoFileData } from "./VideoFileData"; - -/** - * A video or image file used for video editing or image-to-video generation. - * - * Aligned with V4 `VideoModelV4File`. - */ -export type VideoFile = { "File": { -/** - * IANA media type, e.g. `"video/mp4"` or `"image/png"`. - */ -media_type: string, -/** - * File data as a base64 string or binary bytes. - */ -data: VideoFileData, } } | { "Url": { -/** - * The URL of the video or image file. - */ -url: string, -/** - * The media type of the referenced file, when known. - */ -media_type: string | null, } }; diff --git a/tools/aimux-web/web/src/types/VideoFileData.ts b/tools/aimux-web/web/src/types/VideoFileData.ts deleted file mode 100644 index d7b1d6a6b..000000000 --- a/tools/aimux-web/web/src/types/VideoFileData.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * File payload for a [`VideoFile::File`]: base64 string or raw bytes. - */ -export type VideoFileData = { "Base64": string } | { "Binary": Array }; diff --git a/tools/aimux-web/web/src/types/VideoFrameImage.ts b/tools/aimux-web/web/src/types/VideoFrameImage.ts deleted file mode 100644 index de49fcb3d..000000000 --- a/tools/aimux-web/web/src/types/VideoFrameImage.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { VideoFile } from "./VideoFile"; -import type { VideoFrameType } from "./VideoFrameType"; - -/** - * A role-tagged image input for image-to-video and first-last-frame generation. - * - * Aligned with V4 `VideoModelV4FrameImage`. - */ -export type VideoFrameImage = { -/** - * The image file used for this frame. - */ -image: VideoFile, -/** - * Which frame this image represents. - */ -frame_type: VideoFrameType, }; diff --git a/tools/aimux-web/web/src/types/VideoFrameType.ts b/tools/aimux-web/web/src/types/VideoFrameType.ts deleted file mode 100644 index 4279f6dfe..000000000 --- a/tools/aimux-web/web/src/types/VideoFrameType.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * The role a frame image plays in video generation. - * - * Aligned with V4 `VideoModelV4FrameType`. - */ -export type VideoFrameType = "FirstFrame" | "LastFrame"; diff --git a/tools/aimux-web/web/src/types/VideoResponse.ts b/tools/aimux-web/web/src/types/VideoResponse.ts deleted file mode 100644 index 9e7fff9cb..000000000 --- a/tools/aimux-web/web/src/types/VideoResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * Response information for a video generation call. - */ -export type VideoResponse = { -/** - * Timestamp for the start of the generated response (ISO 8601 string). - */ -timestamp: string | null, -/** - * The ID of the model that was used to generate the response. - */ -model_id: string | null, -/** - * Response headers. - */ -headers: { [key in string]: string } | null, }; diff --git a/tools/aimux-web/web/src/types/VideoResult.ts b/tools/aimux-web/web/src/types/VideoResult.ts deleted file mode 100644 index 9bda831ef..000000000 --- a/tools/aimux-web/web/src/types/VideoResult.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { VideoData } from "./VideoData"; -import type { VideoResponse } from "./VideoResponse"; -import type { Warning } from "./Warning"; -import type { JsonValue } from "./serde_json/JsonValue"; - -/** - * The result of [`VideoModel::do_generate`]. - * - * Aligned with V4 `VideoModelV4Result`. - */ -export type VideoResult = { -/** - * Generated videos as URLs, base64 strings, or binary data. - */ -videos: Array, -/** - * Warnings for the call, e.g. unsupported features. - */ -warnings: Array, -/** - * Additional provider-specific metadata, keyed by provider name. - */ -provider_metadata: { [key in string]: JsonValue } | null, -/** - * Response information for telemetry and debugging. - */ -response: VideoResponse, }; diff --git a/tools/aimux-web/web/src/types/Warning.ts b/tools/aimux-web/web/src/types/Warning.ts deleted file mode 100644 index 14edc447c..000000000 --- a/tools/aimux-web/web/src/types/Warning.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A warning issued by the provider (e.g. unsupported parameter). - */ -export type Warning = { "Unsupported": { feature: string, details: string | null, } } | { "Compatibility": { feature: string, details: string | null, } } | { "Deprecated": { setting: string, message: string, } } | { "Other": { message: string, } }; diff --git a/tools/aimux-web/web/src/types/WireCallResponse.ts b/tools/aimux-web/web/src/types/WireCallResponse.ts index bd19eb41d..b588d4208 100644 --- a/tools/aimux-web/web/src/types/WireCallResponse.ts +++ b/tools/aimux-web/web/src/types/WireCallResponse.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { WireMeta } from "./WireMeta"; -import type { JsonValue } from "./serde_json/JsonValue"; +import type { JsonValue } from "../../../../../bindings/node/src/types/serde_json/JsonValue"; /** * Response for non-streaming calls. diff --git a/tools/aimux-web/web/src/types/WireContentPart.ts b/tools/aimux-web/web/src/types/WireContentPart.ts index ce96d1265..915ccaa41 100644 --- a/tools/aimux-web/web/src/types/WireContentPart.ts +++ b/tools/aimux-web/web/src/types/WireContentPart.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; +import type { JsonValue } from "../../../../../bindings/node/src/types/serde_json/JsonValue"; /** * A content part in the wire format. diff --git a/tools/aimux-web/web/src/types/WireOptions.ts b/tools/aimux-web/web/src/types/WireOptions.ts index c4ec07581..c9de9e081 100644 --- a/tools/aimux-web/web/src/types/WireOptions.ts +++ b/tools/aimux-web/web/src/types/WireOptions.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { WireTool } from "./WireTool"; -import type { JsonValue } from "./serde_json/JsonValue"; +import type { JsonValue } from "../../../../../bindings/node/src/types/serde_json/JsonValue"; export type WireOptions = { temperature?: number | null, max_output_tokens?: number | null, top_p?: number | null, stop_sequences?: Array | null, tools?: Array | null, /** diff --git a/tools/aimux-web/web/src/types/WireTool.ts b/tools/aimux-web/web/src/types/WireTool.ts index 713cb2ddf..6917d2582 100644 --- a/tools/aimux-web/web/src/types/WireTool.ts +++ b/tools/aimux-web/web/src/types/WireTool.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { JsonValue } from "./serde_json/JsonValue"; +import type { JsonValue } from "../../../../../bindings/node/src/types/serde_json/JsonValue"; /** * A function tool definition (JSON Schema parameters). diff --git a/tools/aimux-web/web/src/types/serde_json/JsonValue.ts b/tools/aimux-web/web/src/types/serde_json/JsonValue.ts deleted file mode 100644 index 320a852fd..000000000 --- a/tools/aimux-web/web/src/types/serde_json/JsonValue.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type JsonValue = number | string | boolean | Array | { [key in string]: JsonValue } | null; diff --git a/tools/aimux-web/web/src/views/Replay.vue b/tools/aimux-web/web/src/views/Replay.vue index 54dae6622..6ec0e3814 100644 --- a/tools/aimux-web/web/src/views/Replay.vue +++ b/tools/aimux-web/web/src/views/Replay.vue @@ -1,7 +1,7 @@