twenty / packages /twenty-shared /src /utils /fieldMetadata /shouldExcludeFieldFromAgentToolSchema.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
593 Bytes
import { EXCLUDED_FIELD_NAMES_FROM_AGENT_TOOL_SCHEMA } from '@/constants';
export const shouldExcludeFieldFromAgentToolSchema = ({
fieldName,
isSystem,
excludeId = true,
additionalExcludedFieldNames = [],
}: {
fieldName: string;
isSystem: boolean;
excludeId?: boolean;
additionalExcludedFieldNames?: string[];
}): boolean => {
const excludedFieldNames = [
...EXCLUDED_FIELD_NAMES_FROM_AGENT_TOOL_SCHEMA,
...additionalExcludedFieldNames,
];
if (excludeId) {
excludedFieldNames.push('id');
}
return excludedFieldNames.includes(fieldName) || isSystem;
};