Variable: GenieAttachmentSchema
constGenieAttachmentSchema:ZodObject<{attachment_id:ZodOptional<ZodString>;attachment_type:ZodOptional<ZodString>;query:ZodOptional<ZodObject<{description:ZodOptional<ZodString>;id:ZodOptional<ZodString>;last_updated_timestamp:ZodOptional<ZodNumber>;parameters:ZodOptional<ZodArray<ZodObject<{keyword:ZodOptional<ZodString>;sql_type:ZodOptional<ZodString>;value:ZodOptional<ZodString>; },$strip>>>;query:ZodOptional<ZodString>;query_result_metadata:ZodOptional<ZodObject<{is_truncated:ZodOptional<ZodBoolean>;row_count:ZodOptional<ZodNumber>; },$strip>>;statement_id:ZodOptional<ZodString>;thoughts:ZodOptional<ZodArray<ZodObject<{content:ZodString;thought_type:ZodString; },$strip>>>;title:ZodOptional<ZodString>; },$strip>>;suggested_questions:ZodOptional<ZodObject<{questions:ZodOptional<ZodArray<ZodString>>; },$strip>>;text:ZodOptional<ZodObject<{content:ZodOptional<ZodString>;id:ZodOptional<ZodString>;metadata:ZodOptional<ZodUnknown>;purpose:ZodOptional<ZodString>; },$strip>>; },$strip>
GenieAttachment with:
queryre-typed to the thoughts-aware GenieQueryAttachmentSchema.attachment_typediscriminator literal (AttachmentType) so consumers canswitch (att.attachment_type)to narrow which sub-object is populated. Optional on the wire (Genie doesn’t send it); callers compute it with detectAttachmentType when they want the literal up-front.
text is re-typed to the forward-compatible
GenieTextAttachmentSchema. attachment_id and
suggested_questions pass through unchanged. attachment_id is genuinely
optional on the wire:
the first text attachment Genie emits per turn (the “main
answer text”) arrives with no id, only the follow-up text
attachment gets one.
GenieAttachment fields
Section titled “GenieAttachment fields”attachment_id(optional): Attachment IDquery.description(optional): Description of the queryquery.last_updated_timestamp(optional): Time when the user updated the query lastquery.query(optional): AI generated SQL queryquery.query_result_metadata(optional): Metadata associated with the query result.query.query_result_metadata.is_truncated(optional): Indicates whether the result set is truncated.query.query_result_metadata.row_count(optional): The number of rows in the result set.query.statement_id(optional): Statement Execution API statement id. Use Get status, manifest, and result first chunk to get the full result data.query.title(optional): Name of the querysuggested_questions(optional): Follow-up questions suggested by Geniesuggested_questions.questions(optional): The suggested follow-up questionstext.content(optional): AI generated messagetext.purpose(optional): Forward-compatible semantic purpose for a Genie text attachment.text.metadata(optional): Agent Mode metadata attached to this text response.attachment_type(optional): Forward-compatible Genie attachment discriminator.