Annotation Interface SystemMessageProviderSupplier


@Retention(RUNTIME) @Target(METHOD) public @interface SystemMessageProviderSupplier
Marks a method as a system message provider for an agent. The annotated method must be static, accept an Object parameter (the memoryId), and return a String (the system message).

This provides a declarative alternative to programmatically calling AgentBuilder.systemMessageProvider(java.util.function.Function), and is useful when the system message needs to be dynamically computed at runtime.

Example:


    public interface DynamicAgent {

        @Agent("An agent with a dynamic system message")
        String chat(@V("request") String request);

        @SystemMessageProviderSupplier
        static String systemMessageProvider(Object memoryId) {
            return "You are an assistant for user " + memoryId;
        }
    }