Skip to content

Commit c0c434a

Browse files
committed
Fix dialyzer
1 parent d43fe02 commit c0c434a

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

lib/cadet_web/controllers/generate_ai_comments.ex

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,17 @@ defmodule CadetWeb.AICodeAnalysisController do
9696
{:ok, answer} <- Assessments.get_answer(answer_id_parsed) do
9797
# Get head of answers (should only be one answer for given submission
9898
# and question since we filter to only 1 question)
99-
case answer do
100-
nil ->
101-
conn
102-
|> put_status(:not_found)
103-
|> text("No answer found for the given answer_id")
104-
105-
_ ->
106-
analyze_code(
107-
conn,
108-
%{
109-
answer: answer,
110-
api_key: key,
111-
llm_model: course.llm_model,
112-
llm_api_url: course.llm_api_url,
113-
course_prompt: course.llm_course_level_prompt,
114-
assessment_prompt: Assessments.get_llm_assessment_prompt(answer.question_id)
115-
}
116-
)
117-
end
99+
analyze_code(
100+
conn,
101+
%{
102+
answer: answer,
103+
api_key: key,
104+
llm_model: course.llm_model,
105+
llm_api_url: course.llm_api_url,
106+
course_prompt: course.llm_course_level_prompt,
107+
assessment_prompt: Assessments.get_llm_assessment_prompt(answer.question_id)
108+
}
109+
)
118110
else
119111
:error ->
120112
conn

lib/cadet_web/helpers/ai_comments_helpers.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ defmodule CadetWeb.AICommentsHelpers do
22
@moduledoc """
33
Helper functions for Managing LLM related logic
44
"""
5+
require Logger
56

67
def decrypt_llm_api_key(nil), do: nil
78

0 commit comments

Comments
 (0)