createConversation(
args: {comments?:Pick<NewState<LixConversationMessage>,"body"> &Partial<Pick<NewState<LixConversationMessage>,"lixcol_metadata">>[];entity?:LixEntityCanonical|LixEntity;id?:string;lix:Lix;versionId?:string; }):Promise<LixSelectable<EntityStateByVersionView<{id:LixGenerated<string>; }>> & {comments:LixSelectable<EntityStateByVersionView<LixConversationMessage>>[]; }>
Starts a new conversation.
Conversations allow collaborators to attach messages to a specific version or entity. Initial messages can be provided and will be inserted sequentially.
// Create a standalone conversation
const conv = await createConversation({ lix, comments: [{ body: "Hello" }] })// Create a conversation attached to an entity
const conv = await createConversation({
lix,
entity: { entity_id: "para_123", schema_key: "markdown_paragraph", file_id: "README.md" },
comments: [{ body: "This paragraph needs review" }]
})| Parameter | Type | Description |
|---|---|---|
args | { comments?: Pick<NewState<LixConversationMessage>, "body"> & Partial<Pick<NewState<LixConversationMessage>, "lixcol_metadata">>[]; entity?: LixEntityCanonical | LixEntity; id?: string; lix: Lix; versionId?: string; } | - |
args.comments? | Pick<NewState<LixConversationMessage>, "body"> & Partial<Pick<NewState<LixConversationMessage>, "lixcol_metadata">>[] | - |
args.entity? | LixEntityCanonical | LixEntity | Optional entity to attach the conversation to |
args.id? | string | - |
args.lix | Lix | - |
args.versionId? | string | defaults to global |
Promise<LixSelectable<EntityStateByVersionView<{ id: LixGenerated<string>; }>> & { comments: LixSelectable<EntityStateByVersionView<LixConversationMessage>>[]; }>