AIN. - AnythingLLM AI

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

AIN. - AnythingLLM AI

AIN.GetWorkspaceBySlug

Previous Top Next


MiniRobotLanguage (MRL)

 

AIN.GetWorkspaceBySlug
Retrieve Workspace Details by Slug

 

Intention

 

GetWorkspaceBySlug Command: Fetch Specific Workspace Info
 
The GetWorkspaceBySlug command retrieves detailed information about a specific workspace in AnythingLLM using its unique slug.

This is crucial for inspecting or managing a particular workspace before performing operations like chatting or deletion.

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

 

What is the GetWorkspaceBySlug Command?

 

This command queries the AnythingLLM API for details of a workspace identified by its slug, returning the response in JSON format.

The details can be stored in a variable or on the stack, providing access to attributes like name, slug, and settings.

 

Why Do You Need It?

 

Fetching a workspace by slug is useful for:

Inspection: Review the settings or status of a specific workspace.

Preparation: Gather details before executing chats or managing content.

Validation: Confirm a workspace exists before further operations.

 

How to Use the GetWorkspaceBySlug Command?

 

Specify the workspace slug and optionally a variable to store the response.

It uses the endpoint set by AIN.SetChatEndpoint (default: http://localhost:3001/api/workspace/{slug}).

 

Example Usage

 

AIN.GetWorkspaceBySlug|my-workspace|$$RES

DBP.Workspace Details: $$RES

 

This stores the JSON details of "my-workspace" in $$RES.

 

Illustration

 

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

│ Workspace       │

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

│ {slug: "my-ws"} │

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

Fetching details for a specific workspace.

 

Syntax

 

AIN.GetWorkspaceBySlug|P1[|P2]

AIN.GWS|P1[|P2]

 

Parameter Explanation

 

P1 - (Required) The unique slug of the workspace to retrieve.

P2 - (Optional) Variable to store the workspace details; if omitted, stored on the stack.

 

Example

 

AIN.GetWorkspaceBySlug|my-workspace|$$DET

DBP.Workspace Info: $$DET

ENR.

 

Remarks

 

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

- Returns a JSON object with workspace attributes like name and slug.

 

Limitations

 

- Parameter count is restricted to 2 or 3; excess parameters cause an error.

- Returns an error if the slug does not match an existing workspace.

 

See also:

 

AIN.ListWorkspaces

AIN.CreateWorkspace

AIN.DeleteWorkspace

AIN.SetKey