Improve model capability checks for AIMLAPI
| @@ -5439,7 +5439,7 @@ export function isImageInliningSupported() { | |||
| 5439 | case chat_completion_sources.XAI: | 5439 | case chat_completion_sources.XAI: |
| 5440 | return visionSupportedModels.some(model => oai_settings.xai_model.includes(model)); | 5440 | return visionSupportedModels.some(model => oai_settings.xai_model.includes(model)); |
| 5441 | case chat_completion_sources.AIMLAPI: | 5441 | case chat_completion_sources.AIMLAPI: |
| 5442 | return visionSupportedModels.some(model => oai_settings.aimlapi_model.includes(model)); | 5442 | return (Array.isArray(model_list) && model_list.find(m => m.id === oai_settings.aimlapi_model)?.features?.includes('openai/chat-completion.vision')); |
| 5443 | case chat_completion_sources.POLLINATIONS: | 5443 | case chat_completion_sources.POLLINATIONS: |
| 5444 | return (Array.isArray(model_list) && model_list.find(m => m.id === oai_settings.pollinations_model)?.vision); | 5444 | return (Array.isArray(model_list) && model_list.find(m => m.id === oai_settings.pollinations_model)?.vision); |
| 5445 | case chat_completion_sources.MOONSHOT: | 5445 | case chat_completion_sources.MOONSHOT: |
| @@ -6086,6 +6086,7 @@ export function initOpenAI() { | |||
| 6086 | 6086 | ||
| 6087 | $('#custom_prompt_post_processing').on('change', function () { | 6087 | $('#custom_prompt_post_processing').on('change', function () { |
| 6088 | oai_settings.custom_prompt_post_processing = String($(this).val()); | 6088 | oai_settings.custom_prompt_post_processing = String($(this).val()); |
| 6089 | updateFeatureSupportFlags(); | ||
| 6089 | saveSettingsDebounced(); | 6090 | saveSettingsDebounced(); |
| 6090 | }); | 6091 | }); |
| 6091 | 6092 | ||
| @@ -626,6 +626,13 @@ export class ToolManager { | |||
| 626 | } | 626 | } |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | if (oai_settings.chat_completion_source === chat_completion_sources.AIMLAPI && Array.isArray(model_list)) { | ||
| 630 | const currentModel = model_list.find(model => model.id === oai_settings.aimlapi_model); | ||
| 631 | if (Array.isArray(currentModel?.features)) { | ||
| 632 | return currentModel.features.includes('openai/chat-completion.function'); | ||
| 633 | } | ||
| 634 | } | ||
| 635 | |||
| 629 | const supportedSources = [ | 636 | const supportedSources = [ |
| 630 | chat_completion_sources.OPENAI, | 637 | chat_completion_sources.OPENAI, |
| 631 | chat_completion_sources.CUSTOM, | 638 | chat_completion_sources.CUSTOM, |