UNPKG

n8n-nodes-ionos

Version:

n8n nodes for IONOS DNS, Domain, SSL/Certificate management, Cloud AI, Cloud Infrastructure, Container Registry, Database as a Service, CDN, VPN Gateway, Activity Log, Billing, Logging, Monitoring, Object Storage Management, Network File Storage, Identity

68 lines (67 loc) 2.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IonosCloudAiApi = void 0; class IonosCloudAiApi { name = 'ionosCloudAiApi'; displayName = 'IONOS Cloud AI API'; documentationUrl = 'https://docs.ionos.com/cloud/ai/ai-model-hub'; properties = [ { displayName: 'API Token', name: 'apiToken', type: 'string', typeOptions: { password: true }, default: '', required: true, description: 'The Bearer token for IONOS Cloud AI Model Hub API', }, { displayName: 'API Type', name: 'apiType', type: 'options', options: [ { name: 'Native API', value: 'native', description: 'IONOS AI Model Hub native API', }, { name: 'OpenAI Compatible', value: 'openai', description: 'OpenAI-compatible API endpoints', }, ], default: 'native', description: 'The type of API to use', }, { displayName: 'Region', name: 'region', type: 'options', options: [ { name: 'Berlin (de-txl)', value: 'de-txl', }, ], default: 'de-txl', description: 'The region for the API', }, ]; authenticate = { type: 'generic', properties: { headers: { Authorization: '="Bearer " + $credentials.apiToken', }, }, }; test = { request: { baseURL: '={{$credentials.apiType === "openai" ? "https://openai.inference." + $credentials.region + ".ionos.com" : "https://inference." + $credentials.region + ".ionos.com"}}', url: '={{$credentials.apiType === "openai" ? "/v1/models" : "/models"}}', method: 'GET', }, }; } exports.IonosCloudAiApi = IonosCloudAiApi;