Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix error log to show the right agent type #2809

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ public void execute(Input input, ActionListener<Output> listener) {
(ConversationIndexMemory.Factory) memoryFactoryMap.get(memorySpec.getType());
conversationIndexMemoryFactory.create(question, memoryId, appType, ActionListener.wrap(memory -> {
inputDataSet.getParameters().put(MEMORY_ID, memory.getConversationId());
ActionListener<Object> agentActionListener = createAgentActionListener(listener, outputs, modelTensors);
ActionListener<Object> agentActionListener = createAgentActionListener(
listener,
outputs,
modelTensors,
mlAgent.getType()
);
// get question for regenerate
if (regenerateInteractionId != null) {
log.info("Regenerate for existing interaction {}", regenerateInteractionId);
Expand All @@ -160,7 +165,12 @@ public void execute(Input input, ActionListener<Output> listener) {
listener.onFailure(ex);
}));
} else {
ActionListener<Object> agentActionListener = createAgentActionListener(listener, outputs, modelTensors);
ActionListener<Object> agentActionListener = createAgentActionListener(
listener,
outputs,
modelTensors,
mlAgent.getType()
);
executeAgent(inputDataSet, mlAgent, agentActionListener);
}
}
Expand Down Expand Up @@ -234,7 +244,8 @@ private void executeAgent(RemoteInferenceInputDataSet inputDataSet, MLAgent mlAg
private ActionListener<Object> createAgentActionListener(
ActionListener<Output> listener,
List<ModelTensors> outputs,
List<ModelTensor> modelTensors
List<ModelTensor> modelTensors,
String agentType
) {
return ActionListener.wrap(output -> {
if (output != null) {
Expand Down Expand Up @@ -274,7 +285,7 @@ private ActionListener<Object> createAgentActionListener(
listener.onResponse(null);
}
}, ex -> {
log.error("Failed to run flow agent", ex);
log.error("Failed to run " + agentType + " agent", ex);
listener.onFailure(ex);
});
}
Expand Down
Loading