Ai Assistant Personalities

An AI Assistant Personality defines a system prompt used to customize the in-app AI Assistant.

List Ai Assistant Personalities

SDK Function

AiAssistantPersonality.list()

Return Object

ListIterator<AiAssistantPersonality>

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.AiAssistantPersonality;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<AiAssistantPersonality> aiAssistantPersonalities = AiAssistantPersonality.list(parameters);
  for (AiAssistantPersonality aiAssistantPersonality : aiAssistantPersonalities.listAutoPaging()) {
    // Operate on aiAssistantPersonality
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Ai Assistant Personality

SDK Function

AiAssistantPersonality.find()

Return Object

AiAssistantPersonality

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDescription
id
int64
Required
Ai Assistant Personality ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.AiAssistantPersonality;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  AiAssistantPersonality aiAssistantPersonality = AiAssistantPersonality.find(id, parameters);
  // Operate on aiAssistantPersonality
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create Ai Assistant Personality

SDK Function

AiAssistantPersonality.create()

Return Object

AiAssistantPersonality

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Function Arguments

ArgumentDefaultDescription
apply_to_all_workspaces
boolean
falseIf true, this default-workspace personality can apply to users in all workspaces.
name
string
Required
AI Assistant Personality name.
system_prompt
string
Required
System prompt injected into the in-app AI Assistant.
use_by_default
boolean
falseWhether this personality is the default personality for the Workspace.
workspace_id
int64
0Workspace ID. 0 means the default workspace.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.AiAssistantPersonality;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Concise Assistant");
  parameters.put("system_prompt", "Respond as a concise operations assistant.");
  
  AiAssistantPersonality aiAssistantPersonality = AiAssistantPersonality.create(parameters);
  // Operate on aiAssistantPersonality
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update Ai Assistant Personality

SDK Function

aiAssistantPersonality.update();

Return Object

AiAssistantPersonality

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Attribute Setters

SetterDescription
setApplyToAllWorkspaces
boolean
If true, this default-workspace personality can apply to users in all workspaces.
setName
string
AI Assistant Personality name.
setSystemPrompt
string
System prompt injected into the in-app AI Assistant.
setUseByDefault
boolean
Whether this personality is the default personality for the Workspace.
setWorkspaceId
int64
Workspace ID. 0 means the default workspace.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.AiAssistantPersonality;

try {
  // Find the aiAssistantPersonality object by its id.
  AiAssistantPersonality aiAssistantPersonality = AiAssistantPersonality.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("apply_to_all_workspaces", false);
  aiAssistantPersonality.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete Ai Assistant Personality

SDK Function

aiAssistantPersonality.delete();

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.AiAssistantPersonality;

try {
  // Find the aiAssistantPersonality object by its id.
  AiAssistantPersonality aiAssistantPersonality = AiAssistantPersonality.find(id, null);
  aiAssistantPersonality.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The AiAssistantPersonality Object

Some of the functions above return a AiAssistantPersonality object. The attributes of this object are listed below.

AttributeDescription
id
int64
AI Assistant Personality ID.
workspace_id
int64
Workspace ID. 0 means the default workspace.
name
string
AI Assistant Personality name.
system_prompt
string
System prompt injected into the in-app AI Assistant.
use_by_default
boolean
Whether this personality is the default personality for the Workspace.
apply_to_all_workspaces
boolean
If true, this default-workspace personality can apply to users in all workspaces.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.