Declarative Prompt-Programming Framework: Difference between revisions

From GM-RKB
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
** It can typically enable [[Modular Reuse]] through [[import mechanism]]s and [[include directive]]s for [[prompt component]]s.
** It can typically enable [[Modular Reuse]] through [[import mechanism]]s and [[include directive]]s for [[prompt component]]s.
** It can typically abstract [[Model-Specific Detail]]s, creating a [[model-agnostic representation]] of [[declarative prompt-programming intention]]s.
** It can typically abstract [[Model-Specific Detail]]s, creating a [[model-agnostic representation]] of [[declarative prompt-programming intention]]s.
** It can typically support [[Version Control]] integration due to its [[text-based representation]].
** It can typically enforce [[Output Structure]] through [[schema definition]]s, [[constraint]]s, or [[type system]]s.
** ...
** ...
** It can often include [[Templating Directive]]s (using systems like [[Jinja2]] or [[Liquid]]) for [[dynamic content generation]].
** It can often include [[Templating Directive]]s (using systems like [[Jinja2]] or [[Liquid]]) for [[dynamic content generation]].
** It can often implement [[Control Flow Construct]]s such as [[declarative prompt-programming loop]]s, [[declarative prompt-programming conditional]]s, and [[declarative prompt-programming function definition]]s.
** It can often implement [[Control Flow Construct]]s such as [[declarative prompt-programming loop]]s, [[declarative prompt-programming conditional]]s, and [[declarative prompt-programming function definition]]s.
** It can often provide [[Type Checking]] for [[declarative prompt-programming variable]]s to ensure [[data integrity]].
** It can often provide [[Type Checking]] for [[declarative prompt-programming variable]]s to ensure [[data integrity]].
** It can often support [[Model Chaining]] to create [[multi-step declarative prompt-programming workflow]]s.
** It can often support [[Multi-Step Workflow]]s by [[declarative prompt-programming chain]]ing or [[declarative prompt-programming orchestration]].
** It can often enable [[Collaborative Prompt Development]] through its [[human-readable format]] and [[defined structure]].
** It can often enable [[Collaborative Prompt Development]] through its [[human-readable format]] and [[defined structure]].
** It can often facilitate [[Prompt Versioning]] to track [[declarative prompt-programming evolution]].
** It can often facilitate [[Prompt Versioning]] to track [[declarative prompt-programming evolution]].
** It can often include [[Error Handling Mechanism]]s that manage [[LLM output failure]]s through [[retry logic]] and [[fallback strategy]].
** It can often provide [[Validation Feedback Loop]]s where [[invalid output]]s trigger [[corrective reprompt]]s.
** ...
** ...
** It can range from being a [[Simple Declarative Prompt-Programming Framework]] to being a [[Complex Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming feature complexity]].
** It can range from being a [[Simple Declarative Prompt-Programming Framework]] to being a [[Complex Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming feature complexity]].
Line 20: Line 22:
** It can range from being a [[Lightweight Declarative Prompt-Programming Framework]] to being a [[Comprehensive Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming integration capability]].
** It can range from being a [[Lightweight Declarative Prompt-Programming Framework]] to being a [[Comprehensive Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming integration capability]].
** It can range from being a [[Specialized Declarative Prompt-Programming Framework]] to being a [[Universal Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming model compatibility]].
** It can range from being a [[Specialized Declarative Prompt-Programming Framework]] to being a [[Universal Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming model compatibility]].
** It can range from being a [[Single-Call Declarative Prompt-Programming Framework]] to being a [[Multi-Step Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming orchestration complexity]].
** It can range from being a [[Code-Embedded Declarative Prompt-Programming Framework]] to being a [[Standalone Declarative Prompt-Programming Framework]], depending on its [[declarative prompt-programming host language relationship]].
** ...
** ...
** It can integrate with [[Retrieval-Augmented Generation Pipeline]]s for [[structured document processing]].
** It can integrate with [[Retrieval-Augmented Generation Pipeline]]s for [[structured document processing]].
Line 27: Line 31:
** It can incorporate [[External Knowledge Source]]s via [[declarative prompt-programming retrieval mechanism]]s.
** It can incorporate [[External Knowledge Source]]s via [[declarative prompt-programming retrieval mechanism]]s.
** It can work with [[Validation Tool]]s for [[declarative prompt-programming quality assurance]].
** It can work with [[Validation Tool]]s for [[declarative prompt-programming quality assurance]].
** It can integrate with [[CI/CD Pipeline]]s for [[automated prompt testing]] and [[prompt deployment]].
** It can connect to [[Output Validation System]]s for [[LLM output reliability enhancement]].
** It can support [[Safe Guardrail Integration]] for [[LLM response filtering]] and [[harmful content prevention]].
** ...
** ...
* <B>Examples:</B>
* <B>Examples:</B>
** [[Declarative Prompt-Programming Framework Implementation]]s, such as:
** [[Declarative Prompt-Programming Framework Syntax Approach]]es, such as:
*** [[YAML-Based Declarative Prompt-Programming Framework]]s, such as:
*** [[YAML-Based Declarative Prompt-Programming Framework]]s, such as:
**** [[IBM PDL (Prompt Declaration Language)]] using [[YAML]] with [[Jinja2]] for [[templating function]]s and [[type checking]] via [[JSON Schema]].
**** [[IBM PDL (Prompt Declaration Language)]] using [[YAML]] with [[Jinja2]] for [[templating function]]s, [[type checking]] via [[JSON Schema]], and [[control flow construct]]s like [[conditional]]s and [[loop]]s.
**** [[PromptLang]] developed by [[Netflix]] for [[content recommendation prompt system]]s.
**** [[Azure Prompt Flow]] representing [[multi-step workflow]]s as [[directed acyclic graph]]s with [[step definition]]s and [[data flow]]s.
**** [[Pathway Templates]] for [[declarative prompt-programming structured workflow]]s.
**** [[Pathway Templates]] for [[declarative prompt-programming structured workflow]]s.
*** [[JSON-Based Declarative Prompt-Programming Framework]]s, such as:
*** [[JSON-Based Declarative Prompt-Programming Framework]]s, such as:
Line 38: Line 45:
**** [[Prompt Schema]] for [[declarative prompt-programming standardization]].
**** [[Prompt Schema]] for [[declarative prompt-programming standardization]].
*** [[DSL-Based Declarative Prompt-Programming Framework]]s, such as:
*** [[DSL-Based Declarative Prompt-Programming Framework]]s, such as:
**** [[LMQL (Language Model Query Language)]] using [[constraint expression]]s with [[where clause]]s to enforce [[output pattern]]s.
**** [[BAML (Basically a Made-up Language)]] implementing [[prompts as function]]s with [[parameter type]]s and [[return type]]s.
**** [[Colang]] in [[NVIDIA NeMo Guardrails]] for [[conversational AI safety]] and [[dialogue flow management]].
**** [[Impromptu]] for [[model-driven declarative prompt-programming]] with [[platform independence]].
**** [[Impromptu]] for [[model-driven declarative prompt-programming]] with [[platform independence]].
**** [[Questo]] for [[declarative query generation]].
**** [[Questo]] for [[declarative query generation]].
*** [[Code-Embedded Declarative Prompt-Programming Framework]]s, such as:
**** [[Microsoft Guidance]] with its [[inline control directive]]s for [[stepwise generation control]].
**** [[DSPy]] providing [[declarative module]]s and [[signature]]s for [[LLM-powered component]]s.
**** [[Marvin AI Functions]] using [[Python decorator]]s and [[type annotation]]s for [[LLM function specification]].
** [[Declarative Prompt-Programming Framework Complexity Level]]s, such as:
*** [[Comprehensive Declarative Prompt-Programming Framework]]s, such as:
**** [[IBM PDL (Prompt Declaration Language)]] supporting [[full control flow]], [[type checking]], [[model chaining]], and [[function definition]]s.
**** [[Azure Prompt Flow]] with [[enterprise feature]]s for [[LLMOps]], [[experiment tracking]], and [[deployment management]].
**** [[DSPy]] offering [[teleprompter]]s for [[prompt optimization]] and [[advanced module composition]].
*** [[Moderate Declarative Prompt-Programming Framework]]s, such as:
**** [[BAML]] balancing [[schema validation]] with [[approachable syntax]] using [[function metaphor]]s.
**** [[LMQL]] focusing on [[constrained generation]] and [[output filtering]].
**** [[NeMo Guardrails]] specializing in [[conversational safety rule]]s and [[dialogue policy]].
*** [[Lightweight Declarative Prompt-Programming Framework]]s, such as:
**** [[Marvin AI Functions]] emphasizing [[developer simplicity]] through [[familiar function syntax]].
**** [[Guardrails (RAIL)]] focusing on [[output validation]] and [[schema conformance]].
** [[Declarative Prompt-Programming Framework Application Domain]]s, such as:
** [[Declarative Prompt-Programming Framework Application Domain]]s, such as:
*** [[Controlled Chatbot Declarative Prompt-Programming Framework]]s for [[regulated conversation flow]].
*** [[General-Purpose Declarative Prompt-Programming Framework]]s for [[cross-domain application]]s, such as:
*** [[RAG Pipeline Declarative Prompt-Programming Framework]]s for [[document retrieval workflow]].
**** [[IBM PDL]] supporting [[universal usage]] across [[domain]]s.
*** [[Regulated Domain Declarative Prompt-Programming Framework]]s for [[finance]] and [[legal]] applications requiring [[auditability]].
**** [[DSPy]] enabling [[self-optimizing pipeline]]s for [[diverse task]]s.
*** [[Code Generation Declarative Prompt-Programming Framework]]s for [[structured programming task]]s.
*** [[Specialized Domain Declarative Prompt-Programming Framework]]s, such as:
*** [[Chain-of-Thought Declarative Prompt-Programming Framework]]s for [[multi-step reasoning process]]es.
**** [[Guardrails (RAIL)]] for [[output validation]] and [[schema enforcement]].
*** [[ReAct Agent Declarative Prompt-Programming Framework]]s for [[reasoning and acting cycle]]s.
**** [[NeMo Guardrails]] for [[conversational AI safety]] and [[topic management]].
** [[Declarative Prompt-Programming Framework Capability Implementation]]s, such as:
**** [[Controlled Chatbot Declarative Prompt-Programming Framework]]s for [[regulated conversation flow]].
*** [[Templating Integration Declarative Prompt-Programming Framework]]s, such as:
**** [[RAG Pipeline Declarative Prompt-Programming Framework]]s for [[document retrieval workflow]].
**** [[Jinja2-Powered Declarative Prompt-Programming Framework]]s for [[dynamic text substitution]].
**** [[Regulated Domain Declarative Prompt-Programming Framework]]s for [[finance]] and [[legal]] applications requiring [[auditability]].
**** [[Liquid-Based Declarative Prompt-Programming Framework]]s for [[conditional content inclusion]].
**** [[Code Generation Declarative Prompt-Programming Framework]]s for [[structured programming task]]s.
**** [[Chain-of-Thought Declarative Prompt-Programming Framework]]s for [[multi-step reasoning process]]es.
**** [[ReAct Agent Declarative Prompt-Programming Framework]]s for [[reasoning and acting cycle]]s.
** [[Declarative Prompt-Programming Framework Feature Implementation]]s, such as:
*** [[Schema Validation Declarative Prompt-Programming Framework]]s, such as:
**** [[Guardrails (RAIL)]] with [[RAIL specification]]s for [[output validation]] and [[automated retries]].
**** [[BAML]] using [[type-driven prompt]]s and [[schema-based parsing]].
*** [[Control Flow Declarative Prompt-Programming Framework]]s, such as:
*** [[Control Flow Declarative Prompt-Programming Framework]]s, such as:
**** [[Conditional Logic Declarative Prompt-Programming Framework]]s for [[branching prompt path]]s.
**** [[IBM PDL]] with [[declarative loop]]s, [[conditional branch]]es, and [[function call]]s.
**** [[Loop-Enabled Declarative Prompt-Programming Framework]]s for [[iterative prompt processing]].
**** [[Microsoft Guidance]] using [[inline directive]]s for [[generation control]].
*** [[Orchestration-Focused Declarative Prompt-Programming Framework]]s, such as:
**** [[Azure Prompt Flow]] with [[DAG-based workflow]]s and [[step sequencing]].
**** [[DSPy Module]]s for [[composable pipeline]]s and [[optimized chain]]s.
** ...
** ...
* <B>Counter-Examples:</B>
* <B>Counter-Examples:</B>
** [[Prompt-Optimization Framework]]s, such as [[DSPy]] and [[TextGrad]], which focus on [[prompt tuning]] and [[automation]] rather than [[declarative structure]] and [[human readability]].
** [[Prompt-Optimization Framework]]s, such as [[TextGrad]] and early versions of [[DSPy]], which focus on [[prompt tuning]] and [[automation]] rather than [[declarative structure]] and [[human readability]].
** [[Imperative Prompt-Programming Framework]]s, which use [[procedural code]] to directly define the [[execution flow]] of [[LLM interaction]]s with emphasis on [[how]] rather than [[what]].
** [[Imperative Prompt-Programming Framework]]s, which use [[procedural code]] to directly define the [[execution flow]] of [[LLM interaction]]s with emphasis on [[how]] rather than [[what]].
** [[Ad-hoc Prompt Design Approach]]es, which lack [[formal structure]], [[schema validation]], and [[reusable component]]s that characterize [[declarative prompt-programming framework]]s.
** [[Ad-hoc Prompt Design Approach]]es, which lack [[formal structure]], [[schema validation]], and [[reusable component]]s that characterize [[declarative prompt-programming framework]]s.
** [[Template-Only System]]s, which provide basic [[text substitution]] without the full [[declarative prompt-programming capabilities]] like [[schema validation]] and [[control flow]].
** [[Template-Only System]]s, which provide basic [[text substitution]] without the full [[declarative prompt-programming capabilities]] like [[schema validation]] and [[control flow]].
** [[Model-Specific Framework]]s that tightly couple [[prompt design]] to [[specific LLM implementation]]s, lacking the [[model-agnostic abstraction]] of [[declarative prompt-programming framework]]s.
** [[Model-Specific Framework]]s that tightly couple [[prompt design]] to [[specific LLM implementation]]s, lacking the [[model-agnostic abstraction]] of [[declarative prompt-programming framework]]s.
* <B>See:</B> [[Prompt Engineering]], [[LLM Orchestration Framework]], [[Declarative Programming]], [[YAML Configuration]], [[JSON Schema]], [[Domain-Specific Language]], [[Model-Driven Engineering]], [[Structured Output Generation]], [[Retrieval-Augmented Generation]], [[Chain-of-Thought Prompting]].
** [[Raw API Interaction]]s where [[prompt text]] is directly passed to [[LLM API]] without [[intermediate representation]] or [[declarative structure]].
** [[Hardcoded Prompt System]]s that embed [[prompt string]]s directly in [[application code]], preventing [[separation of concern]]s and [[prompt versioning]].
* <B>See:</B> [[Prompt Engineering]], [[LLM Orchestration Framework]], [[Declarative Programming]], [[YAML Configuration]], [[JSON Schema]], [[Domain-Specific Language]], [[Model-Driven Engineering]], [[Structured Output Generation]], [[Retrieval-Augmented Generation]], [[Chain-of-Thought Prompting]], [[LLMOps]], [[Prompt Template]], [[Prompt Management]], [[AI Function]], [[Workflow Orchestration]].


----
----

Revision as of 21:02, 1 May 2025

A Declarative Prompt-Programming Framework is a prompt-programming framework that uses a declarative syntax to express the structure, inputs, outputs, and constraints of LLM interactions while hiding implementation details.