Skip to content

Merged Documentation

Documentation for init_nltk

Functionality

Initializes NLTK by ensuring that the 'punkt' tokenizer is downloaded. This tokenizer is necessary for sentence tokenization in NLTK.

Parameters

None.

Usage

  • Purpose: Ensures NLTK has the required tokenizer.

Example

>>> init_nltk()

Documentation for init_plugin_manager

Functionality

Initialize the plugin manager by discovering available plugins and setting them up. This function performs the following: 1. Discovers plugins in the directory specified by ES_PLUGINS_PATH. 2. For each plugin listed in INFERENCE_USED_PLUGINS, it retrieves the plugin instance, calls its inference client factory, and examines available vector database optimizations. 3. Applies optimizations (both regular and query-based, if present) to the vector database.

Parameters

This function does not require any parameters.

Usage

  • Purpose: Prepare and initialize plugins for inference and vector database enhancements.

Example

>>> init_plugin_manager()

Documentation for init_background_scheduler

Functionality

Initializes a background scheduler to run a task periodically. If no scheduler exists, a new BackgroundScheduler is created, the task is added with a given interval, and the scheduler is started.

Parameters

  • task: A callable function to be scheduled.
  • seconds_interval: Interval in seconds between task executions.

Usage

  • Purpose: Schedule a recurring background task.

Example

def my_task():
    print("Task executed")

init_background_scheduler(my_task, 30)