/** * LlmPolicy is the LLM write-access class of a document field. The JSON * Schema for strict structured output is generated from these annotations * (internal/aibuilder/llmschema); a reachable field without one fails the * build-time exhaustiveness check, so every new proto field forces an * explicit decision. */ export type LlmPolicy = /** * Not classified. The schema generator refuses to build — this is the * fail-loud state, never a valid annotation. */ 'LLM_POLICY_UNSPECIFIED' /** * In the LLM output schema: the model sees the field and re-emits it on * every (re)generation. */ | 'LLM_POLICY_MODEL' /** * Read-only context: shown to the model in / planner * summaries but absent from the output schema. Preserved in code across * regeneration (preserveClientManagedFields). */ | 'LLM_POLICY_CONTEXT' /** * Invisible to the model entirely (pure client round-trip data: * translations maps, media ids, user-authored code). Preserved in code. */ | 'LLM_POLICY_CLIENT'; /** * LlmField carries the policy plus the JSON-Schema constraints applied when * the field is rendered into the strict-output schema. Constraint fields are * honoured only for policy = LLM_POLICY_MODEL. */ export type LlmField = { policy: LlmPolicy; /** String fields: regex the decoder must match (e.g. hex colours). */ pattern?: string; /** String fields: JSON-Schema minLength. */ minLength?: number; /** Repeated fields: JSON-Schema minItems / maxItems. */ minItems?: number; maxItems?: number; /** Numeric fields: JSON-Schema minimum / maximum. */ minimum?: number; maximum?: number; /** * Enum fields: include the *_UNSPECIFIED value in the schema enum (used * where UNSPECIFIED means "inherit" and is a valid model choice). */ allowUnspecified?: boolean; /** * Enum fields: value names dropped from the schema enum (deprecated * values kept only for wire compatibility, e.g. CARD_IMAGE_FIT_FILL). */ excludeValues: string[]; /** * String fields whose enum is the document's text-variant keys, resolved * per request (TextBlock.variant). */ variantEnum?: boolean; /** * Proto-optional string fields that must NOT become nullable in the * schema — empty string is the field's own "unset" idiom * (AiBuilderColumn.width). */ noNull?: boolean; };