From 1b01791ffb317b5ba79a55e86621a70d8528980e Mon Sep 17 00:00:00 2001 From: Anass Date: Mon, 15 Jun 2026 17:40:10 +0100 Subject: [PATCH] Release v0.2.0 --- CHANGELOG.md | 2 ++ pyproject.toml | 2 +- src/lago_agent_sdk/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 679920e..ceafed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented here. Format follows [Kee ## [Unreleased] +## [0.2.0] - 2026-06-15 + ### Added - **Price mode — emit computed dollar cost instead of token counts.** New `pricing_mode` config (`"tokens"` default | `"price"`), plus `markup`, `cost_metric_code` (default `llm_cost`), `pricing_ttl_seconds`, and `bedrock_default_region`. In price mode the SDK emits one `llm_cost` event per call carrying a top-level `precise_total_amount_cents` (cost in cents, after markup) for Lago's **dynamic charge model**, with a full per-field breakdown in `properties` (value in USD, base, markup, source, per-field tokens/unit_price/cost). Live unit prices come from public, no-auth sources: OpenRouter (`/api/v1/models`) for native anthropic/openai/mistral/gemini, and the AWS Bedrock Price List **Bulk** API for Bedrock. Prices are fetched + cached on the background queue thread (never blocking the customer's call); a missing price falls back to token events and calls `on_error` (never silently under-bills). Mode and markup are overridable per-call via `extra_lago={"mode": "price", "markup": 1.5}`. Money is computed with `Decimal` floored to 12 dp, identical to the JS implementation (cross-repo golden fixture). New `pricing.py` module + `PricingProvider`; default `pricing_mode="tokens"` keeps existing behavior unchanged. diff --git a/pyproject.toml b/pyproject.toml index 69fbafc..3daae9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "lago-agent-sdk" -version = "0.1.0" +version = "0.2.0" description = "Instrument LLM clients and emit usage events to Lago." readme = "README.md" requires-python = ">=3.10" diff --git a/src/lago_agent_sdk/__init__.py b/src/lago_agent_sdk/__init__.py index 42837be..de2a037 100644 --- a/src/lago_agent_sdk/__init__.py +++ b/src/lago_agent_sdk/__init__.py @@ -28,4 +28,4 @@ "ModelPrice", "compute_cost", ] -__version__ = "0.1.0" +__version__ = "0.2.0"