Add supportsUsageInStreaming compat flag for OpenAI-compatible providers

Renamed from supportsStreamOptions to clarify this controls stream_options: { include_usage: true }.
Defaults to true (no behavioral change for existing providers).
Providers like gatewayz.ai that reject this parameter can set supportsUsageInStreaming: false in model config.

Based on #596 by @XesGaDeus
This commit is contained in:
Mario Zechner 2026-01-10 00:34:06 +01:00
parent 732d46123b
commit 52ce113754
14 changed files with 8 additions and 9 deletions

View file

@ -2,8 +2,8 @@
## [Unreleased]
### Fixed
- Fixed 422 error with non-standard providers (gatewayz.ai, chutes.ai, etc.) by adding `supportsStreamOptions` compatibility flag and conditionally sending `stream_options` parameter.
### Added
- Added `supportsUsageInStreaming` compatibility flag for OpenAI-compatible providers that reject `stream_options: { include_usage: true }`. Defaults to `true`. Set to `false` in model config for providers like gatewayz.ai. ([#596](https://github.com/badlogic/pi-mono/pull/596) by [@XesGaDeus](https://github.com/XesGaDeus))
## [0.42.0] - 2026-01-09