ST-Prompt-Template  by zonde306

Dynamic prompt engineering for AI chatbots

Created 1 year ago
294 stars

Top 89.7% on SourcePulse

GitHubView on GitHub
Project Summary

This extension enhances SillyTavern by integrating EJS templating, allowing users to embed full JavaScript logic directly into prompts, character cards, and World Info. It targets creative AI users and developers seeking advanced control over dynamic content generation and state management in AI interactions. The primary benefit is moving beyond static text to create highly responsive and complex AI conversational experiences.

How It Works

The project leverages EJS (Embedded JavaScript templating) to process JavaScript code blocks (<% ... %>) and variables (<%- ... %>) within SillyTavern's text fields. This enables dynamic prompt construction before LLM interaction and dynamic response rendering afterward. Core advantages include conditional logic, loops, and sophisticated variable manipulation, offering precise control over prompt structure and AI state management through a comprehensive API.

Quick Start & Requirements

Installation is performed directly within SillyTavern via the Extensions panel. Paste the repository URL, click "Install for all users," and then enable the extension. The primary prerequisite is a functional SillyTavern instance. Detailed feature descriptions and API references are available in features.md and reference.md respectively.

Highlighted Details

  • Advanced Scripting: Embed JavaScript logic (<% ... %>) in prompts, character definitions, and World Info.
  • Dynamic Generation/Rendering: Process templates before sending to the LLM and after receiving responses for dynamic content.
  • Prompt Injection: Utilize [GENERATE:BEFORE] and @INJECT syntax for precise control over prompt structure and content placement.
  • Comprehensive API: Access built-in functions like getvar, setvar, getwi, and getchar for state management.
  • Scoped Variables: Manage state across global, chat-specific, and message-specific scopes.
  • Compatibility: Fully functional alongside SillyTavern's original macro syntax.

Maintenance & Community

The provided documentation does not detail specific contributors, sponsorships, partnerships, or community channels (e.g., Discord, Slack, roadmap).

Licensing & Compatibility

This project is released under the AGPL-3.0 License. This strong copyleft license requires derivative works to be shared under the same terms, potentially impacting integration with closed-source or commercial applications.

Limitations & Caveats

The extension is dependent on the SillyTavern application. The advanced JavaScript capabilities, while powerful, may introduce a learning curve for less technical users. The AGPL-3.0 license imposes significant obligations for redistribution and modification.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
36 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
12 more.

rasa by RasaHQ

0.0%
21k
AI framework for automating text and voice conversations
Created 9 years ago
Updated 5 days ago
Feedback? Help us improve.