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

Commit 9dbfb05

Browse files
committed
remove log, update button, fix tests
1 parent f66a294 commit 9dbfb05

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

assets/javascripts/discourse/components/ai-embedding-editor.gjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ export default class AiEmbeddingEditor extends Component {
222222
<h2>{{i18n "discourse_ai.embeddings.presets"}}</h2>
223223
<AdminSectionLandingWrapper>
224224
{{#each this.presets as |preset|}}
225-
{{log preset}}
226225
<AdminSectionLandingItem
227226
@titleLabelTranslated={{preset.name}}
228227
@taglineLabel={{concat
@@ -248,10 +247,12 @@ export default class AiEmbeddingEditor extends Component {
248247

249248
{{else}}
250249
{{#if this.editingModel.isNew}}
251-
<div class="btn btn-flat back-button" {{on "click" this.resetForm}}>
252-
{{icon "chevron-left"}}
253-
{{i18n "back_button"}}
254-
</div>
250+
<DButton
251+
@action={{this.resetForm}}
252+
@label="back_button"
253+
@icon="chevron-left"
254+
class="btn-flat back-button"
255+
/>
255256
{{else}}
256257
<BackButton
257258
@route="adminPlugins.show.discourse-ai-embeddings"

config/locales/client.en.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ en:
523523
hints:
524524
dimensions_warning: "Once saved, this value can't be changed."
525525
matryoshka_dimensions: "Defines the size of nested embeddings used for hierarchical or multi-layered representation of data, similar to how nested dolls fit within each other."
526-
embed_prompt: "Explains how to process text to create its numerical summary (embedding) for analysis or comparison."
527-
search_prompt: "Explains how to process a search query to compare it with existing embeddings and find the best matches."
528-
sequence_length: "The maximum number of words or tokens the system can process at once when creating embeddings or handling a query."
526+
embed_prompt: "Tells the LLM how to process text to create its numerical summary (embedding) for analysis or comparison."
527+
search_prompt: "Tells the LLM how to compare a search query with existing embeddings and find the best matches."
528+
sequence_length: "The maximum number of tokens that can be processed at once when creating embeddings or handling a query."
529529
distance_function: "Determines how similarity between embeddings is calculated, using either cosine distance (measuring the angle between vectors) or negative inner product (measuring overlap of vector values)."
530530
display_name: "Name"
531531
provider: "Provider"

spec/system/embeddings/ai_embedding_definition_spec.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
visit "/admin/plugins/discourse-ai/ai-embeddings"
1414

1515
find(".ai-embeddings-list-editor__new-button").click()
16-
select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__presets")
17-
select_kit.expand
18-
select_kit.select_row_by_value(preset)
19-
find(".ai-embedding-editor__next").click
16+
17+
find("[data-preset-id='text-embedding-3-small'] button").click()
18+
2019
find("input.ai-embedding-editor__api-key").fill_in(with: api_key)
2120
find(".ai-embedding-editor__save").click()
2221

@@ -43,10 +42,8 @@
4342
visit "/admin/plugins/discourse-ai/ai-embeddings"
4443

4544
find(".ai-embeddings-list-editor__new-button").click()
46-
select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__presets")
47-
select_kit.expand
48-
select_kit.select_row_by_value("manual")
49-
find(".ai-embedding-editor__next").click
45+
46+
find("[data-preset-id='manual'] button").click()
5047

5148
find("input.ai-embedding-editor__display-name").fill_in(with: "OpenAI's text-embedding-3-small")
5249

0 commit comments

Comments
 (0)