Repository navigation
fix: route realtime, inference and errors through the gateway; wave-sdk 2.3.0 #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cb9e508
cda5a7a
e3a3b4c
bf9f4aa
ba6d8cb
42e4e97
5d8b6a8
c89e09f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,48 @@ | ||
| # Migrating to `wave-sdk` 2.3.0 | ||
|
|
||
| 2.3.0 moves methods onto the paths the WAVE API publishes. The old method names in the table | ||
| below keep working and emit a `DeprecationWarning`; switch when convenient. The changes listed | ||
| after the table can require edits to existing code. | ||
|
|
||
| | Before (2.2.0) | 2.3.0 | | ||
| | ----------------------------------------------- | --------------------------------------------------------- | | ||
| | `clips.detect_highlights(source_type, source_id)` | `clips.detect(video_id)` (`POST /v1/clips/detect`) | | ||
| | `voice.synthesize(text, voice_id)` | `voice.generate(text, voice_id)` (`POST /v1/voice/generate`) | | ||
| | `captions.get_text(caption_id)` | `captions.download(job_id, language, format="txt")` (`format` defaults to `None`, which lets the API choose; pass `"txt"` for plain text) | | ||
| | `chapters.get_default_set(asset_id)` | `chapters.list_chapters(video_id)` | | ||
| | `chapters.add_chapter(set_id, ...)` | `chapters.create_chapter(video_id, ...)` | | ||
| | `editor.render(project_id)` | `editor.export(project_id)` | | ||
| | `collab.close_room(room_id)` | `collab.delete_room(room_id)` | | ||
| | `inference.profile(model_id)` | `inference.models()` | | ||
| | `InferenceAPI(client, funnel_url=...)` | `InferenceAPI(client)`: `funnel_url` is now ignored; completions go through `api.wave.online` | | ||
|
|
||
| Changes that can require edits: | ||
|
|
||
| - `podcast.create(title, description, category)` is now `podcast.create(name, description=None, | ||
| category=None, ...)`, and `podcast.create_episode()` requires `audio_url=`. Positional calls | ||
| keep working; rename a `title=` keyword to `name=` and `podcast_id=` to `show_id=`. The old | ||
| `/v1/podcasts` paths were never routed, so no call that worked before changes behavior. The | ||
| podcast methods with no published operation (`get`, `update`, `remove`, `get_episode`, | ||
| `publish_episode`, `get_rss_feed`, `get_analytics`, `distribute`) now warn. | ||
| - An id that is `.` or `..`, or any request path with such a segment, raises `ValueError` | ||
| before anything is sent. | ||
| - `meter.ledger()` returns one window: read `ledger.channels` instead of `ledger.rows[0].channels`. | ||
| A channel counter the response leaves out is `None` (it used to fail validation), so check | ||
| for `None` before doing arithmetic on it. | ||
| - `realtime.connect()` raises `ValueError` for a `ws://` origin other than localhost (a | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High severity issue identified in your code: To resolve this comment: 🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods. 💬 Ignore this findingReply with Semgrep commands to ignore this finding.
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by detect-insecure-websocket. You can view more details about this finding in the Semgrep AppSec Platform.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /fp This is Markdown migration prose telling users that |
||
| `base_url` of `http://...`): the key would travel unencrypted. Use `https://` / `wss://`. | ||
| - A 402 now raises `PaymentRequiredError`, and a 404 for a route nothing serves (or a 405) raises | ||
| `RouteNotServedError`. Errors whose body the old parser could not read, which surfaced as | ||
| `code="HTTP_402"` or `"HTTP_405"`, now carry the server's code and message. Both classes | ||
| subclass `WaveError`, so existing `except WaveError` blocks still catch them. | ||
| - Retries follow the server. An error whose `next_action` says a retry cannot help (including a | ||
| 429 or 5xx) is raised on the first attempt, and a 429 or `retry_after` directive asking for | ||
| more than 60 seconds is raised at once with the full wait on the error | ||
| (`RateLimitError.retry_after`) instead of being slept through. The billed or broadcast methods | ||
| new in 2.3.0 (listed in the CHANGELOG) are never retried automatically. | ||
|
|
||
| --- | ||
|
|
||
| # Migrating to `wave-sdk` 2.1.0 | ||
|
|
||
| Two things changed between the published `2.0.0` releases and `2.1.0`: the | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High severity issue identified in your code:
Insecure WebSocket Detected. WebSocket Secure (wss) should be used for all WebSocket connections.
To resolve this comment:
🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsAlternatively, triage in Semgrep AppSec Platform to ignore the finding created by detect-insecure-websocket.
You can view more details about this finding in the Semgrep AppSec Platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/fp This is Markdown changelog prose recording that
connect()refusesws://origins other than localhost. It is not code.