feat(ai): add generic metadata field to StreamOptions, closes #1384

Add metadata?: Record<string, unknown> to StreamOptions so providers
can extract fields they understand. Anthropic provider extracts user_id
for abuse tracking and rate limiting. Other providers ignore it.

Based on #1384 by @7Sageer, reworked to use a generic type instead of
Anthropic-specific typing on the base interface.
This commit is contained in:
Mario Zechner 2026-02-12 17:38:54 +01:00
parent 28c0991281
commit 1e88c5e463
4 changed files with 18 additions and 0 deletions

View file

@ -2,6 +2,10 @@
## [Unreleased]
### Added
- Added optional `metadata` field to `StreamOptions` for passing provider-specific metadata (e.g. Anthropic `user_id` for abuse tracking/rate limiting) ([#1384](https://github.com/badlogic/pi-mono/pull/1384) by [@7Sageer](https://github.com/7Sageer))
## [0.52.9] - 2026-02-08
### Changed