Skip to content

Add Support for Liquid Template Engine in Skills #344

@musicalmathmind

Description

@musicalmathmind

Summary

The purpose of this feature proposition is to introduce support for the Liquid template engine in the Semantic Kernel framework, allowing developers to create dynamic and reusable prompts for skills. This will enhance the flexibility and maintainability of skills and make it easier for developers to create complex, context-aware AI capabilities.

Background

Currently, the Semantic Kernel framework allows developers to build skills using LLM AI prompts, native computer code, or a hybrid of both. However, constructing and maintaining dynamic prompts can become cumbersome and challenging as the complexity of skills increases. The Liquid template engine, created by Shopify, offers a powerful and flexible solution to this problem, enabling developers to create dynamic templates with control flow, iteration, and variable interpolation.

Proposed Solution

Integrate the Liquid template engine into the Semantic Kernel framework. There is an open source library called Fluid that can parse templates and generate render the output. This could be integrated into the Kernel natively, so that any skill could use liquid templates.

Benefits

  • Flexibility: The Liquid template engine allows developers to create more dynamic and context-aware prompts by supporting conditional rendering, loops, and variable interpolation.
  • Maintainability: By using templates, developers can reduce code duplication and make it easier to update and manage prompts as requirements change.
  • Reusability: Liquid templates encourage the creation of reusable prompts that can be shared across different skills or skill versions. As more ChatGPT like "intelligences" come online, this would also make these somewhat "cross-platform".

I'm willing to take the first shot at this after some discussion!

I'm also aware that this has the potential to be a single Skill that other skills can put in the pipeline, would love to discuss the pros and cons of each approach (making this a skill vs integrating it into the Kernel).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions