feat(Groq Chat Model Node): Add support for Groq chat models (#9250)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
oleg
2024-04-30 09:37:30 +02:00
committed by GitHub
parent abae63574b
commit 96f02bd655
7 changed files with 276 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class GroqApi implements ICredentialType {
name = 'groqApi';
displayName = 'Groq';
documentationUrl = 'groq';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.groq.com/openai/v1',
url: '/models',
},
};
}