WIP - Semantic linking working asynchronously

This commit is contained in:
Francisco Gaona
2026-04-12 11:24:03 +02:00
parent efa57c4ba8
commit 12a82372f4
7 changed files with 124 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ import { FieldDefinition } from '../models/field-definition.model';
import { User } from '../models/user.model';
import { ObjectMetadata } from './models/dynamic-model.factory';
import { MeilisearchService } from '../search/meilisearch.service';
import { SemanticOrchestratorService } from '../knowledge/services/semantic-orchestrator.service';
import { SemanticRefreshQueueService } from '../knowledge/services/semantic-refresh-queue.service';
type SearchFilter = {
field: string;
@@ -40,7 +40,7 @@ export class ObjectService {
private modelService: ModelService,
private authService: AuthorizationService,
private meilisearchService: MeilisearchService,
private semanticOrchestratorService: SemanticOrchestratorService,
private semanticRefreshQueue: SemanticRefreshQueueService,
) {}
// Setup endpoints - Object metadata management
@@ -1130,7 +1130,7 @@ export class ObjectService {
);
const record = await boundModel.query().insert(normalizedRecordData);
await this.indexRecord(resolvedTenantId, objectApiName, objectDefModel.fields, record);
await this.semanticOrchestratorService.refreshRecord(
await this.semanticRefreshQueue.enqueue(
resolvedTenantId,
objectApiName,
record.id,
@@ -1206,7 +1206,7 @@ export class ObjectService {
await boundModel.query().patch(normalizedEditableData).where({ id: recordId });
const record = await boundModel.query().where({ id: recordId }).first();
await this.indexRecord(resolvedTenantId, objectApiName, objectDefModel.fields, record);
await this.semanticOrchestratorService.refreshRecord(
await this.semanticRefreshQueue.enqueue(
resolvedTenantId,
objectApiName,
recordId,