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
@@ -76,13 +76,13 @@ export function resolveImageSize(params) {
|
||||
return DEFAULT_SIZE;
|
||||
}
|
||||
}
|
||||
export function buildOpenAIImageGenerationProvider({ isProviderApiKeyConfigured, getPluginConfig, }) {
|
||||
export function buildOpenAIImageGenerationProvider({ isProviderApiKeyConfiguredAsync, getPluginConfig, }) {
|
||||
return {
|
||||
id: "1h-openai-image",
|
||||
label: "1-h OpenAI Image",
|
||||
defaultModel: DEFAULT_OPENAI_IMAGE_MODEL,
|
||||
models: [DEFAULT_OPENAI_IMAGE_MODEL, "gpt-image-2.5", "gpt-image-2.5-flare", "gpt-image-2.5-sunburst"],
|
||||
isConfigured: (ctx) => {
|
||||
isConfiguredAsync: async (ctx) => {
|
||||
const pluginCfg = resolveImageConfig(ctx.cfg, getPluginConfig?.());
|
||||
if (resolvePluginApiKey(pluginCfg?.apiKey) ||
|
||||
Boolean(pluginCfg?.apiKey) ||
|
||||
@@ -92,7 +92,7 @@ export function buildOpenAIImageGenerationProvider({ isProviderApiKeyConfigured,
|
||||
normalizeOptionalString(process.env.OPENAI_API_KEY)) {
|
||||
return true;
|
||||
}
|
||||
return isProviderApiKeyConfigured({
|
||||
return await isProviderApiKeyConfiguredAsync({
|
||||
provider: "openai",
|
||||
...ctx,
|
||||
profileTypes: ["api_key"],
|
||||
|
||||
Reference in new issue
Block a user