Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion assets/javascripts/discourse/components/ai-embedding-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,20 @@ export default class AiEmbeddingEditor extends Component {
this.testRunning = true;

try {
const configTestResult = await this.args.model.testConfig(data);
let testModel;

// new embeddings
if (this.args.model.isNew || this.selectedPreset) {
testModel = this.store.createRecord("ai-embedding", {
...this.selectedPreset,
...data,
});
} else {
// existing embeddings
testModel = this.args.model;
}

const configTestResult = await testModel.testConfig(data);
this.testResult = configTestResult.success;

if (this.testResult) {
Expand Down