Skip to content

Function: detectAttachmentType()

detectAttachmentType(att): string

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.

string = ...

string = ...

{ 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; } = ...

string = ...

string = ...

number = ...

object[] = ...

string = ...

{ is_truncated?: boolean; row_count?: number; } = ...

boolean = ...

number = ...

string = ...

object[] = ...

string = ...

{ questions?: string[]; } = ...

string[] = ...

{ content?: string; id?: string; metadata?: unknown; purpose?: string; } = ...

string = ...

string = ...

unknown = ...

string = ...

string