mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
feat(Ollama Credentials): Add optional API key support to Ollama credentials (Openwebui proxy) (#17857)
This commit is contained in:
committed by
GitHub
parent
c4c46b8ff9
commit
acfb79bd97
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user