review feedback

This commit is contained in:
Roman Rizzi 2025-06-03 20:40:17 -03:00
parent 0338dbea23
commit c885e5697f
5 changed files with 24 additions and 20 deletions

View File

@ -1,6 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class CompletionPrompt < ActiveRecord::Base class CompletionPrompt < ActiveRecord::Base
#
# DEPRECATED.
# TODO(roman): Remove after 06-17-25
#
TRANSLATE = -301 TRANSLATE = -301
GENERATE_TITLES = -307 GENERATE_TITLES = -307
PROOFREAD = -303 PROOFREAD = -303

View File

@ -340,32 +340,33 @@ en:
name: "Concept Deduplicator" name: "Concept Deduplicator"
description: "AI Bot specialized in deduplicating concepts" description: "AI Bot specialized in deduplicating concepts"
custom_prompt: custom_prompt:
name: "Custom Prompt" name: "Custom prompt"
description: "Default persona powering the AI helper's custom prompt feature" description: "Default persona powering the Helper's custom prompt feature"
smart_dates: smart_dates:
name: "Smart Dates" name: "Smart dates"
description: "Default persona powering the AI helper's smart dates feature" description: "Default persona powering the Helper's smart dates feature"
markdown_table_generator: markdown_table_generator:
name: "Markdown Table Generator" name: "Markdown table generator"
description: "Default persona powering the AI helper's generate Markdown table feature" description: "Default persona powering the Helper's generate Markdown table feature"
post_illustrator: post_illustrator:
name: "Post Illustrator" name: "Post illustrator"
description: "Generates StableDiffusion prompts to power the AI helper's illustrate post feature" description: "Generates StableDiffusion prompts to power the Helper's illustrate post feature"
proofreader: proofreader:
name: "Proofreader" name: "Proofreader"
description: "Default persona powering the AI helper's proofread text feature" description: "Default persona powering the Helper's proofread text feature"
titles_generator: titles_generator:
name: "Titles Generator" name: "Titles generator"
description: "Default persona powering the AI helper's suggest topic titles feature" description: "Default persona powering the Helper's suggest topic titles feature"
tutor: tutor:
name: "Tutor" name: "Tutor"
description: "Default persona powering the AI helper's explain feature" description: "Default persona powering the Helper's explain feature"
translator: translator:
name: "Translator" name: "Translator"
description: "Default persona powering the AI helper's translator feature" description: "Default persona powering the Helper's translator feature"
image_captioner: image_captioner:
name: "Image Captions" name: "Image captions"
description: "Default persona powering the AI helper's image caption feature" description: "Default persona powering the Helper's image caption feature"
topic_not_found: "Summary unavailable, topic not found!" topic_not_found: "Summary unavailable, topic not found!"
summarizing: "Summarizing topic" summarizing: "Summarizing topic"
searching: "Searching for: '%{query}'" searching: "Searching for: '%{query}'"

View File

@ -166,7 +166,7 @@ discourse_ai:
default: "-22" default: "-22"
type: enum type: enum
enum: "DiscourseAi::Configuration::PersonaEnumerator" enum: "DiscourseAi::Configuration::PersonaEnumerator"
ai_helper_tittle_suggestions_persona: ai_helper_title_suggestions_persona:
default: "-23" default: "-23"
type: enum type: enum
enum: "DiscourseAi::Configuration::PersonaEnumerator" enum: "DiscourseAi::Configuration::PersonaEnumerator"

View File

@ -307,7 +307,7 @@ module DiscourseAi
def personas_prompt_map(include_image_caption: false) def personas_prompt_map(include_image_caption: false)
map = { map = {
SiteSetting.ai_helper_translator_persona.to_i => TRANSLATE, SiteSetting.ai_helper_translator_persona.to_i => TRANSLATE,
SiteSetting.ai_helper_tittle_suggestions_persona.to_i => GENERATE_TITLES, SiteSetting.ai_helper_title_suggestions_persona.to_i => GENERATE_TITLES,
SiteSetting.ai_helper_proofreader_persona.to_i => PROOFREAD, SiteSetting.ai_helper_proofreader_persona.to_i => PROOFREAD,
SiteSetting.ai_helper_markdown_tables_persona.to_i => MARKDOWN_TABLE, SiteSetting.ai_helper_markdown_tables_persona.to_i => MARKDOWN_TABLE,
SiteSetting.ai_helper_custom_prompt_persona.to_i => CUSTOM_PROMPT, SiteSetting.ai_helper_custom_prompt_persona.to_i => CUSTOM_PROMPT,
@ -325,8 +325,6 @@ module DiscourseAi
end end
def all_prompts def all_prompts
personas_and_prompts = personas_prompt_map
AiPersona AiPersona
.where(id: personas_prompt_map.keys) .where(id: personas_prompt_map.keys)
.map do |ai_persona| .map do |ai_persona|

View File

@ -25,7 +25,7 @@ module PageObjects
end end
def select_helper_model(mode) def select_helper_model(mode)
find("#{OPTIONS_SELECTOR} .btn[data-value=\"#{mode}\"]").click find("#{OPTIONS_SELECTOR} .btn[data-name=\"#{mode}\"]").click
end end
def suggestion_value def suggestion_value