Identify agent (#17221)
# Introduction Related to https://github.com/twentyhq/core-team-issues/issues/1989 1/ Migration, applicationId and universalIdentifier are required on entity ( save point migration + upgrade command fallback pattern ) 2/ Backfill using previous standard ids ## Test tested prod extract
This commit is contained in:
+2
-2
@@ -14,7 +14,7 @@ import {
|
||||
DEFAULT_SMART_MODEL,
|
||||
ModelId,
|
||||
} from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
|
||||
import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-entity.interface';
|
||||
import { SyncableEntityRequired } from 'src/engine/workspace-manager/types/syncable-entity-required.interface';
|
||||
|
||||
@Entity('agent')
|
||||
@Index('IDX_AGENT_ID_DELETED_AT', ['id', 'deletedAt'])
|
||||
@@ -23,7 +23,7 @@ import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-enti
|
||||
where: '"deletedAt" IS NULL',
|
||||
})
|
||||
export class AgentEntity
|
||||
extends SyncableEntity
|
||||
extends SyncableEntityRequired
|
||||
implements Required<AgentEntity>
|
||||
{
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ export const transformAgentEntityToFlatAgent = (
|
||||
responseFormat: agentEntity.responseFormat,
|
||||
workspaceId: agentEntity.workspaceId,
|
||||
isCustom: agentEntity.isCustom,
|
||||
universalIdentifier: agentEntity.standardId || agentEntity.id,
|
||||
// TODO remove once MakeAgentUniversalIdentifierAndApplicationIdNotNullableMigrationCommand has been run once
|
||||
universalIdentifier: agentEntity.universalIdentifier ?? agentEntity.id,
|
||||
applicationId: agentEntity.applicationId,
|
||||
modelConfiguration: agentEntity.modelConfiguration,
|
||||
evaluationInputs: agentEntity.evaluationInputs,
|
||||
|
||||
Reference in New Issue
Block a user