n8n-nodes-lmstudio-embeddings
Version:
n8n community node for LM Studio Embeddings API with encoding format selection
54 lines (53 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LMStudioApi = void 0;
class LMStudioApi {
constructor() {
this.name = 'lmStudioApi';
this.displayName = 'LM Studio API';
this.documentationUrl = 'https://lmstudio.ai/docs';
this.properties = [
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'http://localhost:1234/v1',
description: 'Base URL for LM Studio server',
},
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
description: 'API Key for LM Studio (optional for local server)',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
Authorization: 'Bearer {{$credentials.apiKey}}',
},
},
};
this.test = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/models',
method: 'GET',
},
rules: [
{
type: 'responseSuccessBody',
properties: {
key: 'data',
message: 'Connection established successfully',
value: [],
},
},
],
};
}
}
exports.LMStudioApi = LMStudioApi;