AIN. - AnythingLLM AI

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

AIN. - AnythingLLM AI

AIN.CreateWorkspace

Previous Top Next


MiniRobotLanguage (MRL)

 

AIN.CreateWorkspace
Create a New Workspace in AnythingLLM

 

Intention

 

CreateWorkspace Command: Establish a New Workspace
 
The CreateWorkspace command sets up a new workspace in AnythingLLM for organizing chats and documents.

It simplifies managing multiple contexts or projects within the API.

It’s part of the AIN - AnythingLLM AI suite.

 

What is the CreateWorkspace Command?

 

This command sends a request to /api/workspace/new to create a workspace with a specified name, optionally setting a system prompt and max tokens.

It returns a unique slug for the workspace, stored in a variable or on the stack.

 

Why Do You Need It?

 

Creating workspaces is crucial for:

Organization: Separates different projects or contexts within AnythingLLM.

Customization: Allows setting specific prompts or token limits per workspace.

Scalability: Supports multiple concurrent tasks or users.

 

How to Use the CreateWorkspace Command?

 

Provide a workspace name and optionally a system prompt and max tokens. The slug is returned for future reference.

The default endpoint is http://localhost:3001/api/workspace/new.

 

Example Usage

 

AIN.CreateWorkspace|MyWorkspace|Answer as a pirate|2000|$$SLG

DBP.Workspace Slug: $$SLG

 

Creates a workspace named "MyWorkspace" with a pirate-themed prompt and 2000 max tokens.

 

Illustration

 

┌───────────────┐

│ New Workspace │

├───────────────┤

│ Slug: my-ws   │

└───────────────┘

Represents a newly created workspace with its slug.

 

Syntax

 

AIN.CreateWorkspace|P1[|P2][|P3][|P4]

AIN.CRW|P1[|P2][|P3][|P4]

 

Parameter Explanation

 

P1 - (Required) The name of the new workspace.

P2 - (Optional) System prompt for the workspace; defaults to empty if omitted.

P3 - (Optional) Max tokens for responses; defaults to 0 if omitted.

P4 - (Optional) Variable to store the workspace slug; defaults to TOS if omitted.

 

Example

 

AIN.CreateWorkspace|ProjectX|||$$SLG

DBP.New Workspace Slug: $$SLG

ENR.

 

Remarks

 

- Requires a valid API key set via AIN.SetKey.

- The slug is a unique identifier for managing the workspace.

 

Limitations

 

- Workspace name must be unique; duplicates may cause errors.

- Requires network access to the AnythingLLM server.

 

See also:

 

AIN.ListWorkspaces

AIN.GetWorkspaceBySlug

AIN.DeleteWorkspace

Workspace Management