Ai Assistant Personalities

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

List Ai Assistant Personalities

SDK Method

\Files\Model\AiAssistantPersonality::list;

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.

Additional Arguments

Example Request

try {
  $ai_assistant_personalities = \Files\Model\AiAssistantPersonality::list();
  foreach ($ai_assistant_personalities as $ai_assistant_personality) {
    // Operate on $ai_assistant_personality
  }
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Show Ai Assistant Personality

SDK Method

\Files\Model\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.

Method Arguments

ArgumentDescription
id
int64
Required
Ai Assistant Personality ID.

Example Request

try {
  $ai_assistant_personality = \Files\Model\AiAssistantPersonality::find($id);
  // Operate on $ai_assistant_personality
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Create Ai Assistant Personality

SDK Method

\Files\Model\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.

Method 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

try {
  $ai_assistant_personality = \Files\Model\AiAssistantPersonality::create([
    'name' => "Concise Assistant",
    'system_prompt' => "Respond as a concise operations assistant."
  ]);
  // Operate on $ai_assistant_personality
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Update Ai Assistant Personality

SDK Method

$ai_assistant_personality->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.

Method Arguments

ArgumentDescription
apply_to_all_workspaces
boolean
If true, this default-workspace personality can apply to users in all workspaces.
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.
workspace_id
int64
Workspace ID. 0 means the default workspace.

Example Request

try {
  // Find the ai_assistant_personality object by its id.
  $ai_assistant_personality = \Files\Model\AiAssistantPersonality::find(id);
  $ai_assistant_personality->update([
    'apply_to_all_workspaces' => false
  ]);
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Delete Ai Assistant Personality

SDK Method

$ai_assistant_personality->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

try {
  // Find the ai_assistant_personality object by its id.
  $ai_assistant_personality = \Files\Model\AiAssistantPersonality::find(id);
  $ai_assistant_personality->delete();
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

The AiAssistantPersonality Object

Some of the methods 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.