Dotpromptz is a language-neutral executable prompt template file format for Generative AI.
Project description
Dotprompt: Executable GenAI Prompt Templates
Dotprompt is an executable prompt template file format for Generative AI. It is designed to be agnostic to programming language and model provider to allow for maximum flexibility in usage. Dotprompt extends the popular Handlebars templating language with GenAI-specific features.
What's an executable prompt template?
An executable prompt template is a file that contains not only the text of a prompt but also metadata and instructions for how to use that prompt with a generative AI model. Here's what makes Dotprompt files executable:
-
Metadata Inclusion: Dotprompt files include metadata about model configuration, input requirements, and expected output format. This information is typically stored in a YAML frontmatter section at the beginning of the file.
-
Self-Contained Entity: Because a Dotprompt file contains all the necessary information to execute a prompt, it can be treated as a self-contained entity. This means you can "run" a Dotprompt file directly, without needing additional configuration or setup in your code.
-
Model Configuration: The file specifies which model to use and how to configure it (e.g., temperature, max tokens).
-
Input Schema: It defines the structure of the input data expected by the prompt, allowing for validation and type-checking.
-
Output Format: The file can specify the expected format of the model's output, which can be used for parsing and validation.
-
Templating: The prompt text itself uses Handlebars syntax, allowing for dynamic content insertion based on input variables.
This combination of features makes it possible to treat a Dotprompt file as an executable unit, streamlining the process of working with AI models and ensuring consistency across different uses of the same prompt.
Example .prompt file
Here's an example of a Dotprompt file that extracts structured data from provided text:
---
model: googleai/gemini-1.5-pro
input:
schema:
text: string
output:
format: json
schema:
name?: string, the full name of the person
age?: number, the age of the person
occupation?: string, the person's occupation
---
Extract the requested information from the given text. If a piece of information is not
present, omit that field from the output. Text:
{{text}}
This Dotprompt file:
- Specifies the use of the
googleai/gemini-1.5-promodel. - Defines an input schema expecting a
textstring. - Specifies that the output should be in JSON format.
- Provides a schema for the expected output, including fields for name, age, and occupation.
- Uses Handlebars syntax (
{{text}}) to insert the input text into the prompt.
When executed, this prompt would take a text input, analyze it using the specified AI model, and return a structured JSON object with the extracted information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotpromptz-0.1.4.tar.gz.
File metadata
- Download URL: dotpromptz-0.1.4.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb62e4e14dc370a896bce2faeec1ad58c858e7e28b4abe30ad0ac2a64857fcef
|
|
| MD5 |
4424e358ab6fe4cd22e1a08894e10b51
|
|
| BLAKE2b-256 |
cb309ae76329360bb35eae1df32e80005de8ced53d8838a795fa392fe40ae88c
|
Provenance
The following attestation bundles were made for dotpromptz-0.1.4.tar.gz:
Publisher:
publish_python_dotpromptz_package.yml on google/dotprompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dotpromptz-0.1.4.tar.gz -
Subject digest:
bb62e4e14dc370a896bce2faeec1ad58c858e7e28b4abe30ad0ac2a64857fcef - Sigstore transparency entry: 766061926
- Sigstore integration time:
-
Permalink:
google/dotprompt@d1097f5181d6c3ad7480a9b249ee16d1f6d0f79f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/google
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_python_dotpromptz_package.yml@d1097f5181d6c3ad7480a9b249ee16d1f6d0f79f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dotpromptz-0.1.4-py3-none-any.whl.
File metadata
- Download URL: dotpromptz-0.1.4-py3-none-any.whl
- Upload date:
- Size: 52.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
051b8098c9b33eea48e3ac0b11c383606bf151f7bc7302ce144300daa8556273
|
|
| MD5 |
5072288090d94b86e10c294ee599d567
|
|
| BLAKE2b-256 |
7173be9df66551c507ba5ca86ab570837f2f5d112df4d8d64870d947b0dde753
|
Provenance
The following attestation bundles were made for dotpromptz-0.1.4-py3-none-any.whl:
Publisher:
publish_python_dotpromptz_package.yml on google/dotprompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dotpromptz-0.1.4-py3-none-any.whl -
Subject digest:
051b8098c9b33eea48e3ac0b11c383606bf151f7bc7302ce144300daa8556273 - Sigstore transparency entry: 766061934
- Sigstore integration time:
-
Permalink:
google/dotprompt@d1097f5181d6c3ad7480a9b249ee16d1f6d0f79f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/google
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_python_dotpromptz_package.yml@d1097f5181d6c3ad7480a9b249ee16d1f6d0f79f -
Trigger Event:
workflow_dispatch
-
Statement type: