Skip to content

Commit

Permalink
remove log, update button, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot committed Jan 23, 2025
1 parent f66a294 commit 9dbfb05
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
11 changes: 6 additions & 5 deletions assets/javascripts/discourse/components/ai-embedding-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export default class AiEmbeddingEditor extends Component {
<h2>{{i18n "discourse_ai.embeddings.presets"}}</h2>
<AdminSectionLandingWrapper>
{{#each this.presets as |preset|}}
{{log preset}}
<AdminSectionLandingItem
@titleLabelTranslated={{preset.name}}
@taglineLabel={{concat
Expand All @@ -248,10 +247,12 @@ export default class AiEmbeddingEditor extends Component {

{{else}}
{{#if this.editingModel.isNew}}
<div class="btn btn-flat back-button" {{on "click" this.resetForm}}>
{{icon "chevron-left"}}
{{i18n "back_button"}}
</div>
<DButton
@action={{this.resetForm}}
@label="back_button"
@icon="chevron-left"
class="btn-flat back-button"
/>
{{else}}
<BackButton
@route="adminPlugins.show.discourse-ai-embeddings"
Expand Down
6 changes: 3 additions & 3 deletions config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,9 @@ en:
hints:
dimensions_warning: "Once saved, this value can't be changed."
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."
embed_prompt: "Explains how to process text to create its numerical summary (embedding) for analysis or comparison."
search_prompt: "Explains how to process a search query to compare it with existing embeddings and find the best matches."
sequence_length: "The maximum number of words or tokens the system can process at once when creating embeddings or handling a query."
embed_prompt: "Tells the LLM how to process text to create its numerical summary (embedding) for analysis or comparison."
search_prompt: "Tells the LLM how to compare a search query with existing embeddings and find the best matches."
sequence_length: "The maximum number of tokens that can be processed at once when creating embeddings or handling a query."
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)."
display_name: "Name"
provider: "Provider"
Expand Down
13 changes: 5 additions & 8 deletions spec/system/embeddings/ai_embedding_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
visit "/admin/plugins/discourse-ai/ai-embeddings"

find(".ai-embeddings-list-editor__new-button").click()
select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__presets")
select_kit.expand
select_kit.select_row_by_value(preset)
find(".ai-embedding-editor__next").click

find("[data-preset-id='text-embedding-3-small'] button").click()

find("input.ai-embedding-editor__api-key").fill_in(with: api_key)
find(".ai-embedding-editor__save").click()

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

find(".ai-embeddings-list-editor__new-button").click()
select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__presets")
select_kit.expand
select_kit.select_row_by_value("manual")
find(".ai-embedding-editor__next").click

find("[data-preset-id='manual'] button").click()

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

Expand Down

0 comments on commit 9dbfb05

Please sign in to comment.