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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user