AIN. - AnythingLLM AI

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

AIN. - AnythingLLM AI

AIN.GetFolder

Previous Top Next


MiniRobotLanguage (MRL)

 

AIN.GetFolder
Get the Current Working Folder Path

 

Intention

 

GetFolder Command: Retrieve Working Directory
 
The AIN.GetFolder Command retrieves the current working folder path used by the AnythingLLM API or script environment, storing it in a specified variable.

This aids in file handling tasks, such as locating images or logs, within the AIN - AnythingLLM AI suite.

 

What is the GetFolder Command?

 

The AIN.GetFolder Command returns the current working directory path, typically the base directory where the script or AnythingLLM instance operates.

It�s useful for constructing filepaths (e.g., for AIN.AskV) or verifying the execution context.

 

Why Do You Need It?

 

This Command supports:

File Management: Locate or reference files relative to the working directory.

Automation: Ensure scripts use the correct base path for local resources.

Debugging: Verify the runtime environment�s context.

 

How to Use the GetFolder Command?

 

Call AIN.GetFolder with a variable to store the current working folder path. No additional setup is required beyond the AnythingLLM environment.

 

Example Usage

 

AIN.GetFolder|$$DIR

DBP.Current Folder: $$DIR

Stores the working folder path (e.g., "C:\AnythingLLM") in $$DIR.

 

 

 

Syntax

 

AIN.GetFolder|P1

 

Parameter Explanation

 

P1 - Variable to store the folder path (required), e.g., "$$DIR".

 

Example

 

AIN.GetFolder|$$PATH

AIN.AskV|What�s in this?|$$PATH\image.jpg|$$RES

DBP.Image Content: $$RES

ENR.

Uses the folder path to construct a filepath for a vision request.

 

Remarks

 

- Returns the script�s or AnythingLLM�s current working directory, depending on context.

- Path format uses backslashes (e.g., "C:\path") on Windows.

 

Limitations

 

- Reflects the runtime environment; may differ if AnythingLLM runs in a container (e.g., Docker).

- Does not retrieve remote or API-specific paths.

 

See also:

 

? AIN.AskV

? AIN.SetModel

? AIN.SetKey