chore: remove log input to avoid confusing (#1987)

This commit is contained in:
Huu Le
2025-05-28 17:40:03 +07:00
committed by GitHub
parent 71598f86d7
commit 766054ba67
2 changed files with 11 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@llamaindex/workflow": patch
---
Improve agent workflow logging
@@ -324,7 +324,9 @@ export class AgentWorkflow implements Workflow {
} else {
throw new Error("No user message or chat history provided");
}
if (this.verbose) {
console.log(`Starting agent ${this.rootAgentName}`);
}
return agentInputEvent.with({
input: await memory.getMessages(),
currentAgentName: this.rootAgentName,
@@ -359,12 +361,6 @@ export class AgentWorkflow implements Workflow {
throw new Error("No valid agent found");
}
if (this.verbose) {
console.log(
`[Agent ${agent.name}]: Running for input: ${event.data.input[event.data.input.length - 1]?.content}`,
);
}
const output = await agent.takeStep(
this.stateful.getContext(),
this.stateful.getContext().state,
@@ -519,6 +515,9 @@ export class AgentWorkflow implements Workflow {
const messages = await this.stateful
.getContext()
.state.memory.getMessages();
if (this.verbose) {
console.log(`Starting agent ${nextAgentName}`);
}
return agentInputEvent.with({
input: messages,
currentAgentName: nextAgentName,