Skip to content

TemplateRenderer should support retrieving required variables from the template. #4251

@sunyuhan1998

Description

@sunyuhan1998

Expected Behavior

Currently, TemplateRenderer only supports rendering templates. It would be highly beneficial if it could also support parsing the required variables from a given template, as this would greatly assist us in proactively validating templates. For example, in org.springframework.ai.rag.util.PromptAssert#templateHasRequiredPlaceholders, the current validation relies solely on contains, which is clearly prone to oversights.

Current Behavior

Currently, TemplateRenderer only supports rendering templates.

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