Fix AI demo workspace skill (#18575)
This PR fixes what allows to have a working demo workspace skill. - Skill updated many times into something that works - Fixed infinite loop in AI chat by memoizing ai-sdk output - Finished navigateToView implementation - Increased MAX_STEPS to 300 so the chat don't quit in the middle of a long running skill - Added CreateManyRelationFields
This commit is contained in:
+29
@@ -123,12 +123,41 @@ export class NavigateAppTool implements Tool {
|
||||
};
|
||||
}
|
||||
|
||||
const { flatObjectMetadataMaps } =
|
||||
await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
|
||||
{
|
||||
workspaceId,
|
||||
flatMapsKeys: ['flatObjectMetadataMaps'],
|
||||
},
|
||||
);
|
||||
|
||||
const objectMetadataUniversalIdentifier =
|
||||
flatObjectMetadataMaps.universalIdentifierById[
|
||||
matchingView.objectMetadataId
|
||||
];
|
||||
|
||||
const objectMetadata = isDefined(objectMetadataUniversalIdentifier)
|
||||
? flatObjectMetadataMaps.byUniversalIdentifier[
|
||||
objectMetadataUniversalIdentifier
|
||||
]
|
||||
: undefined;
|
||||
|
||||
if (!isDefined(objectMetadata)) {
|
||||
return {
|
||||
success: false,
|
||||
message: `Object metadata for view "${matchingView.name}" not found`,
|
||||
error: `Could not resolve the object associated with view "${matchingView.name}"`,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: `Navigating to view "${matchingView.name}"`,
|
||||
result: {
|
||||
action: 'navigateToView',
|
||||
viewId: matchingView.id,
|
||||
viewName: matchingView.name,
|
||||
objectNameSingular: objectMetadata.nameSingular,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user