Skip to content

genieModel

Wire-format zod schemas + types and high-level event vocabulary for the Genie chat driver.

Two related layers live here:

  1. Genie wire shapes derived from this package’s own generated dashboards schemas (regenerated from the upstream @databricks/sdk-experimental apis/dashboards/model.d.ts by the engine’s codegen on synth). We extend the SDK schemas where Genie ships fields on the wire that the SDK doesn’t currently type:

    • GenieMessage.auto_regenerate_count: number (stamped on every wire message, omitted from the SDK shape).
    • GenieQueryAttachment.thoughts: GenieThought[] (the streamed reasoning payload with DESCRIPTION, DATA_SOURCING, STEPS, and UNDERSTANDING thought kinds).
    • GenieAttachment.attachment_type: AttachmentType (an optional discriminator literal so callers can switch (att.attachment_type) instead of probing which sub-key is populated; compute it with detectAttachmentType).
  2. Event vocabulary for the high-level genieEventChat driver. Each event is a flat z.object with a type literal discriminator and snake_case payload fields hoisted to the top level (no payload wrapper). Events that share the attachment-scoped location use GenieChatLocationSchema as a base; events that don’t carry an attachment_id (status, result) omit it. GenieChatEventSchema bundles the variants into one discriminated union.

Pure types: no runtime imports beyond zod + the generated dashboards schemas, no Node-only code, safe for browser bundles.

Re-exports MessageStatusSchema