Function: detectAttachmentType()
detectAttachmentType(
att):AttachmentType
Inspect a GenieAttachment and return the
AttachmentType of payload it carries. Returns the first
known sub-object that’s present; if none of the known ones are
populated, falls back to the first non-bookkeeping key
(forward-compat for types we don’t model yet), else "unknown".
Honors a pre-set attachment_type if one is already on the
value, so this is idempotent across re-detections.
Parameters
Section titled “Parameters”attachment_id?
Section titled “attachment_id?”string = ...
Description
Attachment ID
attachment_type?
Section titled “attachment_type?”AttachmentType = ...
query?
Section titled “query?”{ description?: string; id?: string; last_updated_timestamp?: number; parameters?: object[]; query?: string; query_result_metadata?: { is_truncated?: boolean; row_count?: number; }; statement_id?: string; thoughts?: object[]; title?: string; } = ...
query.description?
Section titled “query.description?”string = ...
Description
Description of the query
query.id?
Section titled “query.id?”string = ...
query.last_updated_timestamp?
Section titled “query.last_updated_timestamp?”number = ...
Description
Time when the user updated the query last
query.parameters?
Section titled “query.parameters?”object[] = ...
query.query?
Section titled “query.query?”string = ...
Description
AI generated SQL query
query.query_result_metadata?
Section titled “query.query_result_metadata?”{ is_truncated?: boolean; row_count?: number; } = ...
Description
Metadata associated with the query result.
query.query_result_metadata.is_truncated?
Section titled “query.query_result_metadata.is_truncated?”boolean = ...
Description
Indicates whether the result set is truncated.
query.query_result_metadata.row_count?
Section titled “query.query_result_metadata.row_count?”number = ...
Description
The number of rows in the result set.
query.statement_id?
Section titled “query.statement_id?”string = ...
Description
Statement Execution API statement id. Use Get status, manifest, and result first chunk to get the full result data.
query.thoughts?
Section titled “query.thoughts?”object[] = ...
query.title?
Section titled “query.title?”string = ...
Description
Name of the query
suggested_questions?
Section titled “suggested_questions?”{ questions?: string[]; } = ...
Description
Follow-up questions suggested by Genie
suggested_questions.questions?
Section titled “suggested_questions.questions?”string[] = ...
Description
The suggested follow-up questions
{ content?: string; id?: string; purpose?: GenieTextAttachmentPurpose; } = ...
text.content?
Section titled “text.content?”string = ...
Description
AI generated message
text.id?
Section titled “text.id?”string = ...
text.purpose?
Section titled “text.purpose?”GenieTextAttachmentPurpose = ...