IntelligenceService API
Intelligence Service is responsible with providing DataSapien's patented three tier on-edge intelligence approach. Intelligence Service allows access to:
- Rules - these are first level of intelligence and static in nature
- ML Models - conventional probabilistic models designed to work in a specific field
- AI Models - Generative AI Models designed to work in a wide range of fields
To access IntelligenceService functions; get its instance from DataSapien object: DataSapien.getIntelligenceService().
Functions (JavaScript)
| Public functions | |
Promise <boolean> | Checks whether model files for the given model name are already downloaded. Parameters
|
Promise <void> | Loads the specified model into memory with optional parameters. Parameters
|
Promise <void> | Unloads the currently loaded model and releases memory. Parameters
|
Promise <void> | Downloads model files and optionally reports progress. Parameters
|
Promise <void> | Deletes all downloaded local files for the given model. Parameters
|
Promise <string> | Sends prompts to the model and returns the generated output. Parameters
|
Promise <Prompt | null> | Returns a generated Prompt object derived from MeData. Parameters
|
Promise <void> | Synchronizes rule definitions with the Orchestrator. Parameters
|
Promise <Rule[]> | Returns all stored rules. Parameters
|
Promise <Rule | null> | Retrieves a rule by its name. Parameters
|
Promise <Rule | null> | Evaluates a rule and returns its updated state. Parameters
|
Promise <Rule[]> | Evaluates multiple rules at once. Parameters
|
Promise <void> | Synchronizes the list of managed AI models with the Orchestrator. Parameters
|
Promise <ManagedAIModel[]> | Retrieves all managed AI models stored locally. Parameters
|
Promise <ManagedAIModel | null> | Retrieves a specific managed AI model by name. Parameters
|
Classes (JavaScript)
InferenceParams (JavaScript)
{
temperature?: number;
maxTokens?: number;
}
ModelParams (JavaScript)
{
nCtx?: number;
nBatchSize?: number;
nThreads?: number;
nGpuLayers?: number;
}
ManagedAIModel (JavaScript)
{
id: string;
name: string;
text: string;
vendor?: string | null;
description?: string | null;
downloadUrl: string;
imageUrl?: string | null;
multimodal?: boolean | null;
mmProjDownloadUrl?: string | null;
}
Rule (JavaScript)
{
id: string;
name: string;
text: string;
description?: string | null;
trigger: string;
condition: Filter;
action: Action;
}
Action (JavaScript)
{
type: string;
config?: ActionConfig | null;
}
ActionConfig (JavaScript)
{
id: string;
script?: Script | null;
event?: string | null;
title?: string | null;
message?: string | null;
}
Criteria (JavaScript)
{
field: string;
criteriaOperator: string;
value: string;
}
Filter (JavaScript)
{
type?: string | null;
filters?: Filter[] | null;
filter?: Filter | null;
criteria?: Criteria | null;
}
Prompt (JavaScript)
{
role: Role;
content: string;
attachment?: string | null;
}