Skip to content

Enhance Spring AI Tool Calling with @RequiresConsent #3813

Open
@vinsguru

Description

@vinsguru

Current Spring AI's tool calling mechanism allows Large Language Models (LLMs) to suggest and execute methods annotated with @tool. It is powerful, it lacks a built-in, declarative way to signify that a particular tool's execution by enabling a clear "human-in-the-loop" mechanism for tool execution.

@Tool(description = "Deletes the given book by id")
@RequiresConsent(message = "The book {bookId} is going to be deleted. Do you approve?")
public void deleteBookById(String bookId) {
    // Actual logic to delete a book
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions