ドキュメント

インテグレーション

設定へのアクセス

ベータ版機能

プラグインサポートは現在プライベートベータ版です。こちらからベータ版に参加してください。

それぞれ、メソッド ctl.getPluginConfig(configSchematics) および ctl.getGlobalConfig(globalConfigSchematics) を使用して設定にアクセスできます。

例えば、promptPreprocessor内で設定にアクセスする方法は次のとおりです。

import { type PreprocessorController, type ChatMessage } from "@lmstudio/sdk";
import { configSchematics } from "./config";

export async function preprocess(ctl: PreprocessorController, userMessage: ChatMessage) {
  const pluginConfig = ctl.getPluginConfig(configSchematics);
  const myCustomField = pluginConfig.get("myCustomField");

  const globalPluginConfig = ctl.getGlobalPluginConfig(configSchematics);
  const globalMyCustomField = globalPluginConfig.get("myCustomField");

  return (
    `${userMessage.getText()},` +
    `myCustomField: ${myCustomField}, ` +
    `globalMyCustomField: ${globalMyCustomField}`
  );
}

このページのソースは GitHub で利用可能です。