Skip to content
Open
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 @@ -97,6 +97,7 @@
* @see org.a2aproject.sdk.server.requesthandlers.DefaultRequestHandler
* @see org.a2aproject.sdk.spec.AgentCard
*/
@FunctionalInterface
public interface AgentExecutor {
/**
* Executes the agent's business logic for a message.
Expand Down Expand Up @@ -147,5 +148,7 @@ public interface AgentExecutor {
* @throws org.a2aproject.sdk.spec.TaskNotCancelableError if this agent does not support cancellation
* @throws A2AError if cancellation is supported but failed to execute
*/
void cancel(RequestContext context, AgentEmitter emitter) throws A2AError;
default void cancel(RequestContext context, AgentEmitter emitter) throws A2AError {
throw new org.a2aproject.sdk.spec.TaskNotCancelableError("Agent execution is not cancelable.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an import rather than a FQN

}
}
Loading