Support image inlining for 01.ai
| @@ -1770,7 +1770,7 @@ | ||
| 1770 | 1770 | </div> |
| 1771 | 1771 | </label> |
| 1772 | 1772 | </div> |
| 1773 | 1773 | <div class="range-block" data-source="openai,openrouter,makersuite,claude,custom,01ai"> |
| 1774 | 1774 | <label for="openai_image_inlining" class="checkbox_label flexWrap widthFreeExpand"> |
| 1775 | 1775 | <input id="openai_image_inlining" type="checkbox" /> |
| 1776 | 1776 | <span data-i18n="Send inline images">Send inline images</span> |
| @@ -4298,7 +4298,17 @@ async function onModelChange() { | ||
| 4298 | 4298 | if (oai_settings.chat_completion_source === chat_completion_sources.ZEROONEAI) { |
| 4299 | 4299 | if (oai_settings.max_context_unlocked) { |
| 4300 | 4300 | $('#openai_max_context').attr('max', unlocked_max); |
| 4301 | 4301 | } else { |
| 4302 | + else if (['yi-large'].includes(oai_settings.zerooneai_model)) { | |
| 4303 | + $('#openai_max_context').attr('max', max_32k); | |
| 4304 | + } | |
| 4305 | + else if (['yi-vision'].includes(oai_settings.zerooneai_model)) { | |
| 4306 | + $('#openai_max_context').attr('max', max_16k); | |
| 4307 | + } | |
| 4308 | + else if (['yi-large-turbo'].includes(oai_settings.zerooneai_model)) { | |
| 4309 | + $('#openai_max_context').attr('max', max_4k); | |
| 4310 | + } | |
| 4311 | + else { | |
| 4302 | 4312 | $('#openai_max_context').attr('max', max_16k); |
| 4303 | 4313 | } |
| 4304 | 4314 | |
| @@ -4665,6 +4675,7 @@ export function isImageInliningSupported() { | ||
| 4665 | 4675 | 'gpt-4-turbo', |
| 4666 | 4676 | 'gpt-4o', |
| 4667 | 4677 | 'gpt-4o-mini', |
| 4678 | + 'yi-vision', | |
| 4668 | 4679 | ]; |
| 4669 | 4680 | |
| 4670 | 4681 | switch (oai_settings.chat_completion_source) { |
| @@ -4678,6 +4689,8 @@ export function isImageInliningSupported() { | ||
| 4678 | 4689 | return !oai_settings.openrouter_force_instruct; |
| 4679 | 4690 | case chat_completion_sources.CUSTOM: |
| 4680 | 4691 | return true; |
| 4692 | + case chat_completion_sources.ZEROONEAI: | |
| 4693 | + return visionSupportedModels.some(model => oai_settings.zerooneai_model.includes(model)); | |
| 4681 | 4694 | default: |
| 4682 | 4695 | return false; |
| 4683 | 4696 | } |