@websolutespa/payload-plugin-bowl-llm
Version:
LLM plugin for Bowl PayloadCms plugin
55 lines (54 loc) • 1.66 kB
JavaScript
import { isRole, isTenant, roles } from '@websolutespa/payload-plugin-bowl';
import { options } from '../options';
export const LlmKbFile = {
type: 'withCollection',
slug: options.slug.llmKbFile,
admin: {
group: options.group.llm,
defaultColumns: [
'id',
'llmApp',
'appTool',
'filename'
],
listSearchableFields: [
'llmApp',
'appTool'
],
components: {
beforeListTable: [
'@websolutespa/payload-plugin-bowl-llm/client#BtnGenerateKbVectorDb'
]
}
},
access: {
create: (args)=>isRole(roles.Admin, options.roles.LlmEditor, options.roles.LlmContributor)(args),
read: (args)=>isRole(roles.Admin)(args) || isTenant(options.slug.llmKbFile)(args),
// read: (): boolean => true,
update: (args)=>isRole(roles.Admin)(args) || isTenant(options.slug.llmKbFile)(args),
delete: (args)=>isRole(roles.Admin)(args) || isTenant(options.slug.llmKbFile)(args)
},
upload: true,
fields: [
// inherited fields: id, createdAt, updatedAt
{
type: 'withIsActive'
},
{
name: 'llmApp',
type: 'relationship',
relationTo: options.slug.llmApp,
required: true
},
{
name: 'appTool',
type: 'withText',
admin: {
components: {
Field: '@websolutespa/payload-plugin-bowl-llm/client#AppTool'
}
}
}
]
};
//# sourceMappingURL=LlmKbFile.js.map