custom-request: Pass api-url for Z.AI and Vertex and fix if omitted in profile (#4859)
Signed| @@ -590,6 +590,12 @@ export class ChatCompletionService { | ||
| 590 | 590 | settings[settingToUpdate[1]] = value; |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | + // Ensure api-url is properly applied for all sources that accept it | |
| 594 | + ['custom_url', 'vertexai_region', 'zai_endpoint'].forEach(field => { | |
| 595 | + // The order is: connection profile => CC preset => CC settings | |
| 596 | + overridePayload[field] = overridePayload[field] || settings[field] || oai_settings[field]; | |
| 597 | + }); | |
| 598 | + | |
| 593 | 599 | // Convert from settings to generation payload |
| 594 | 600 | const data = await createGenerationParameters(settings, overridePayload.model, 'quiet', overridePayload.messages); |
| 595 | 601 | const payload = data.generate_data; |
| @@ -417,6 +417,8 @@ export class ConnectionManagerRequestService { | ||
| 417 | 417 | model: profile.model, |
| 418 | 418 | chat_completion_source: selectedApiMap.source, |
| 419 | 419 | custom_url: profile['api-url'], |
| 420 | + vertexai_region: profile['api-url'], | |
| 421 | + zai_endpoint: profile['api-url'], | |
| 420 | 422 | reverse_proxy: proxyPreset?.url, |
| 421 | 423 | proxy_password: proxyPreset?.password, |
| 422 | 424 | custom_prompt_post_processing: profile['prompt-post-processing'], |