| 326 | function formatTextGenURL(value) { | 326 | function formatTextGenURL(value) { |
| 327 | try { | 327 | try { |
| 328 | const noFormatTypes = [MANCER, TOGETHERAI, INFERMATICAI, DREAMGEN, OPENROUTER]; | 328 | const noFormatTypes = [MANCER, TOGETHERAI, INFERMATICAI, DREAMGEN, OPENROUTER]; |
| | 329 | const legacyApiTypes = [OOBA, APHRODITE]; |
| 329 | if (noFormatTypes.includes(settings.type)) { | 330 | if (noFormatTypes.includes(settings.type)) { |
| 330 | return value; | 331 | return value; |
| 331 | } | 332 | } |
| 332 | | 333 | |
| 333 | const url = new URL(value); | 334 | const url = new URL(value); |
| 334 | if (url.pathname === '/api' && !settings.legacy_api) { | 335 | if (legacyApiTypes.includes(settings.type)) { |
| 335 | toastr.info('Enable Legacy API or start Ooba with the OpenAI extension enabled.', 'Legacy API URL detected. Generation may fail.', { preventDuplicates: true, timeOut: 10000, extendedTimeOut: 20000 }); | 336 | if (url.pathname === '/api' && !settings.legacy_api) { |
| 336 | url.pathname = ''; | 337 | toastr.info('Enable Legacy API or start Ooba with the OpenAI extension enabled.', 'Legacy API URL detected. Generation may fail.', { preventDuplicates: true, timeOut: 10000, extendedTimeOut: 20000 }); |
| 337 | } | 338 | url.pathname = ''; |
| | 339 | } |
| 338 | | 340 | |
| 339 | if (!power_user.relaxed_api_urls && settings.legacy_api) { | 341 | if (!power_user.relaxed_api_urls && settings.legacy_api) { |
| 340 | url.pathname = '/api'; | 342 | url.pathname = '/api'; |
| | 343 | } |
| 341 | } | 344 | } |
| 342 | return url.toString(); | 345 | return url.toString(); |
| 343 | } catch { | 346 | } catch { |