Skip to content

Files

Latest commit

f6c5217 · Mar 22, 2025

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 7, 2024
Mar 17, 2025
Sep 30, 2024
Mar 22, 2025
Aug 28, 2024
Sep 27, 2024
Sep 1, 2024
Aug 23, 2024
Aug 26, 2024
Aug 26, 2024
Sep 1, 2024
Feb 5, 2025
Aug 23, 2024
Aug 22, 2024

Programmable Prompt Engine (PPE) Script Examples 🤖

This directory contains a collection of example scripts to demonstrate the capabilities of the Programmable Prompt Engine (PPE). Each example showcases a different use case and highlights how to effectively leverage PPE's features.

Example Scripts

  • calculator:
    • A simple calculator agent that demonstrates how to use the -> operator to connect script outputs to subsequent scripts, creating complex workflows.
    • Workflow:
      1. The LLM receives a mathematical expression (content).
      2. It processes the expression and outputs a thought process (thinking).
      3. The extract-calc-result script then extracts the final calculated result from the LLM's output.
  • extract-calc-result:
    • This script defines an AI workflow for extracting the result of a calculated math problem from text.
    • Input: The script receives the LLM's output (content) as input.
    • Output: A JSON object containing:
      • result: The final calculated result (number, object, boolean, or string).
      • steps: A list of steps taken by the LLM during the calculation process.
      • answer: The LLM's final answer.
  • resolve-math-problem.ai:
    • A demo agent for resolving math problems.
    • Input: Takes a user's math problem as a string.
    • Workflow:
      • If content is provided, it starts the problem-solving process.
      • If no content is provided, it greets the user and introduces itself as a math assistant.
  • call-translator:
    • This example showcases how to invoke the translator lib script.
  • char-dobby:
    • An interactive demo featuring a character agent named Dobby.
    • Demonstrates the use of the type keyword in the configuration section.
  • recipe:
    • A Multilingual Recipe Assistant demo
    • Key Features:
      • Multilingual Support: Understands and responds in multiple languages.
      • Cuisine Specificity: Provides recipes from a specific cuisine.
      • Ingredient-Based Recommendations: Suggests recipes based on available ingredients.
      • JSON Output Format: Optionally outputs responses in JSON format.
    • Input:
      • ingredients: A list of available ingredients.
      • cuisine: (Optional) Desired cuisine type.
      • lang: (Optional) User's preferred language.
      • json: (Optional) Boolean flag for JSON output.
    • Output:
      • An array of recipe objects, each containing:
        • recipeName: Name of the recipe.
        • instructions: Cooking steps.
        • ingredients: Ingredient list with name and amount.
        • reason: Rationale behind the suggestion.
  • translator-simple:
    • A simple translator agent demo.
    • Translation Task: Translate text from one language to another.
    • Input:
      • content: Text to be translated (required).
      • target: Target language (required).
      • lang: Original language (optional).
    • Output:
      • A JSON object containing:
      • translation: The translated text.
      • original: The original text.
      • lang: The original language.
      • target_lang: The target language.
      • reason: Explanation of the translation process (optional).
    • Parameters:
      • continueOnLengthLimit: Allows translation to continue even if the text exceeds a length limit.
      • maxRetry: Specifies the maximum number of retries for the translation.
      • response_format: Sets the output format to JSON.