Add preconfigured Workflow creation agent (#13855)
Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
import { type AgentEntity } from 'src/engine/metadata-modules/agent/agent.entity';
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
|
||||
export const transformAgentEntityToFlatAgent = (
|
||||
agentEntity: AgentEntity,
|
||||
): FlatAgent => {
|
||||
return {
|
||||
id: agentEntity.id,
|
||||
standardId: agentEntity.standardId,
|
||||
name: agentEntity.name,
|
||||
label: agentEntity.label,
|
||||
icon: agentEntity.icon,
|
||||
description: agentEntity.description,
|
||||
prompt: agentEntity.prompt,
|
||||
modelId: agentEntity.modelId,
|
||||
responseFormat: agentEntity.responseFormat,
|
||||
workspaceId: agentEntity.workspaceId,
|
||||
isCustom: agentEntity.isCustom,
|
||||
uniqueIdentifier: agentEntity.standardId || agentEntity.id,
|
||||
};
|
||||
};
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
import { type StandardAgentDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-agents/types/standard-agent-definition.interface';
|
||||
|
||||
export const transformStandardAgentDefinitionToFlatAgent = (
|
||||
standardAgentDefinition: StandardAgentDefinition,
|
||||
workspaceId: string,
|
||||
): FlatAgent => {
|
||||
return {
|
||||
...standardAgentDefinition,
|
||||
id: v4(),
|
||||
workspaceId,
|
||||
uniqueIdentifier: standardAgentDefinition.standardId || v4(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user