chore: refactoring of Repo.get/get! usages

This commit is contained in:
hugo committed 2026-05-01 17:20:08 +02:00
1 parent f6425de51d
commit 3505355980
23 files changed
+192 -89

No files matched your search

+5
View File
@@ -53,6 +53,11 @@ defmodule BDS.AI.Chat do
|> Enum.map(&format_conversation/1)
end
@spec get_chat_conversation(String.t()) :: ChatConversation.t() | nil
def get_chat_conversation(conversation_id) when is_binary(conversation_id) do
Repo.get(ChatConversation, conversation_id)
end
@spec available_chat_models(String.t() | nil) :: [map()]
def available_chat_models(current_model \\ nil) do
endpoint_models = configured_chat_models()
+9
View File
@@ -6,6 +6,15 @@ defmodule BDS.AI.ChatConversation do
@primary_key {:id, :string, autogenerate: false}
@type t :: %__MODULE__{
id: String.t(),
title: String.t() | nil,
model: String.t() | nil,
copilot_session_id: String.t() | nil,
created_at: integer() | nil,
updated_at: integer() | nil
}
schema "chat_conversations" do
field :title, :string
field :model, :string