2023-11-29 03:13:55 -08:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class GooglePalmApi implements ICredentialType {
|
|
|
|
name = 'googlePalmApi';
|
|
|
|
|
2024-04-15 04:56:44 -07:00
|
|
|
displayName = 'Google Gemini(PaLM) Api';
|
2023-11-29 03:13:55 -08:00
|
|
|
|
2024-01-09 05:50:00 -08:00
|
|
|
documentationUrl = 'google';
|
2023-11-29 03:13:55 -08:00
|
|
|
|
|
|
|
properties: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Host',
|
|
|
|
name: 'host',
|
|
|
|
required: true,
|
|
|
|
type: 'string',
|
|
|
|
default: 'https://generativelanguage.googleapis.com',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: { password: true },
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
qs: {
|
|
|
|
key: '={{$credentials.apiKey}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
2024-04-15 04:56:44 -07:00
|
|
|
baseURL: '={{$credentials.host}}/v1beta/models',
|
2023-11-29 03:13:55 -08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|