Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptRails SDK Examples

Code examples for the PromptRails SDKs — Python, JavaScript/TypeScript, and Go.

API v2 — these examples target the v2 SDKs (Python 0.9.0, JavaScript 0.9.0, Go 0.7.0). Agents are now agent or workflow only; model/sampling live on the agent version; the costs, scores, media, templates, sessions and dashboard resources were removed (use traces.get_summary for cost/usage).

⚠️ Unreleased dependency pins: the examples reference the published package specs (promptrails>=0.9.0, @promptrails/sdk@^0.9.0, and a feat/api-v2 pseudo-version of the go-sdk). Those v2 SDKs are not on PyPI/npm yet, so until they publish you must resolve them from the local sibling checkouts to run the examples (uv --with-editable, npm link, go get @feat/api-v2) — see each per-language README. Nothing in the manifests points at a local path; the pins/lockfiles reconcile automatically once the SDKs publish and the Go pseudo-version is repinned to its tag.

Prerequisites

  • A PromptRails account and API key
  • Set your API key as an environment variable:
export PROMPTRAILS_API_KEY="pr_key_..."

Examples

Example Python JavaScript Go
Basic — Client setup and configuration View View View
Agents — Create, execute, and manage agent / workflow agents View View View
Prompts — Content-only prompt templates & versioning View View View
Chat — Multi-turn conversations View View View
Streaming — Live SSE events for chat turns and executions View View View
Traces — Tracing, span trees, and usage summaries View View View
Executions — History, execution tree, and the approval inbox View View View
Costs — Usage & cost aggregates via traces.get_summary View View View
MCP Tools — External tool integrations View View View
Agent Triggers — Event-driven agent execution View View View
A2A — Agent-to-Agent communication View View View
Assets — Manage stored assets View View View

SDK Installation

These are the target published versions. Until they ship, the examples resolve the unreleased SDKs locally (see the ⚠️ note above and the per-language READMEs).

Python:

pip install "promptrails>=0.9.0"

JavaScript/TypeScript:

npm install @promptrails/sdk@^0.9.0

Go:

go get github.com/promptrails/go-sdk@v0.7.0

Links

About

SDK Examples

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages