Skip to main content

Add your description here

Project description

broprompt

Lightweight Python library for prompt template management with dynamic parameter handling.

Features

  • Load prompt templates from markdown files
  • Dynamic parameter access via dot notation
  • Template + parameter combination into final prompt strings
  • Export/import parameters as dictionaries
  • Function-to-tool conversion utilities
  • Parameter validation and extraction

Usage

from broprompt.prompt_engineering import Prompt

# Load template from markdown file
prompts = Prompt.from_markdown("system_prompt.md")

# Set parameters
prompts.params.role = "assistant"
prompts.params.domain = "coding"

# Get final prompt string
final_prompt = prompts.str

# Export parameters
params_dict = prompts.to_dict()

# Import parameters
prompts.from_dict({"role": "expert", "tone": "professional"})

Tools Module

from broprompt.tools import convert_to_tool, register_tools

# Convert function to tool definition
def my_function(name: str, age: int) -> str:
    """Greets a person with their name and age."""
    return f"Hello {name}, you are {age} years old!"

tool_def = convert_to_tool(my_function)

# Register multiple tools
tools = register_tools([my_function])

Template Format

Use {parameter_name} placeholders in your markdown files:

# System Prompt

You are {role}, specialized in {domain}.
Respond in {tone} tone.

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

broprompt-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

broprompt-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file broprompt-0.1.2.tar.gz.

File metadata

  • Download URL: broprompt-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for broprompt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c47aa91dae2a6c845c090e854a7ce9df28860bfbff4a80abf1c59b095e74686d
MD5 4efd4953c655b28178982b6e1249c5e2
BLAKE2b-256 fd4b70c0c74daf757840cfbd2e58ab498177f523576c5318d9a5b7609465151e

See more details on using hashes here.

File details

Details for the file broprompt-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: broprompt-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for broprompt-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a4ea093b0a6dfb6359ee0384e261352a8dedefd332939b34ecd077e0e75debd
MD5 06dfb680d1aae938b340b90f3deec1d1
BLAKE2b-256 9be61514647b2e0fd377e62569534a1a4acdf67d782c0719ac7cae51e2452465

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page