@websolutespa/payload-plugin-bowl-llm
Version:
LLM plugin for Bowl PayloadCms plugin
166 lines (165 loc) • 4.32 kB
JavaScript
import { options } from '../../options';
import { withIntegration } from './withIntegration';
export const LlmKbApi = withIntegration(options.slug.llmKbApi, [
{
name: 'url',
type: 'withText',
label: 'API URL',
required: true
},
{
name: 'method',
type: 'select',
label: 'HTTP Method',
defaultValue: 'GET',
options: [
{
label: 'GET',
value: 'GET'
},
{
label: 'POST',
value: 'POST'
},
{
label: 'PUT',
value: 'PUT'
},
{
label: 'DELETE',
value: 'DELETE'
},
{
label: 'PATCH',
value: 'PATCH'
}
]
},
{
name: 'headers',
type: 'json',
label: 'Custom Headers'
},
{
name: 'params',
type: 'json',
label: 'Query Parameters'
},
{
name: 'body',
type: 'json',
label: 'Request Body',
admin: {
condition: (_, siblingData)=>[
'POST',
'PUT',
'PATCH'
].includes(siblingData?.method)
}
},
{
name: 'auth',
type: 'group',
label: 'Authentication',
fields: [
{
name: 'type',
type: 'select',
label: 'Authentication Type',
defaultValue: 'none',
options: [
{
label: 'None',
value: 'none'
},
{
label: 'Bearer Token',
value: 'bearer'
},
{
label: 'Basic Auth',
value: 'basic'
},
{
label: 'API Key',
value: 'api_key'
},
{
label: 'Custom',
value: 'custom'
}
]
},
{
name: 'token',
type: 'withText',
label: 'Token / API Key',
admin: {
condition: (_, siblingData)=>[
'bearer',
'api_key'
].includes(siblingData?.type)
}
},
{
name: 'username',
type: 'withText',
label: 'Username',
admin: {
condition: (_, siblingData)=>siblingData?.type === 'basic'
}
},
{
name: 'password',
type: 'withText',
label: 'Password',
admin: {
condition: (_, siblingData)=>siblingData?.type === 'basic'
}
},
{
name: 'headerName',
type: 'withText',
label: 'Header Name',
admin: {
condition: (_, siblingData)=>siblingData?.type === 'api_key'
}
},
{
name: 'prefix',
type: 'withText',
label: 'Prefix',
admin: {
condition: (_, siblingData)=>[
'bearer',
'api_key'
].includes(siblingData?.type)
}
}
]
},
{
name: 'responseDataPath',
type: 'withText',
label: 'Response Data Path'
},
{
name: 'maxRetries',
type: 'number',
label: 'Max Retries',
defaultValue: 5
},
{
name: 'retryDelay',
type: 'number',
label: 'Retry Delay (seconds)',
defaultValue: 1.0
},
{
name: 'timeout',
type: 'number',
label: 'Timeout (seconds)',
defaultValue: 30
}
]);
//# sourceMappingURL=LlmKbApi.js.map