• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / backend / e0330f2cf38b2d8af12bffd20f4cac2158d607fc-PR-1236

31 Mar 2025 09:12AM UTC coverage: 19.982% (-73.6%) from 93.607%
e0330f2cf38b2d8af12bffd20f4cac2158d607fc-PR-1236

Pull #1236

github

RichDom2185
Redate migrations to maintain total ordering
Pull Request #1236: Added Exam mode

12 of 57 new or added lines in 8 files covered. (21.05%)

2430 existing lines in 97 files now uncovered.

671 of 3358 relevant lines covered (19.98%)

3.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/cadet/chatbot/conversation.ex
1
defmodule Cadet.Chatbot.Conversation do
2
  @moduledoc """
3
  The Conversation entity stores the messages exchanged between the user and the chatbot.
4
  """
5
  use Cadet, :model
6

7
  alias Cadet.Accounts.User
8

9
  @type t :: %__MODULE__{
10
          user: User.t(),
11
          # { role: string; content: string }[]
12
          prepend_context: list(map()),
13
          # { role: string; content: string, createdAt: string }[]
14
          messages: list(map())
15
        }
16

UNCOV
17
  schema "llm_chats" do
×
18
    field(:prepend_context, {:array, :map}, default: [])
19
    field(:messages, {:array, :map}, default: [])
20

21
    belongs_to(:user, User)
22

23
    timestamps()
24
  end
25

26
  @required_fields ~w(user_id)a
27
  @optional_fields ~w(prepend_context messages)a
28

29
  def changeset(conversation, params) do
30
    conversation
31
    |> cast(params, @required_fields ++ @optional_fields)
32
    |> add_belongs_to_id_from_model([:user], params)
UNCOV
33
    |> validate_required(@required_fields)
×
34
  end
35
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc