feat(Ollama Credentials): Add optional API key support to Ollama credentials (Openwebui proxy) (#17857)

This commit is contained in:
Julian van der Horst
2025-08-05 17:25:19 +02:00
committed by GitHub
parent c4c46b8ff9
commit acfb79bd97
4 changed files with 43 additions and 2 deletions

View File

@@ -49,10 +49,16 @@ export class EmbeddingsOllama implements INodeType {
this.logger.debug('Supply data for embeddings Ollama');
const modelName = this.getNodeParameter('model', itemIndex) as string;
const credentials = await this.getCredentials('ollamaApi');
const headers = credentials.apiKey
? {
Authorization: `Bearer ${credentials.apiKey as string}`,
}
: undefined;
const embeddings = new OllamaEmbeddings({
baseUrl: credentials.baseUrl as string,
model: modelName,
headers,
});
return {