メインコンテンツまでスキップ
バージョン: v2 Next 🚧

インターフェイス: AiConfigOptions

定義: plugins/ai/src/config.ts:223

AiConfig の部分指定。指定しなかった項目は既定値のままです。 ai() のオプションはこれを受け取ります。

プロパティ​

display?​

optional display?: AiDisplayOptions;

定義: plugins/ai/src/config.ts:295

応答の見せ方。指定した項目だけが既定値を上書きします。


instructions?​

optional instructions?: string | null;

定義: plugins/ai/src/config.ts:269

既定のシステム指示。呼び出しごとの instructions が優先されます。

Default​

null

limits?​

optional limits?: AiLimitsOptions;

定義: plugins/ai/src/config.ts:293

数量の上限。指定した項目だけが既定値を上書きします。


maxOutputTokens?​

optional maxOutputTokens?: number | null;

定義: plugins/ai/src/config.ts:273

Default​

null(プロバイダーの既定)

maxSteps?​

optional maxSteps?: number;

定義: plugins/ai/src/config.ts:279

ツール呼び出しを含めて何ステップまで回すか (stopWhen: stepCountIs(maxSteps) になります)。

Default​

5

memory?​

optional memory?: AiMemoryOptions;

定義: plugins/ai/src/config.ts:289

会話履歴の扱い。指定した項目だけが既定値を上書きします。


model?​

optional model?: AiModelInput | null;

定義: plugins/ai/src/config.ts:232

既定のモデル。"<プロバイダー>:<モデルID>" の文字列か、 SDK が返す LanguageModel をそのまま渡します。

既定値はありません。 勝手に課金される先を既定にしないためで、 未設定のまま使うと「設定してください」というエラーになります。

Default​

null

providerLoaders?​

optional providerLoaders?: Readonly<Record<string, AiProviderLoader>>;

定義: plugins/ai/src/config.ts:264

文字列のモデル指定で使えるプロバイダーを足す・差し替える。 builtinProviders に重ねられます。

ai({
model: "groq:llama-3.3-70b-versatile",
providerLoaders: {
groq: {
package: "@ai-sdk/groq",
factory: "createGroq",
apiKeyEnv: "GROQ_API_KEY",
requiresEndpoint: false,
},
},
})

Default​

builtinProviders のみ


providers?​

optional providers?: AiProviders;

定義: plugins/ai/src/config.ts:244

プロバイダーの接続設定。API キーを省略すると各 SDK の既定の 環境変数が使われます。

Default​

{}

registry?​

optional registry?: AiRegistry | null;

定義: plugins/ai/src/config.ts:238

自前のプロバイダーレジストリ(createProviderRegistry() の戻り値)。 指定すると、文字列のモデル指定はすべてこれで解決されます。

Default​

null

stream?​

optional stream?: Partial<AiStreamConfig>;

定義: plugins/ai/src/config.ts:291

ストリーミング表示。指定した項目だけが既定値を上書きします。


temperature?​

optional temperature?: number | null;

定義: plugins/ai/src/config.ts:271

Default​

null(プロバイダーの既定)

texts?​

optional texts?: Partial<AiTexts>;

定義: plugins/ai/src/config.ts:300

ユーザーに見える文言。指定した項目だけが既定値を上書きします。

Default​

defaultAiTexts


timeout?​

optional timeout?: false | DurationInput;

定義: plugins/ai/src/config.ts:285

1回の生成を打ち切るまでの時間。false で無制限。 Discord のインタラクションは defer 後 15分まで応答できます。

Default​

"120s"

tools?​

optional tools?: AiToolsOptions;

定義: plugins/ai/src/config.ts:287

ツール(ai/)の扱い。指定した項目だけが既定値を上書きします。