Hostname for calling service #526
Conversation
shershkop-ironclad
left a comment
There was a problem hiding this comment.
Review comments from local validation.
| @@ -1008,7 +1007,8 @@ export const ChatNodeBase = { | |||
| const isMultiResponse = data.useNumberOfChoicesInput || (data.numberOfChoices ?? 1) > 1; | |||
|
|
|||
There was a problem hiding this comment.
[P0] Restore the default OpenAI URL when openAiEndpoint is blank. openAiEndpoint is normalized to '' by the processor/app settings, so ?? never falls back here. With the default configuration (no custom endpoint set), this now builds /chat/completions instead of https://api.openai.com/v1/chat/completions, and the same pattern in the new assistant/file/thread calls yields relative URLs as well. That breaks ordinary OpenAI usage for anyone who leaves the endpoint empty.
| @@ -1008,7 +1007,8 @@ export const ChatNodeBase = { | |||
| const isMultiResponse = data.useNumberOfChoicesInput || (data.numberOfChoices ?? 1) > 1; | |||
|
|
|||
| // Resolve to final endpoint if configured in ProcessContext | |||
There was a problem hiding this comment.
[P1] Keep openAiEndpoint as a full chat endpoint here. The existing setting, docs, and presets all treat openAiEndpoint as the complete chat completions URL, for example LM Studio's http://localhost:1234/v1/chat/completions or Azure deployment URLs with ?api-version=.... Appending /chat/completions turns those into invalid URLs like .../chat/completions/chat/completions or appends the path after the query string, so custom chat endpoints stop working.
| } | ||
|
|
||
| const response = await fetch(`https://api.openai.com/v1/assistants/${assistantId}`, { | ||
| const baseUrl = context.settings.openAiEndpoint ?? 'https://api.openai.com/v1'; |
There was a problem hiding this comment.
[P2] Do not reuse the chat endpoint as the assistants/files base URL. This is only safe when openAiEndpoint is an API root, but the setting is currently exposed as a Chat-node endpoint and is commonly configured to a full /chat/completions URL. In that case assistant/thread/file nodes now request paths like .../chat/completions/assistants/... instead of OpenAI's API, so enabling a custom chat endpoint breaks these nodes even if they should still talk to the default OpenAI service.
Fix to not hardcode hostname for service and also allow embedding to take argument