@sqlrooms/ai-core / createBlockContextItem
Function: createBlockContextItem()
createBlockContextItem(
fields):object
Create and validate a block-scoped AI run context item.
The returned item is parsed through BlockAiRunContextItemSchema so omitted optional fields are normalized consistently with stored chat context.
Parameters
| Parameter | Type |
|---|---|
fields | { id: string; blockDocumentId: string; blockId: string; blockType: string; blockInstanceId?: string; panelId?: string; title: string; subtitle?: string; } |
fields.id | string |
fields.blockDocumentId | string |
fields.blockId | string |
fields.blockType | string |
fields.blockInstanceId? | string |
fields.panelId? | string |
fields.title | string |
fields.subtitle? | string |
Returns
object
| Name | Type |
|---|---|
id | string |
title | string |
type? | string |
subtitle? | string |
kind | "block" |
blockDocumentId | string |
blockId | string |
blockType | string |
blockInstanceId? | string |
panelId? | string |