We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3533cd1 commit bd40076Copy full SHA for bd40076
assets/javascripts/discourse/components/ai-embedding-editor.gjs
@@ -240,7 +240,20 @@ export default class AiEmbeddingEditor extends Component {
240
this.testRunning = true;
241
242
try {
243
- const configTestResult = await this.args.model.testConfig(data);
+ let testModel;
244
+
245
+ // new embeddings
246
+ if (this.args.model.isNew || this.selectedPreset) {
247
+ testModel = this.store.createRecord("ai-embedding", {
248
+ ...this.selectedPreset,
249
+ ...data,
250
+ });
251
+ } else {
252
+ // existing embeddings
253
+ testModel = this.args.model;
254
+ }
255
256
+ const configTestResult = await testModel.testConfig(data);
257
this.testResult = configTestResult.success;
258
259
if (this.testResult) {
0 commit comments