Skip to main content

Promptev SDK for accessing Promptev API

Project description

promptev-client

A lightweight Python SDK to securely fetch compiled prompts from Promptev.ai using your project API key.


Installation

pip install promptev

What is Promptev?

Promptev helps teams manage, version, and collaborate on AI prompts at scale, with variables, live context packs, histories, cost estimation, and SDK access.


Usage

1. Initialize the client

from promptev import PromptevClient

client = PromptevClient(project_key="pv_sk_abc123yourkey")

2. Fetch a prompt with variables

output = client.get_prompt("onboarding-email", {
    "name": "Ava",
    "product": "Promptev"
})

print(output)
# Output: "Subject: Welcome, Ava! Hey Ava, Thanks for joining Promptev..."

3. Fetch a prompt without variables

output = client.get_prompt("static-welcome")
print(output)
# Output: "You are a helpful AI assistant ready to support the user."

⚠️ If the prompt has no variables, you can omit the second argument.


4. Async Usage (e.g. in FastAPI or notebooks)

import asyncio

async def run():
    prompt = await client.aget_prompt("faq-response", {
        "question": "How do I reset my password?"
    })
    print(prompt)

asyncio.run(run())

Example: Use with LLM APIs

OpenAI

from openai import OpenAI

client = OpenAI(api_key="sk-...")

prompt = promptev_client.get_prompt("explain-topic", {
    "topic": "Prompt Engineering"
})

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": prompt}]
)

print(response.choices[0].message.content)

Features

  • ✅ Supports prompts with or without variables
  • 🚀 Server-side compilation via POST (no client-side templating)
  • ⚡ Sync + Async methods: get_prompt and aget_prompt
  • 🔐 Works with any LLM provider (OpenAI, Claude, Gemini, etc.)

Error Handling

# ❌ Missing required variable
client.get_prompt("onboarding-email", { "name": "Leo" })
# ➜ ValueError: Missing required variables: product

Prompt Template Example

Subject: Welcome, {{ name }}!

Hey {{ name }},

Thanks for joining {{ product }}. We're thrilled to have you on board!

License

This SDK is commercial software by Promptev Inc.

By using this package, you agree to the terms in LICENSE.txt.

  • ✅ Free tier use allowed
  • 🚫 Production usage requires a subscription

Contact

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

promptev-0.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

promptev-0.0.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file promptev-0.0.2.tar.gz.

File metadata

  • Download URL: promptev-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for promptev-0.0.2.tar.gz
Algorithm Hash digest
SHA256 62d6dc052e634d760e9b9ad53d6db975438d47e2f19a6adbcd620b1d70908e29
MD5 26668cbdcb8e42c1499a27327a186211
BLAKE2b-256 c80249092de743410bba72e7899892d67b187b9450d678615199e2640776707a

See more details on using hashes here.

File details

Details for the file promptev-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: promptev-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for promptev-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1d51c0dcdd829539422de024e7683563ea352b071000ae644f53708148b4fc
MD5 d3ae73562acc0b9c2394bd1e979b6923
BLAKE2b-256 1593f5feb62590595a213a7ac1cbf3f95a698ea233162458601b4bf0c78b5e53

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