chore: refactoring of Repo.get/get! usages
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user