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.3.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.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for promptev-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d85218a568bd0527fa7ea924ad46692c75596d405a69ed74bf7e0369bed6e9cb
MD5 fbd85058227919a21a0e19c95d05c454
BLAKE2b-256 78b6c7649099b6bc6b07c9243d1e226e5a6baaecb5720f974f6b823ff0069d2b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for promptev-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0570deed96d894b68b79439bb7239ad560e7e6fcd765cf835628d4b713adb2d
MD5 e755f3873924871de6efd0d05c6129a5
BLAKE2b-256 f991c9526be4ced367816a437f6030d6051963266fa04c9780022ed533fe0182

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