5 ms·
Show HN: AI Programmable Prompt Engine - new way to manage and reuse your prompt
- riceball 2y ago# Build Reusable & Programmable Prompt Engineering Workflows Introducing PPE (Programmable Prompt Engine), a revolutionary open-source framework that transforms prompt engineering into a modular, reusable, and code-like experience! `@offline-ai/cli` is a lightweight, javascript-based interpreter CLI for the Programmable Prompt Script Engine (`ai-agent`), used to directly run the Programmable Prompt Engine: https://github.com/offline-ai/ppe https://github.com/offline-ai/ppe script. *PPE allows you to:* * Build reusable prompt scripts: Treat prompts as code! Define functions, use conditionals, and leverage reusable components for efficient prompt design. * Simplify prompt management: Organize prompts into libraries for easy access and sharing. * Boost developer productivity: Say goodbye to manual prompt tweaking. PPE empowers developers to write and manage prompts like they write any other code. * Define custom prompt types: Create specialized prompt types tailored to your specific needs, like character roles or domain-specific prompts. Key Features: * YAML-based syntax: Intuitive and easy to learn, even for non-programmers. * Powerful scripting capabilities: Use conditional logic, functions, and event handlers for dynamic prompt generation. * Multi-model support: Design prompts that work seamlessly across different LLMs. * Interactive debugging: Easily test and refine your prompts within the PPE environment. Example: ```yaml system: "You are a helpful assistant." user: |- What is the name of the tiny blue fish who helps Marlin find his son in “Finding Nemo”? A. Dory; B. Squirt; C. Nemo; D. Crush assistant: "The correct answer is [[Result:|A|B|C|D]]. Because [[Reason]]" ``` Get a summary from file: ```yaml user: "Summarize the following file: @file(file.txt)" assistant: "[[summary]]" ``` * the `@file` is another PPE script in the lib directory. Advanced Features: * Advanced AI replacements: Inject dynamic content based on LLM responses. * Custom script types: Define reusable prompt structures like character roles. * Event handling: Trigger actions based on specific events during the conversation. PPE is currently under development, but we're excited to share our progress with the community! Join us on GitHub: https://github.com/offline-ai/cli https://github.com/offline-ai/cli Let's build the future of prompt engineering together!