AiAssistant.constants.ts46 lines · main
| 1 | import { SupportedAssistantEntities } from './AIAssistant.types' |
| 2 | |
| 3 | export const ASSISTANT_ERRORS = { |
| 4 | 'context-exceeded': { |
| 5 | message: |
| 6 | 'This conversation has become too long for the Assistant to process. Please start a new chat to continue.', |
| 7 | }, |
| 8 | default: { |
| 9 | message: 'If the error persists while retrying, you may try creating a new chat and try again.', |
| 10 | }, |
| 11 | } |
| 12 | |
| 13 | export const ASSISTANT_SUPPORT_ENTITIES: { |
| 14 | id: SupportedAssistantEntities |
| 15 | label: string |
| 16 | name: string |
| 17 | }[] = [ |
| 18 | { id: 'rls-policies', label: 'RLS Policies', name: 'RLS policy' }, |
| 19 | { id: 'functions', label: 'Functions', name: 'database function' }, |
| 20 | ] |
| 21 | |
| 22 | export const SAFE_FUNCTIONS = [ |
| 23 | 'count(', |
| 24 | 'sum(', |
| 25 | 'avg(', |
| 26 | 'min(', |
| 27 | 'max(', |
| 28 | 'coalesce(', |
| 29 | 'nullif(', |
| 30 | 'current_timestamp', |
| 31 | 'current_date', |
| 32 | 'length(', |
| 33 | 'lower(', |
| 34 | 'upper(', |
| 35 | 'trim(', |
| 36 | 'substring(', |
| 37 | 'to_char(', |
| 38 | 'to_date(', |
| 39 | 'extract(', |
| 40 | 'date(', |
| 41 | 'date_trunc(', |
| 42 | 'string_agg(', |
| 43 | 'in (', |
| 44 | 'now(', |
| 45 | 'left(', |
| 46 | ] |