Merge pull request #4439 from pipecat-ai/mb/fix-deprecation-video-out-bitrate
This commit is contained in:
17
CLAUDE.md
17
CLAUDE.md
@@ -105,6 +105,7 @@ All data flows as **Frame** objects through a pipeline of **FrameProcessors**:
|
||||
## Code Style
|
||||
|
||||
- **Docstrings**: Google-style. Classes describe purpose; `__init__` has `Args:` section; dataclasses use `Parameters:` section.
|
||||
- **Deprecations**: Use the `.. deprecated:: <version>` Sphinx directive in docstrings (never inline tags like `[DEPRECATED]`), and pair it with a runtime `warnings.warn(..., DeprecationWarning)` at the call site. See `CONTRIBUTING.md` for full conventions.
|
||||
- **Linting**: Ruff (line length 100). Pre-commit hooks enforce formatting.
|
||||
- **Type hints**: Required for complex async code.
|
||||
- **Dataclass vs Pydantic**: Use `@dataclass` for frames and internal pipeline data (high-frequency, no validation needed). Use Pydantic `BaseModel` for configuration, parameters, metrics, and external API data (benefits from validation and serialization). Specifically:
|
||||
@@ -138,6 +139,22 @@ class MyService(LLMService):
|
||||
**kwargs: Additional arguments passed to parent.
|
||||
"""
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
# Pydantic params class with a deprecated field
|
||||
class MyParams(BaseModel):
|
||||
"""Configuration parameters for MyService.
|
||||
|
||||
Parameters:
|
||||
new_setting: Replacement for ``old_setting``.
|
||||
old_setting: Legacy setting, no longer used.
|
||||
|
||||
.. deprecated:: 1.2.0
|
||||
Use ``new_setting`` instead. Will be removed in 2.0.0.
|
||||
"""
|
||||
|
||||
new_setting: str = "default"
|
||||
old_setting: str | None = None
|
||||
```
|
||||
|
||||
## Service Implementation
|
||||
|
||||
@@ -47,7 +47,13 @@ class TransportParams(BaseModel):
|
||||
video_out_is_live: Enable real-time video output streaming.
|
||||
video_out_width: Video output width in pixels.
|
||||
video_out_height: Video output height in pixels.
|
||||
video_out_bitrate: [DEPRECATED] Video output bitrate in bits per second.
|
||||
video_out_bitrate: Video output bitrate in bits per second.
|
||||
|
||||
.. deprecated:: 1.1.0
|
||||
Use provider-specific settings instead (e.g.,
|
||||
``DailyParams.camera_out_send_settings``). This parameter will
|
||||
be removed in 2.0.0.
|
||||
|
||||
video_out_framerate: Video output frame rate in FPS.
|
||||
video_out_color_format: Video output color format string.
|
||||
video_out_codec: Preferred video codec for output (e.g., 'VP8', 'H264', 'H265').
|
||||
|
||||
Reference in New Issue
Block a user