Skip to content

Hostname for calling service #526

Open
shershkop-ironclad wants to merge 4 commits into
mainfrom
shershkop/add-embedding-region-hostname
Open

Hostname for calling service #526
shershkop-ironclad wants to merge 4 commits into
mainfrom
shershkop/add-embedding-region-hostname

Conversation

@shershkop-ironclad
Copy link
Copy Markdown
Contributor

@shershkop-ironclad shershkop-ironclad commented Sep 22, 2025

Fix to not hardcode hostname for service and also allow embedding to take argument

Copy link
Copy Markdown
Contributor Author

@shershkop-ironclad shershkop-ironclad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review comments from local validation.

@@ -1008,7 +1007,8 @@ export const ChatNodeBase = {
const isMultiResponse = data.useNumberOfChoicesInput || (data.numberOfChoices ?? 1) > 1;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant