refactor: migrate to async isConfiguredAsync and remove deprecated tool-plugin import
This commit is contained in:
1 parent
8cd50b1c4d
commit
59b7316944
13 files changed
+37
-61
No files matched your search
Vendored
+3
-3
@@ -25,13 +25,13 @@ export function resolveConfiguredGeminiImageBaseUrl(pluginCfg) {
|
||||
normalizeOptionalString(process.env.GEMINI_IMAGE_BASE_URL) ??
|
||||
DEFAULT_GEMINI_IMAGE_BASE_URL);
|
||||
}
|
||||
export function buildGeminiImageGenerationProvider({ isProviderApiKeyConfigured, getPluginConfig, }) {
|
||||
export function buildGeminiImageGenerationProvider({ isProviderApiKeyConfiguredAsync, getPluginConfig, }) {
|
||||
return {
|
||||
id: "1h-gemini-image",
|
||||
label: "1-h Gemini Image",
|
||||
defaultModel: DEFAULT_GEMINI_IMAGE_MODEL,
|
||||
models: [DEFAULT_GEMINI_IMAGE_MODEL],
|
||||
isConfigured: (ctx) => {
|
||||
isConfiguredAsync: async (ctx) => {
|
||||
const pluginCfg = resolveGeminiImageConfig(ctx.cfg, getPluginConfig?.());
|
||||
if (resolvePluginApiKey(pluginCfg?.apiKey) ||
|
||||
Boolean(pluginCfg?.apiKey) ||
|
||||
@@ -40,7 +40,7 @@ export function buildGeminiImageGenerationProvider({ isProviderApiKeyConfigured,
|
||||
normalizeOptionalString(process.env.BIFROST_API_KEY)) {
|
||||
return true;
|
||||
}
|
||||
return isProviderApiKeyConfigured({
|
||||
return await isProviderApiKeyConfiguredAsync({
|
||||
provider: "google",
|
||||
...ctx,
|
||||
profileTypes: ["api_key"],
|
||||
|
||||
Reference in new issue
Block a user