From c96cea200dc7c09d22e3db182c8d39479897d177 Mon Sep 17 00:00:00 2001 From: Seth Juarez Date: Wed, 16 Sep 2026 12:09:06 -0700 Subject: [PATCH] docs: align package install guidance with latest releases Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 15 ++++++----- runtime/csharp/scripts/release.py | 8 +++--- runtime/python/prompty/README.md | 8 +++--- runtime/rust/scripts/release.py | 8 +++--- runtime/typescript/scripts/release.mjs | 6 ++--- web/docs-examples/rust/Cargo.toml | 4 +-- .../rust/examples/agent_tool_calling.rs | 26 +++++++++---------- web/docs-examples/rust/examples/streaming.rs | 16 ++---------- .../typescript/package-lock.json | 14 +++++----- .../content/docs/core-concepts/streaming.mdx | 16 +++--------- .../content/docs/core-concepts/tracing.mdx | 4 +-- .../content/docs/getting-started/index.mdx | 8 ++---- web/src/content/docs/how-to/anthropic.mdx | 4 +-- web/src/content/docs/how-to/foundry.mdx | 4 +-- web/src/content/docs/how-to/openai.mdx | 4 +-- .../content/docs/implementation/csharp.mdx | 10 +++---- web/src/content/docs/implementation/index.mdx | 14 +++++----- .../docs/implementation/typescript.mdx | 23 ++++++++-------- web/src/content/docs/migration.mdx | 2 +- .../content/docs/tutorials/chat-assistant.mdx | 4 +-- .../content/docs/tutorials/rag-pipeline.mdx | 4 +-- .../docs/tutorials/tool-calling-agent.mdx | 4 +-- 22 files changed, 93 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 9085377e3..e762f5e36 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,10 @@ [![npm](https://img.shields.io/npm/v/@prompty/core?label=typescript)](https://www.npmjs.com/package/@prompty/core) [![VS Code](https://img.shields.io/visual-studio-marketplace/v/ms-toolsai.prompty?label=vs%20code)](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.prompty) -> **⚠️ v2 Alpha** — This is the v2 branch of Prompty, currently in alpha. The API, file format, and tooling are under active development and may change. Feedback welcome via [Issues](https://github.com/microsoft/prompty/issues). +> **Prompty v2** — Prompty v2 packages are available for Python, TypeScript, +> Rust, and C#. The shared `.prompty` format is aligned across runtimes by +> generated model types and conformance vectors. Feedback welcome via +> [Issues](https://github.com/microsoft/prompty/issues). Prompty is a **markdown file format** (`.prompty`) for LLM prompts. Write your prompt once — run it from VS Code or a language runtime that shares Prompty's generated model and conformance vectors. @@ -42,7 +45,7 @@ Say hello to {{name}}. **Python** ```bash -pip install "prompty[jinja2,openai]" +uv pip install "prompty[jinja2,openai]" ``` ```python import prompty @@ -177,10 +180,10 @@ while each runtime keeps its own idiomatic implementation. ### Python ```bash -pip install "prompty[all]" # everything -pip install "prompty[jinja2,openai]" # just OpenAI -pip install "prompty[jinja2,foundry]" # Microsoft Foundry -pip install "prompty[jinja2,anthropic]" # Anthropic +uv pip install "prompty[all]" # everything +uv pip install "prompty[jinja2,openai]" # just OpenAI +uv pip install "prompty[jinja2,foundry]" # Microsoft Foundry +uv pip install "prompty[jinja2,anthropic]" # Anthropic ``` ```python diff --git a/runtime/csharp/scripts/release.py b/runtime/csharp/scripts/release.py index 161cfc231..4efd18a72 100644 --- a/runtime/csharp/scripts/release.py +++ b/runtime/csharp/scripts/release.py @@ -2,9 +2,9 @@ """Version bump and tag script for the Prompty C# NuGet packages. Usage: - python scripts/release.py # patch: 2.0.0-alpha.8 → 2.0.0-alpha.9 - python scripts/release.py --bump minor # minor: 2.0.0-alpha.8 → 2.1.0-alpha.1 - python scripts/release.py --bump major # major: 2.0.0-alpha.8 → 3.0.0-alpha.1 + python scripts/release.py # patch: 2.0.0 → 2.0.1 + python scripts/release.py --bump minor # minor: 2.0.0 → 2.1.0 + python scripts/release.py --bump major # major: 2.0.0 → 3.0.0 python scripts/release.py --version 2.0.0 # explicit version (exits prerelease) python scripts/release.py --dry-run # show what would happen without doing it @@ -40,7 +40,7 @@ def get_current_version() -> str: def bump_version(current: str, bump: str) -> str: - # Semver prerelease: 2.0.0-alpha.8 + # Semver prerelease suffix handling. pre_match = re.match(r"^(\d+)\.(\d+)\.(\d+)-([a-z]+)\.(\d+)$", current) stable_match = re.match(r"^(\d+)\.(\d+)\.(\d+)$", current) diff --git a/runtime/python/prompty/README.md b/runtime/python/prompty/README.md index 985e8b017..8c0317943 100644 --- a/runtime/python/prompty/README.md +++ b/runtime/python/prompty/README.md @@ -12,16 +12,16 @@ executes these files. Every `.prompty` file becomes a typed ```bash # Core + Jinja2 renderer + OpenAI provider -pip install prompty[jinja2,openai] +uv pip install "prompty[jinja2,openai]" # Core + Microsoft Foundry provider -pip install prompty[jinja2,foundry] +uv pip install "prompty[jinja2,foundry]" # Core + Anthropic provider -pip install prompty[jinja2,anthropic] +uv pip install "prompty[jinja2,anthropic]" # Everything (all renderers, providers, OpenTelemetry) -pip install prompty[all] +uv pip install "prompty[all]" ``` ### Extras diff --git a/runtime/rust/scripts/release.py b/runtime/rust/scripts/release.py index b272d64c5..40009e427 100644 --- a/runtime/rust/scripts/release.py +++ b/runtime/rust/scripts/release.py @@ -2,9 +2,9 @@ """Version bump and tag script for the prompty Rust crates. Usage: - python scripts/release.py # patch: 2.0.0-alpha.8 → 2.0.0-alpha.9 - python scripts/release.py --bump minor # minor: 2.0.0-alpha.8 → 2.1.0-alpha.1 - python scripts/release.py --bump major # major: 2.0.0-alpha.8 → 3.0.0-alpha.1 + python scripts/release.py # patch: 2.0.1 → 2.0.2 + python scripts/release.py --bump minor # minor: 2.0.1 → 2.1.0 + python scripts/release.py --bump major # major: 2.0.1 → 3.0.0 python scripts/release.py --version 2.0.0 # explicit version (exits prerelease) python scripts/release.py --dry-run # show what would happen without doing it @@ -55,7 +55,7 @@ def get_current_version() -> str: def bump_version(current: str, bump: str) -> str: - # Semver prerelease: 2.0.0-alpha.8 + # Semver prerelease suffix handling. pre_match = re.match(r"^(\d+)\.(\d+)\.(\d+)-([a-z]+)\.(\d+)$", current) stable_match = re.match(r"^(\d+)\.(\d+)\.(\d+)$", current) diff --git a/runtime/typescript/scripts/release.mjs b/runtime/typescript/scripts/release.mjs index c880ae439..f2823630e 100644 --- a/runtime/typescript/scripts/release.mjs +++ b/runtime/typescript/scripts/release.mjs @@ -3,9 +3,9 @@ * Version bump and tag script for @prompty/* packages. * * Usage: - * npm run release # patch: 2.0.0-alpha.1 → 2.0.0-alpha.2 - * npm run release -- --bump minor # minor: 2.0.0-alpha.2 → 2.1.0-alpha.1 - * npm run release -- --bump major # major: 2.1.0-alpha.1 → 3.0.0-alpha.1 + * npm run release # patch: 2.0.0 → 2.0.1 + * npm run release -- --bump minor # minor: 2.0.0 → 2.1.0 + * npm run release -- --bump major # major: 2.0.0 → 3.0.0 * npm run release -- --version 2.0.0 # explicit version (exits prerelease) * npm run release -- --dry-run # show what would happen without doing it * diff --git a/web/docs-examples/rust/Cargo.toml b/web/docs-examples/rust/Cargo.toml index b9aac22a3..3afeb6824 100644 --- a/web/docs-examples/rust/Cargo.toml +++ b/web/docs-examples/rust/Cargo.toml @@ -5,8 +5,8 @@ edition = "2024" publish = false [dependencies] -prompty = { version = "2.0.0-alpha.8" } -prompty-openai = { version = "2.0.0-alpha.8" } +prompty = { version = "2.0.1" } +prompty-openai = { version = "2.0.1" } serde_json = "1" tokio = { version = "1", features = ["full"] } diff --git a/web/docs-examples/rust/examples/agent_tool_calling.rs b/web/docs-examples/rust/examples/agent_tool_calling.rs index 64fe27e03..2d63ed6eb 100644 --- a/web/docs-examples/rust/examples/agent_tool_calling.rs +++ b/web/docs-examples/rust/examples/agent_tool_calling.rs @@ -1,6 +1,5 @@ -use prompty::TurnOptions; +use prompty::{AgentEvent, TurnOptions}; use serde_json::json; -use std::sync::Arc; #[tokio::main] async fn main() -> Result<(), Box> { @@ -8,30 +7,31 @@ async fn main() -> Result<(), Box> { prompty_openai::register(); // Register tool handlers - prompty::register_tool_handler("get_weather", |args| { + prompty::register_tool("get_weather", |args: serde_json::Value| { Box::pin(async move { let city = args["city"].as_str().unwrap_or("unknown"); - Ok(json!(format!("72°F and sunny in {city}"))) + Ok(format!("72°F and sunny in {city}")) }) }); - prompty::register_tool_handler("get_time", |args| { + prompty::register_tool("get_time", |args: serde_json::Value| { Box::pin(async move { let timezone = args["timezone"].as_str().unwrap_or("UTC"); - Ok(json!(format!("2025-01-15T10:30:00 {timezone}"))) + Ok(format!("2025-01-15T10:30:00 {timezone}")) }) }); // Load agent and run with tool-calling loop let agent = prompty::load("weather_agent.prompty")?; - let options = TurnOptions { - max_iterations: Some(10), - events: Some(Arc::new(|event| { - println!("Agent event: {event:?}"); - })), - ..Default::default() - }; + let options = TurnOptions::builder() + .max_iterations(10) + .on_event(Box::new(|event| { + if let AgentEvent::Status(message) = event { + println!("Agent status: {message}"); + } + })) + .build(); let result = prompty::turn( &agent, diff --git a/web/docs-examples/rust/examples/streaming.rs b/web/docs-examples/rust/examples/streaming.rs index 0b1cce175..f146b94dd 100644 --- a/web/docs-examples/rust/examples/streaming.rs +++ b/web/docs-examples/rust/examples/streaming.rs @@ -1,4 +1,3 @@ -use prompty::StreamChunk; use serde_json::json; #[tokio::main] @@ -10,20 +9,9 @@ async fn main() -> Result<(), Box> { let agent = prompty::load("chat.prompty")?; let messages = prompty::prepare(&agent, Some(&json!({ "question": "Tell me a joke" }))).await?; - // Run returns a PromptyStream when stream: true is set + // When stream: true is set, run consumes the stream and returns accumulated text let result = prompty::run(&agent, &messages).await?; - // Process streaming chunks - let stream = prompty::from_structured_value::(&result)?; - prompty::consume_stream_chunks(stream, |chunk| match chunk { - StreamChunk::Text(text) => print!("{text}"), - StreamChunk::Thinking(thought) => print!("[thinking] {thought}"), - StreamChunk::Tool(tc) => println!("[tool call] {}: {}", tc.name, tc.arguments), - StreamChunk::Error(message) => eprintln!("[error] {message}"), - StreamChunk::Failure(failure) => eprintln!("[error] {}", failure.message()), - }) - .await; - - println!(); + println!("{result}"); Ok(()) } diff --git a/web/docs-examples/typescript/package-lock.json b/web/docs-examples/typescript/package-lock.json index 8626694ba..03a3214af 100644 --- a/web/docs-examples/typescript/package-lock.json +++ b/web/docs-examples/typescript/package-lock.json @@ -18,7 +18,7 @@ }, "../../../runtime/typescript/packages/core": { "name": "@prompty/core", - "version": "2.0.0-beta.5", + "version": "2.0.0", "license": "MIT", "dependencies": { "gray-matter": "^4.0.3", @@ -28,8 +28,8 @@ }, "devDependencies": { "@opentelemetry/api": "^1.9.0", - "@prompty/anthropic": "^2.0.0-beta.5", - "@prompty/openai": "^2.0.0-beta.5", + "@prompty/anthropic": "^2.0.0", + "@prompty/openai": "^2.0.0", "@types/mustache": "^4.2.5", "@types/node": "^20.11.0", "@types/nunjucks": "^3.2.6", @@ -52,14 +52,14 @@ }, "../../../runtime/typescript/packages/openai": { "name": "@prompty/openai", - "version": "2.0.0-beta.5", + "version": "2.0.0", "license": "MIT", "dependencies": { - "@prompty/core": "^2.0.0-beta.4", + "@prompty/core": "^2.0.0", "openai": "^4.80.0" }, "devDependencies": { - "@prompty/core": "^2.0.0-beta.5", + "@prompty/core": "^2.0.0", "@types/node": "^20.11.0", "dotenv": "^16.4.0", "tsup": "^8.4.0", @@ -70,7 +70,7 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@prompty/core": "^2.0.0-beta.4" + "@prompty/core": "^2.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { diff --git a/web/src/content/docs/core-concepts/streaming.mdx b/web/src/content/docs/core-concepts/streaming.mdx index a3b2072d7..780ae7963 100644 --- a/web/src/content/docs/core-concepts/streaming.mdx +++ b/web/src/content/docs/core-concepts/streaming.mdx @@ -209,22 +209,14 @@ user: ```rust - use prompty::{StreamChunk, PromptyStream, consume_stream_chunks}; - let agent = prompty::load("chat.prompty")?; let inputs = serde_json::json!({"question": "Tell me a joke"}); let messages = prompty::prepare(&agent, Some(&inputs)).await?; - let result = prompty::run(&agent, &messages).await?; - // Process streaming chunks - let stream = prompty::from_structured_value::(&result)?; - consume_stream_chunks(stream, |chunk| match chunk { - StreamChunk::Text(text) => print!("{text}"), - StreamChunk::Thinking(thought) => print!("[thinking] {thought}"), - StreamChunk::Tool(tc) => println!("[tool] {}: {}", tc.name, tc.arguments), - StreamChunk::Error(err) => eprintln!("[error] {err}"), - }).await; - println!(); + // Rust run() consumes a streaming provider response and returns + // the accumulated text result. + let result = prompty::run(&agent, &messages).await?; + println!("{result}"); ``` diff --git a/web/src/content/docs/core-concepts/tracing.mdx b/web/src/content/docs/core-concepts/tracing.mdx index be7caa81f..a21f93295 100644 --- a/web/src/content/docs/core-concepts/tracing.mdx +++ b/web/src/content/docs/core-concepts/tracing.mdx @@ -294,7 +294,7 @@ and more. ```bash - pip install prompty[otel] + uv pip install "prompty[otel]" ``` @@ -304,7 +304,7 @@ and more. ```bash - dotnet add package Prompty.Core --prerelease + dotnet add package Prompty.Core # OTel support is built into Prompty.Core ``` diff --git a/web/src/content/docs/getting-started/index.mdx b/web/src/content/docs/getting-started/index.mdx index 1850d4cfd..051b665b4 100644 --- a/web/src/content/docs/getting-started/index.mdx +++ b/web/src/content/docs/getting-started/index.mdx @@ -82,13 +82,9 @@ rendered instructions that are parsed into chat messages. ```bash - dotnet add package Prompty.Core --prerelease - dotnet add package Prompty.OpenAI --prerelease # or Prompty.Foundry, Prompty.Anthropic + dotnet add package Prompty.Core + dotnet add package Prompty.OpenAI # or Prompty.Foundry, Prompty.Anthropic ``` - - ```bash diff --git a/web/src/content/docs/how-to/anthropic.mdx b/web/src/content/docs/how-to/anthropic.mdx index 870a1438e..d49350edf 100644 --- a/web/src/content/docs/how-to/anthropic.mdx +++ b/web/src/content/docs/how-to/anthropic.mdx @@ -24,8 +24,8 @@ import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; ```bash - dotnet add package Prompty.Core --prerelease - dotnet add package Prompty.Anthropic --prerelease + dotnet add package Prompty.Core + dotnet add package Prompty.Anthropic ``` diff --git a/web/src/content/docs/how-to/foundry.mdx b/web/src/content/docs/how-to/foundry.mdx index e802bc911..f99533b3c 100644 --- a/web/src/content/docs/how-to/foundry.mdx +++ b/web/src/content/docs/how-to/foundry.mdx @@ -35,8 +35,8 @@ import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; ```bash - dotnet add package Prompty.Core --prerelease - dotnet add package Prompty.Foundry --prerelease + dotnet add package Prompty.Core + dotnet add package Prompty.Foundry ``` diff --git a/web/src/content/docs/how-to/openai.mdx b/web/src/content/docs/how-to/openai.mdx index 442856b50..542f1e557 100644 --- a/web/src/content/docs/how-to/openai.mdx +++ b/web/src/content/docs/how-to/openai.mdx @@ -24,8 +24,8 @@ import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; ```bash - dotnet add package Prompty.Core --prerelease - dotnet add package Prompty.OpenAI --prerelease + dotnet add package Prompty.Core + dotnet add package Prompty.OpenAI ``` diff --git a/web/src/content/docs/implementation/csharp.mdx b/web/src/content/docs/implementation/csharp.mdx index e46715f03..b0b72df28 100644 --- a/web/src/content/docs/implementation/csharp.mdx +++ b/web/src/content/docs/implementation/csharp.mdx @@ -20,16 +20,16 @@ implementations: **Renderer → Parser → Executor → Processor**. ## Installation -All packages are available on NuGet at version **2.0.0-alpha.6**. +All packages are available on NuGet at version **2.0.0**. ```bash # Core — required -dotnet add package Prompty.Core --prerelease +dotnet add package Prompty.Core # Pick one or more providers -dotnet add package Prompty.OpenAI --prerelease -dotnet add package Prompty.Foundry --prerelease -dotnet add package Prompty.Anthropic --prerelease +dotnet add package Prompty.OpenAI +dotnet add package Prompty.Foundry +dotnet add package Prompty.Anthropic ``` | Package | Description | diff --git a/web/src/content/docs/implementation/index.mdx b/web/src/content/docs/implementation/index.mdx index a31cd306d..552ed82c5 100644 --- a/web/src/content/docs/implementation/index.mdx +++ b/web/src/content/docs/implementation/index.mdx @@ -12,10 +12,10 @@ schema, and is validated by shared conformance vectors for observable behavior. | Language | Status | Package | |----------|--------|---------| -| [**Python**](/implementation/python/) | ✅ Stable (alpha) | `prompty` on PyPI | -| [**TypeScript**](/implementation/typescript/) | ✅ Stable (alpha) | `@prompty/core` on npm | -| [**C#**](/implementation/csharp/) | ✅ Alpha | `Prompty.Core`, `Prompty.OpenAI`, `Prompty.Foundry`, `Prompty.Anthropic` on NuGet | -| [**Rust**](/implementation/rust/) | ✅ Alpha | `prompty`, `prompty-openai`, `prompty-foundry`, `prompty-anthropic` on crates.io | +| [**Python**](/implementation/python/) | ✅ Stable | `prompty` on PyPI | +| [**TypeScript**](/implementation/typescript/) | ✅ Stable | `@prompty/core` on npm | +| [**C#**](/implementation/csharp/) | ✅ Stable | `Prompty.Core`, `Prompty.OpenAI`, `Prompty.Foundry`, `Prompty.Anthropic` on NuGet | +| [**Rust**](/implementation/rust/) | ✅ Stable | `prompty`, `prompty-openai`, `prompty-foundry`, `prompty-anthropic` on crates.io | | **Java** | ✅ Alpha | Java runtime packages | | **Go** | ✅ Alpha | Go module under `runtime/go/prompty` | | **Swift** | ✅ Alpha | `Prompty`, `PromptyOpenAI`, `PromptyFoundry`, `PromptyAnthropic` SwiftPM packages | @@ -38,7 +38,7 @@ rejection fail them. - Most mature runtime with all features implemented - Async support via `_async` variants of every function - Entry-point-based plugin discovery -- Install: `uv pip install prompty[all]` +- Install: `uv pip install "prompty[all]"` ### TypeScript @@ -49,10 +49,10 @@ rejection fail them. ### C# -- Alpha packages available on NuGet: `Prompty.Core`, `Prompty.OpenAI`, `Prompty.Foundry`, `Prompty.Anthropic` +- Stable packages available on NuGet: `Prompty.Core`, `Prompty.OpenAI`, `Prompty.Foundry`, `Prompty.Anthropic` - Static `Pipeline` API with async-first design - Same four-stage render → parse → execute → process architecture -- Install: `dotnet add package Prompty.Core --prerelease` +- Install: `dotnet add package Prompty.Core` ### Rust diff --git a/web/src/content/docs/implementation/typescript.mdx b/web/src/content/docs/implementation/typescript.mdx index fa651d19c..0b366942a 100644 --- a/web/src/content/docs/implementation/typescript.mdx +++ b/web/src/content/docs/implementation/typescript.mdx @@ -14,27 +14,28 @@ The TypeScript runtime is split into focused packages: | Package | Description | npm | |---------|-------------|-----| -| `@prompty/core` | Core runtime: loader, pipeline, types | [![npm](https://img.shields.io/npm/v/@prompty/core/alpha)](https://www.npmjs.com/package/@prompty/core) | -| `@prompty/openai` | OpenAI provider (chat, responses, embedding, image) | [![npm](https://img.shields.io/npm/v/@prompty/openai/alpha)](https://www.npmjs.com/package/@prompty/openai) | -| `@prompty/foundry` | Microsoft Foundry provider | [![npm](https://img.shields.io/npm/v/@prompty/foundry/alpha)](https://www.npmjs.com/package/@prompty/foundry) | -| `@prompty/anthropic` | Anthropic provider | [![npm](https://img.shields.io/npm/v/@prompty/anthropic/alpha)](https://www.npmjs.com/package/@prompty/anthropic) | - -