Show tool execution messages in AI agent chat (#13117)
https://github.com/user-attachments/assets/c0a42726-50ac-496e-a993-9d6076a84a6a --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
+9
-9
@@ -616,14 +616,16 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
};
|
||||
}
|
||||
case WorkflowActionType.AI_AGENT: {
|
||||
const newAgent = await this.agentService.createOneAgent(
|
||||
const newAgent = await this.agentService.createOneAgentAndFirstThread(
|
||||
{
|
||||
name: 'AI Agent Workflow Step',
|
||||
label: 'AI Agent Workflow Step',
|
||||
name: 'ai-agent-workflow',
|
||||
description: 'Created automatically for workflow step',
|
||||
prompt: '',
|
||||
modelId: 'gpt-4o',
|
||||
modelId: 'auto',
|
||||
},
|
||||
workspaceId,
|
||||
this.scopedWorkspaceContextFactory.create().userWorkspaceId,
|
||||
);
|
||||
|
||||
if (!isDefined(newAgent)) {
|
||||
@@ -636,15 +638,13 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
const userWorkspaceId =
|
||||
this.scopedWorkspaceContextFactory.create().userWorkspaceId;
|
||||
|
||||
if (!userWorkspaceId) {
|
||||
throw new WorkflowVersionStepException(
|
||||
'User workspace ID not found',
|
||||
WorkflowVersionStepExceptionCode.FAILURE,
|
||||
if (userWorkspaceId) {
|
||||
await this.agentChatService.createThread(
|
||||
newAgent.id,
|
||||
userWorkspaceId,
|
||||
);
|
||||
}
|
||||
|
||||
await this.agentChatService.createThread(newAgent.id, userWorkspaceId);
|
||||
|
||||
return {
|
||||
id: newStepId,
|
||||
name: 'AI Agent',
|
||||
|
||||
Reference in New Issue
Block a user