Lightning.AiAssistant.ChatSession (Lightning v2.14.5-pre1)

View Source

Represents a chat session for AI assistance, including job code and workflow templates.

This module defines the schema and changeset for chat sessions, including relationships to users, jobs, projects, and workflows. It also includes custom validation logic to ensure that the correct fields are populated based on the session type.

Summary

Types

t()

@type t() :: %Lightning.AiAssistant.ChatSession{
  __meta__: term(),
  adaptor: String.t() | nil,
  expression: String.t() | nil,
  id: Ecto.UUID.t(),
  inserted_at: term(),
  is_deleted: boolean(),
  is_public: boolean(),
  job: term(),
  job_id: Ecto.UUID.t() | nil,
  logs: term(),
  message_count: integer() | nil,
  messages: [Lightning.AiAssistant.ChatMessage.t()] | [],
  meta: map() | nil,
  project: term(),
  project_id: Ecto.UUID.t() | nil,
  session_type: String.t(),
  title: String.t(),
  updated_at: term(),
  user: term(),
  user_id: Ecto.UUID.t(),
  workflow: term(),
  workflow_id: Ecto.UUID.t() | nil
}