Skip to content

Variable: ResultEventSchema

const ResultEventSchema: ZodObject<{ conversation_id: ZodOptional<ZodString>; message: ZodObject<{ attachments: ZodOptional<ZodArray<ZodObject<{ attachment_id: ZodOptional<ZodString>; attachment_type: ZodOptional<ZodString>; query: ZodOptional<ZodObject<{ description: …; id: …; last_updated_timestamp: …; parameters: …; query: …; query_result_metadata: …; statement_id: …; thoughts: …; title: …; }, $strip>>; suggested_questions: ZodOptional<ZodObject<{ questions: …; }, $strip>>; text: ZodOptional<ZodObject<{ content: …; id: …; metadata: …; purpose: …; }, $strip>>; }, $strip>>>; auto_regenerate_count: ZodOptional<ZodNumber>; content: ZodString; conversation_id: ZodString; created_timestamp: ZodOptional<ZodNumber>; error: ZodOptional<ZodObject<{ error: ZodOptional<ZodString>; type: ZodOptional<ZodUnion<readonly [ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>]>>; }, $strip>>; feedback: ZodOptional<ZodObject<{ rating: ZodOptional<ZodUnion<readonly [ZodLiteral<…>, ZodLiteral<…>, ZodLiteral<…>]>>; }, $strip>>; id: ZodString; last_updated_timestamp: ZodOptional<ZodNumber>; message_id: ZodString; query_result: ZodOptional<ZodObject<{ is_truncated: ZodOptional<ZodBoolean>; row_count: ZodOptional<ZodNumber>; statement_id: ZodOptional<ZodString>; statement_id_signature: ZodOptional<ZodString>; }, $strip>>; space_id: ZodString; status: ZodOptional<ZodUnion<readonly [ZodLiteral<"ASKING_AI">, ZodLiteral<"CANCELLED">, ZodLiteral<"COMPLETED">, ZodLiteral<"EXECUTING_QUERY">, ZodLiteral<"FAILED">, ZodLiteral<"FETCHING_METADATA">, ZodLiteral<"FILTERING_CONTEXT">, ZodLiteral<"PENDING_WAREHOUSE">, ZodLiteral<"QUERY_RESULT_EXPIRED">, ZodLiteral<"SUBMITTED">]>>; user_id: ZodOptional<ZodNumber>; }, $strip>; message_id: ZodOptional<ZodString>; space_id: ZodString; status: ZodEnum<{ CANCELLED: "CANCELLED"; COMPLETED: "COMPLETED"; FAILED: "FAILED"; }>; type: ZodLiteral<"result">; }, $strip>

The active turn reached a terminal status. Always fires once per turn (immediately after the terminal message event). Carries the final GenieMessage snapshot inline so subscribers don’t need to keep their own copy of the last message.

  • status: Message status that ends a Genie turn and produces a final result event.
  • message.content: User message content
  • message.conversation_id: Conversation ID
  • message.created_timestamp (optional): Timestamp when the message was created
  • message.error (optional): Error message if Genie failed to respond to the message
  • message.feedback (optional): User feedback for the message if provided
  • message.feedback.rating (optional): The feedback rating
  • message.id: Message ID. Legacy identifier, use message_id instead
  • message.last_updated_timestamp (optional): Timestamp when the message was last updated
  • message.message_id: Message ID
  • message.query_result (optional): The result of SQL query if the message includes a query attachment. Deprecated. Use query_result_metadata in GenieQueryAttachment instead.
  • message.query_result.is_truncated (optional): If result is truncated
  • message.query_result.row_count (optional): Row count of the result
  • message.query_result.statement_id (optional): Statement Execution API statement id. Use Get status, manifest, and result first chunk to get the full result data.
  • message.query_result.statement_id_signature (optional): JWT corresponding to the statement contained in this result
  • message.space_id: Genie space ID
  • message.status (optional): MessageStatus. The possible values are: * FETCHING_METADATA: Fetching metadata from the data sources. * FILTERING_CONTEXT: Running smart context step to determine relevant context. * ASKING_AI: Waiting for the LLM to respond to the user’s question. * PENDING_WAREHOUSE: Waiting for warehouse before the SQL query can start executing. * EXECUTING_QUERY: Executing a generated SQL query. Get the SQL query result by calling getMessageAttachmentQueryResult API. * FAILED: The response generation or query execution failed. See error field. * COMPLETED: Message processing is completed. Results are in the attachments field. Get the SQL query result by calling getMessageAttachmentQueryResult API. * SUBMITTED: Message has been submitted. * QUERY_RESULT_EXPIRED: SQL result is not available anymore. The user needs to rerun the query. Rerun the SQL query result by calling executeMessageAttachmentQuery API. * CANCELLED: Message has been cancelled.
  • message.user_id (optional): ID of the user who created the message