mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-13 04:59:51 +08:00
refactor(providers): drop the transitional tables, document how to add a provider
Step 6 of the provider refactor plan. FIXED_CRED_PROVIDERS, PROVIDER_LOGO_MAP,
OPTIONS_OPEN and NO_KEY_NEEDED had no readers left and are gone; the record's
fields are read where they were used. The fixture that compared the derived
tables with their old literal values is gone with them; tests/unit/providers.test.ts
keeps the record's own rules (21 providers in auto-detection, every note in
every UI language, https defaults only, fixed-credential providers, the
picker's order) and a new check that env.example names every record's
variables. docs/{en,cn,ja}/ai-providers.md end with a section on adding a
provider: one record, two env.example lines, one docs paragraph.
This commit is contained in:
@@ -31,15 +31,6 @@ export const POPULAR_PROVIDERS: ProviderName[] = [
|
||||
"qwen",
|
||||
]
|
||||
|
||||
/**
|
||||
* Providers whose base URL usually needs changing (Azure has no default;
|
||||
* Ollama's is its cloud, SGLang's a local server) or comes with a hint
|
||||
* (MiniMax, MiMo): their folded options start open
|
||||
*/
|
||||
export const OPTIONS_OPEN: ProviderName[] = PROVIDER_NAMES.filter(
|
||||
(p) => PROVIDERS[p].optionsOpen,
|
||||
)
|
||||
|
||||
/** The groups with only the providers whose name matches the search */
|
||||
export function filterProviderGroups(query: string) {
|
||||
const q = query.trim().toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user