Private EventProtected AfterProtected AfterProtected AfterProtected ArrayProtected ArrayOptional contextUser: UserInfoProtected BeforeProtected BeforeProtected BeforeProtected CheckProtected CreateProtected DeleteGenerate embeddings for text using local embedding models. Designed for interactive components that need fast similarity calculations.
System user query for generating embeddings with elevated privileges
Protected EmitExecute a simple prompt without requiring a stored AI Prompt entity. This is designed for interactive components that need quick AI responses.
Optional messages: stringOptional preferredModels: string[]Optional modelPower: stringOptional responseFormat: stringSystem user query for executing simple prompts with elevated privileges
Optional messages: stringOptional preferredModels: string[]Optional modelPower: stringOptional responseFormat: stringProtected FilterFilters encrypted field values before sending to the API client.
For each encrypted field in the entity:
Name of the entity
The data object containing field values
User context for encryption operations
The filtered data object
Protected GetProtected GetProtected ListenProtected MapMaps field names to their GraphQL-safe CodeNames and handles encryption for API responses.
For encrypted fields coming from raw SQL queries (not entity objects):
The entity name
The data object with field values
Optional contextUser: UserInfoOptional user context for decryption (required for encrypted fields)
The processed data object
Public mutation for regular users to run AI prompts with authentication.
Optional data: stringOptional overrideModelId: stringOptional overrideVendorId: stringOptional configurationId: stringOptional skipValidation: booleanOptional templateData: stringOptional responseFormat: stringOptional temperature: numberOptional topP: numberOptional topK: numberOptional minP: numberOptional frequencyPenalty: numberOptional presencePenalty: numberOptional seed: numberOptional stopSequences: string[]Optional includeLogProbs: booleanOptional topLogProbs: numberOptional messages: stringOptional rerunFromPromptRunID: stringOptional systemPromptOverride: stringSystem user query for running AI prompts with elevated privileges. Requires the
Optional data: stringOptional overrideModelId: stringOptional overrideVendorId: stringOptional configurationId: stringOptional skipValidation: booleanOptional templateData: stringOptional responseFormat: stringOptional temperature: numberOptional topP: numberOptional topK: numberOptional minP: numberOptional frequencyPenalty: numberOptional presencePenalty: numberOptional seed: numberOptional stopSequences: string[]Optional includeLogProbs: booleanOptional topLogProbs: numberOptional messages: stringOptional rerunFromPromptRunID: stringOptional systemPromptOverride: stringdecorator to ensure only system users can access.
Protected RunOptimized RunViewGenericInternal implementation with:
Protected RunOptimized implementation that:
Protected TestThis routine compares the OldValues property in the input object to the values in the DB that we just loaded. If there are differences, we need to check to see if the client is trying to update any of those fields (e.g. overlap). If there is overlap, we throw an error. If there is no overlap, we can proceed with the update even if the DB Values and the ClientOldValues are not 100% the same, so long as there is no overlap in the specific FIELDS that are different.
ASSUMES: input object has an OldValues___ property that is an array of Key/Value pairs that represent the old values of the record that the client is trying to update.
Protected UpdatePrivate buildPrivate Helper method to build chat messages from system prompt and optional message history
Optional messagesJson: stringProtected createProtected createPrivate executeAIPromptPrivate Internal method that handles the core AI prompt execution logic. This method is called by both the regular and system user resolvers.
Optional data: stringOptional overrideModelId: stringOptional overrideVendorId: stringOptional configurationId: stringOptional skipValidation: booleanOptional templateData: stringOptional responseFormat: stringOptional temperature: numberOptional topP: numberOptional topK: numberOptional minP: numberOptional frequencyPenalty: numberOptional presencePenalty: numberOptional seed: numberOptional stopSequences: string[]Optional includeLogProbs: booleanOptional topLogProbs: numberOptional messages: stringOptional rerunFromPromptRunID: stringOptional systemPromptOverride: stringProtected findPrivate formatPrivate Helper method to format simple prompt result
Protected getProtected packageSPParamProtected safePrivate selectPrivate selectPrivate Helper method to select a model for simple prompt execution based on preferences or power level
Filters encrypted fields for an array of data objects