n8n-nodes-wxai
Version:
A user-friendly WXAI node for n8n, designed to enhance your workflow with Gemini 2.0 Flash model. Supports chat completions with configurable parameters.
55 lines (54 loc) • 1.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WxaiApi = void 0;
class WxaiApi {
constructor() {
this.name = 'wxaiApi';
this.displayName = 'WXAI API';
this.icon = 'file:wxai.svg';
this.documentationUrl = 'https://cs.rhwx-ai.com/api/ai';
this.properties = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true,
},
required: true,
default: '',
description: 'Your WXAI API key',
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
required: true,
default: 'https://cs.rhwx-ai.com/api/ai/v1',
description: 'The base URL for WXAI API',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
this.test = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/chat/completions',
method: 'POST',
body: {
model: 'gemini-2.0-flash',
messages: [{ role: 'user', content: 'test' }],
max_tokens: 1,
stream: false
},
},
};
}
}
exports.WxaiApi = WxaiApi;