Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0a2bd14

Browse files
committed
move error to correct section
invalid_prompt_role is not used anywhere.
1 parent 8f7dbc3 commit 0a2bd14

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/models/completion_prompt.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def each_message_length
5656
messages.each_with_index do |msg, idx|
5757
next if msg["content"].length <= 1000
5858

59-
errors.add(:messages, I18n.t("errors.prompt_message_length", idx: idx + 1))
59+
errors.add(:messages, I18n.t("discourse_ai.errors.prompt_message_length", idx: idx + 1))
6060
end
6161
end
6262
end

config/locales/server.en.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ en:
106106
flagged_by_toxicity: The AI plugin flagged this after classifying it as toxic.
107107
flagged_by_nsfw: The AI plugin flagged this after classifying at least one of the attached images as NSFW.
108108

109-
errors:
110-
prompt_message_length: The message %{idx} is over the 1000 character limit.
111-
invalid_prompt_role: The message %{idx} has an invalid role.
112-
113109
reports:
114110
overall_sentiment:
115111
title: "Overall sentiment"
@@ -358,3 +354,4 @@ en:
358354
persona_disabled: The persona specified is disabled. Check the persona_name or persona_id params.
359355
no_default_llm: The persona must have a default_llm defined.
360356
user_not_allowed: The user is not allowed to participate in the topic.
357+
prompt_message_length: The message %{idx} is over the 1000 character limit.

0 commit comments

Comments
 (0)