/** * LlmTextMutationPlugin * * Adds `{columnName}Text: String` companion fields on create/update mutation * inputs for every vector column. When the client provides a text string in * the companion field, the plugin embeds it server-side and injects the * resulting vector into the actual column. * * Example: * mutation { createArticle(input: { embeddingText: "Machine learning concepts" }) } * * If the embedder returns null (e.g. quota exceeded when the metering plugin * is loaded), the mutation throws an error — unlike search, mutations cannot * silently skip writing a vector the user asked for. * * This is the mutation counterpart to LlmTextSearchPlugin (which handles * filter/query-side text-to-vector). Together they let clients work entirely * with text/prompts instead of raw float vectors. * * Runtime embedding uses the v4-style resolver wrapping approach (same as * graphile-upload-plugin and graphile-bucket-provisioner-plugin). grafserv v5 * supports this through its backwards-compatibility layer. * * The companion fields are only added when the LLM plugin is loaded. * If no embedder is configured, the fields are still registered for schema * stability but return a clear error at execution time. */ import 'graphile-build'; import 'graphile-build-pg'; import type { GraphileConfig } from 'graphile-config'; declare global { namespace GraphileConfig { interface Plugins { LlmTextMutationPlugin: true; } } } /** * Creates the LlmTextMutationPlugin. * * Hooks into GraphQLInputObjectType_fields for create/update input types * and adds `{columnName}Text: String` for each vector column. * * Also wraps mutation resolvers via GraphQLObjectType_fields_field to * intercept `*Text` companion field values, embed them, and inject the * resulting vectors before the mutation executes. */ export declare function createLlmTextMutationPlugin(): GraphileConfig.Plugin;