mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:40:49 +00:00
fix: use static provider catalogs for model listing
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
applyChutesApiKeyConfig,
|
||||
applyChutesProviderConfig,
|
||||
} from "./onboard.js";
|
||||
import { buildChutesProvider } from "./provider-catalog.js";
|
||||
import { buildChutesProvider, buildStaticChutesProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "chutes";
|
||||
|
||||
@@ -180,6 +180,12 @@ export default definePluginEntry({
|
||||
};
|
||||
},
|
||||
},
|
||||
staticCatalog: {
|
||||
order: "profile",
|
||||
run: async () => ({
|
||||
provider: buildStaticChutesProvider(),
|
||||
}),
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -6,6 +6,14 @@ import {
|
||||
discoverChutesModels,
|
||||
} from "./models.js";
|
||||
|
||||
export function buildStaticChutesProvider(): ModelProviderConfig {
|
||||
return {
|
||||
baseUrl: CHUTES_BASE_URL,
|
||||
api: "openai-completions",
|
||||
models: CHUTES_MODEL_CATALOG.map(buildChutesModelDefinition),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the Chutes provider with dynamic model discovery.
|
||||
* Falls back to the static catalog on failure.
|
||||
|
||||
Reference in New Issue
Block a user