Annotation Interface ChatMemoryProviderSupplier


@Retention(RUNTIME) @Target(METHOD) public @interface ChatMemoryProviderSupplier
Marks a method as a supplier of the ChatMemoryProvider that an agent can utilize during its operation. The annotated method must be static, takes the memoryId as argument, and return an instance of ChatMemory. Besides the memoryId, it can declare parameters resolved through a SupplierParameterResolver.

Example:


    public interface SupportAgent {
        @Agent("A customer support agent")
        String assist(@V("customerQuery") String customerQuery);

        @ChatMemoryProviderSupplier
        static ChatMemory chatMemory(Object memoryId) {
            return MessageWindowChatMemory.withMaxMessages(10);
        }
    }