Commit 9d4e993
authored
feat(realtime): add
## Summary
Lets users of realtime models opt into 1080p output via a new
`resolution` option on `realtime.connect`. Defaults to `720p` (no
behavior change for existing callers).
## Usage
```ts
const realtimeClient = await client.realtime.connect(stream, {
model: models.realtime("lucy-2.1"),
resolution: "1080p", // default: "720p"
onRemoteStream,
});
```
## Test plan
- [x] `pnpm typecheck`
- [x] `pnpm test` (4 new unit tests covering URL construction + Zod
validation)
- [x] `pnpm format:check`
- [ ] Manual smoke against staging: verify `lucy-2.1` + `resolution:
"1080p"` delivers a 1884×1080 remote track
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: adds an optional, Zod-validated `resolution` parameter that
only affects realtime WebRTC URL query construction, with coverage to
prevent invalid values.
>
> **Overview**
> Adds a new optional `resolution` setting to `realtime.connect`
(validated as `"720p"` or `"1080p"`) and forwards it to the realtime
WebRTC endpoint via a `resolution=` query parameter when provided.
>
> Updates the SDK README with usage examples and adds unit tests
verifying URL construction (param omitted vs appended) and input
validation for invalid resolutions.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
56c8621. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->resolution option (#140)1 parent cc1029c commit 9d4e993
3 files changed
Lines changed: 81 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | | - | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1993 | 1993 | | |
1994 | 1994 | | |
1995 | 1995 | | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
1996 | 2062 | | |
1997 | 2063 | | |
1998 | 2064 | | |
| |||
0 commit comments