{ "argumentSchema": { "$defs": { "BuiltInLLMContent": { "anyOf": [ { "type": "string" }, { "items": { "$ref": "#/$defs/BuiltInLLMContentPart" }, "type": "array" } ] }, "BuiltInLLMContentPart": { "anyOf": [ { "$ref": "#/$defs/BuiltInLLMTextPart" }, { "$ref": "#/$defs/BuiltInLLMImagePart" }, { "$ref": "#/$defs/BuiltInLLMToolCallPart" }, { "$ref": "#/$defs/BuiltInLLMToolResultPart" } ] }, "BuiltInLLMImagePart": { "properties": { "image": { "type": "string" }, "type": { "enum": [ "image" ], "type": "string" } }, "required": [ "type", "image" ], "type": "object" }, "BuiltInLLMMessage": { "properties": { "content": { "$ref": "#/$defs/BuiltInLLMContent" }, "role": { "enum": [ "user", "system", "assistant", "tool" ] } }, "required": [ "role", "content" ], "type": "object" }, "BuiltInLLMTextPart": { "properties": { "text": { "type": "string" }, "type": { "enum": [ "text" ], "type": "string" } }, "required": [ "type", "text" ], "type": "object" }, "BuiltInLLMToolCallPart": { "properties": { "input": { "additionalProperties": true, "properties": {}, "type": "object" }, "toolCallId": { "type": "string" }, "toolName": { "type": "string" }, "type": { "enum": [ "tool-call" ], "type": "string" } }, "required": [ "type", "toolCallId", "toolName", "input" ], "type": "object" }, "BuiltInLLMToolResultPart": { "properties": { "output": { "anyOf": [ { "properties": { "type": { "enum": [ "text" ], "type": "string" }, "value": { "type": "string" } }, "required": [ "type", "value" ], "type": "object" }, { "properties": { "type": { "enum": [ "json" ], "type": "string" }, "value": true }, "required": [ "type", "value" ], "type": "object" } ] }, "toolCallId": { "type": "string" }, "toolName": { "type": "string" }, "type": { "enum": [ "tool-result" ], "type": "string" } }, "required": [ "type", "toolCallId", "toolName", "output" ], "type": "object" } }, "properties": { "messages": { "asCell": [ "cell" ], "default": [], "items": { "$ref": "#/$defs/BuiltInLLMMessage" }, "type": "array" }, "system": { "type": "string" }, "theme": true, "tools": true }, "type": "object" }, "pattern": "chatbot.tsx", "resultSchema": { "$defs": { "BuiltInLLMContent": { "anyOf": [ { "type": "string" }, { "items": { "$ref": "#/$defs/BuiltInLLMContentPart" }, "type": "array" } ] }, "BuiltInLLMContentPart": { "anyOf": [ { "$ref": "#/$defs/BuiltInLLMTextPart" }, { "$ref": "#/$defs/BuiltInLLMImagePart" }, { "$ref": "#/$defs/BuiltInLLMToolCallPart" }, { "$ref": "#/$defs/BuiltInLLMToolResultPart" } ] }, "BuiltInLLMImagePart": { "properties": { "image": { "type": "string" }, "type": { "enum": [ "image" ], "type": "string" } }, "required": [ "type", "image" ], "type": "object" }, "BuiltInLLMMessage": { "properties": { "content": { "$ref": "#/$defs/BuiltInLLMContent" }, "role": { "enum": [ "user", "system", "assistant", "tool" ] } }, "required": [ "role", "content" ], "type": "object" }, "BuiltInLLMTextPart": { "properties": { "text": { "type": "string" }, "type": { "enum": [ "text" ], "type": "string" } }, "required": [ "type", "text" ], "type": "object" }, "BuiltInLLMToolCallPart": { "properties": { "input": { "additionalProperties": true, "properties": {}, "type": "object" }, "toolCallId": { "type": "string" }, "toolName": { "type": "string" }, "type": { "enum": [ "tool-call" ], "type": "string" } }, "required": [ "type", "toolCallId", "toolName", "input" ], "type": "object" }, "BuiltInLLMToolResultPart": { "properties": { "output": { "anyOf": [ { "properties": { "type": { "enum": [ "text" ], "type": "string" }, "value": { "type": "string" } }, "required": [ "type", "value" ], "type": "object" }, { "properties": { "type": { "enum": [ "json" ], "type": "string" }, "value": true }, "required": [ "type", "value" ], "type": "object" } ] }, "toolCallId": { "type": "string" }, "toolName": { "type": "string" }, "type": { "enum": [ "tool-result" ], "type": "string" } }, "required": [ "type", "toolCallId", "toolName", "output" ], "type": "object" } }, "properties": { "addMessage": { "$ref": "#/$defs/BuiltInLLMMessage", "asCell": [ "stream" ] }, "cancelGeneration": { "asCell": [ "stream", "opaque" ] }, "clearChat": { "asCell": [ "stream", "opaque" ] }, "messages": { "items": { "$ref": "#/$defs/BuiltInLLMMessage" }, "type": "array" }, "pending": { "anyOf": [ { "type": "undefined" }, { "type": "boolean" } ] }, "pinCell": { "asCell": [ "stream" ], "properties": { "name": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path", "name" ], "type": "object" }, "pinToChat": { "asCell": [ "stream" ], "properties": { "accumulate": { "type": "boolean" }, "name": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path", "name", "accumulate" ], "type": "object" }, "pinnedCells": { "items": { "properties": { "name": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path", "name" ], "type": "object" }, "type": "array" }, "title": { "type": "string" }, "tools": true, "ui": { "properties": { "attachmentsAndTools": { "$ref": "https://commonfabric.org/schemas/vnode.json" }, "chatLog": { "$ref": "https://commonfabric.org/schemas/vnode.json" }, "promptInput": { "$ref": "https://commonfabric.org/schemas/vnode.json" } }, "required": [ "chatLog", "promptInput", "attachmentsAndTools" ], "type": "object" }, "unpinAllCells": { "asCell": [ "stream", "opaque" ] } }, "required": [ "messages", "pending", "addMessage", "clearChat", "cancelGeneration", "pinnedCells", "pinCell", "unpinAllCells", "pinToChat", "tools", "ui" ], "type": "object" } }