Function: createConversation()

createConversation(args: { comments?: Pick<NewState<LixConversationMessage>, "body"> & Partial<Pick<NewState<LixConversationMessage>, "lixcol_metadata">>[]; entity?: LixEntityCanonical | LixEntity; id?: string; lix: Lix; versionId?: string; }): Promise<LixSelectable<EntityStateAllView<{ id: LixGenerated<string>; }>> & { comments: LixSelectable<EntityStateAllView<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.

Examples

// 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" }]
})

Parameters

ParameterTypeDescription
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 | LixEntityOptional entity to attach the conversation to
args.id?string-
args.lixLix-
args.versionId?stringdefaults to global

Returns

Promise<LixSelectable<EntityStateAllView<{ id: LixGenerated<string>; }>> & { comments: LixSelectable<EntityStateAllView<LixConversationMessage>>[]; }>