@activadee/n8n-nodes-gradio-client
Version:
n8n node for connecting to Gradio Spaces
43 lines (42 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HuggingFaceApi = void 0;
class HuggingFaceApi {
constructor() {
this.name = 'huggingFaceApi';
this.displayName = 'HuggingFace API';
this.documentationUrl = 'https://huggingface.co/docs/api-inference/quicktour';
this.properties = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true,
},
default: '',
required: true,
placeholder: 'hf_...',
description: 'Your HuggingFace API token',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
this.test = {
request: {
baseURL: 'https://huggingface.co',
url: '/api/whoami-v2',
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
}
}
exports.HuggingFaceApi = HuggingFaceApi;