embeddingPlugin
import { embeddingPlugin } from '@routecraft/ai'
Provides the embedding service that embedding() reads its provider credentials from. Required when any capability uses embedding(). Releases native ONNX resources when the application stops (used by the huggingface provider).
import { embeddingPlugin } from '@routecraft/ai'
import type { CraftConfig } from '@routecraft/routecraft'
export const craftConfig: CraftConfig = {
plugins: [
embeddingPlugin({
providers: {
openai: { apiKey: process.env.OPENAI_API_KEY! },
},
}),
],
}
Options:
Providers:
See embedding adapter for usage.