Merge pull request #3706 from bmen25124/custom_request_chat_comp_url Added "custom_url" to ChatCompletionService
Signed| @@ -41,6 +41,7 @@ import { formatInstructModeChat, formatInstructModePrompt, names_behavior_types | ||
| 41 | 41 | * @property {string} chat_completion_source - Source provider for chat completion |
| 42 | 42 | * @property {number} max_tokens - Maximum number of tokens to generate |
| 43 | 43 | * @property {number} [temperature] - Optional temperature parameter for response randomness |
| 44 | + * @property {string} [custom_url] - Optional custom URL for chat completion | |
| 44 | 45 | */ |
| 45 | 46 | |
| 46 | 47 | /** @typedef {Record<string, any> & ChatCompletionPayloadBase} ChatCompletionPayload */ |
| @@ -264,7 +265,7 @@ export class ChatCompletionService { | ||
| 264 | 265 | * @param {ChatCompletionPayload} custom |
| 265 | 266 | * @returns {ChatCompletionPayload} |
| 266 | 267 | */ |
| 267 | 268 | static createRequestData({ messages, model, chat_completion_source, max_tokens, temperature, custom_url, ...props }) { |
| 268 | 269 | const payload = { |
| 269 | 270 | ...props, |
| 270 | 271 | messages, |
| @@ -272,6 +273,7 @@ export class ChatCompletionService { | ||
| 272 | 273 | chat_completion_source, |
| 273 | 274 | max_tokens, |
| 274 | 275 | temperature, |
| 276 | + custom_url, | |
| 275 | 277 | stream: false, |
| 276 | 278 | }; |
| 277 | 279 | |
| @@ -323,6 +323,7 @@ export class ConnectionManagerRequestService { | ||
| 323 | 323 | max_tokens: maxTokens, |
| 324 | 324 | model: profile.model, |
| 325 | 325 | chat_completion_source: selectedApiMap.source, |
| 326 | + custom_url: profile['api-url'], | |
| 326 | 327 | }, { |
| 327 | 328 | presetName: includePreset ? profile.preset : undefined, |
| 328 | 329 | }, extractData); |