插件

报告

4 星标

1.4K 下载量

LM Studio 原生 RAG 插件,应用程序内置

src / index.ts

import { type PluginContext } from "@lmstudio/sdk";
import { configSchematics } from "./config";
import { preprocess } from "./promptPreprocessor";

// This is the entry point of the plugin. The main function is to register different components of
// the plugin, such as promptPreprocessor, predictionLoopHandler, etc.
//
// You do not need to modify this file unless you want to add more components to the plugin, and/or
// add custom initialization logic.

export async function main(context: PluginContext) {
  // Register the configuration schematics.
  context.withConfigSchematics(configSchematics);
  // Register the promptPreprocessor.
  context.withPromptPreprocessor(preprocess);
}