Appearance
Elsai Prompts
Package: elsai-prompts v1.1.0
Centralized prompt management with version control and traceability — prompts are stored and managed within Elsai Foundry, giving you a single source of truth for all prompt templates across your projects.
WARNING
v1.0.0 is deprecated. Upgrade to v1.1.0 or later. Prompts have migrated from Pezzo to Elsai Foundry.
Installation
bash
pip install --extra-index-url https://core-packages.elsai.ai/root/elsai-prompts/ elsai-prompts==1.1.0Requirements: Python >= 3.9
Why centralized prompts?
Hard-coding prompts in application code creates drift — different versions scattered across services with no history or rollback. Elsai Prompts gives you:
- Version control — full history of every prompt change
- Environment deployments — separate active versions per environment (dev / staging / prod)
- Traceability — know exactly which prompt version produced which output
- Lifecycle management — draft → review → published → deprecated
PromptManager
PromptManager is the main class for connecting to Elsai Foundry and retrieving prompts.
Initialisation
You can provide the API base URL either as a constructor argument or via an environment variable.
Option 1 — pass base_url directly:
python
from elsai_prompts.prompt_manager import PromptManager
prompt_manager = PromptManager(
api_key="your_elsai_api_key",
project_id="your_project_id",
base_url="https://your-api-url.com",
)Option 2 — set the environment variable:
bash
export PROMPT_MANAGER_API_URL="https://your-api-url.com"python
from elsai_prompts.prompt_manager import PromptManager
prompt_manager = PromptManager(
api_key="your_elsai_api_key",
project_id="your_project_id",
)Constructor parameters:
| Parameter | Required | Description |
|---|---|---|
api_key | Yes | Elsai Foundry API key |
project_id | Yes | Project ID from your Elsai Foundry workspace |
base_url | No | API base URL. If omitted, reads from PROMPT_MANAGER_API_URL env var |
Fetching a prompt
Use get_active_prompt_version() to retrieve the currently active (published) version of a prompt by name:
python
from elsai_prompts.prompt_manager import PromptManager
prompt_manager = PromptManager(
api_key="your_elsai_api_key",
project_id="your_project_id",
base_url="https://your-api-url.com",
)
prompt = prompt_manager.get_active_prompt_version(prompt_name="sampleprompt")
print(prompt)Method parameters:
| Parameter | Description |
|---|---|
prompt_name | The name of the prompt as defined in Elsai Foundry |
Using a prompt with an agent
Pass the retrieved prompt directly to an agent as its system prompt:
python
from elsai_prompts.prompt_manager import PromptManager
from elsai import Agent
prompt_manager = PromptManager(
api_key="your_elsai_api_key",
project_id="your_project_id",
base_url="https://your-api-url.com",
)
prompt = prompt_manager.get_active_prompt_version(prompt_name="customer-support")
agent = Agent(system_prompt=prompt)
result = agent("How do I reset my password?")
print(result)Version history
| Version | Changes |
|---|---|
| 1.1.0 | Migrated from Pezzo to Elsai Foundry; PromptManager with project_id and base_url |
| 1.0.0 | Deprecated — Pezzo-based prompt management |
Support
For SDK setup or API key access: support@elsaifoundry.ai