Fix type errors in Python docs snippets#260
Merged
Merged
Conversation
Fixes surfaced by the new typecheck:python pipeline: - create_room calls now pass RoomOptions instead of raw kwargs (livestreams, whip-whep, livestreaming). - FishjamNotifier uses fishjam_id / management_token kwargs instead of server_address / server_api_token. - AgentSession.add_track replaces non-existent create_track; matching send_chunk / interrupt calls are awaited. - Import fixes: IncomingTrackData (was AgentResponseTrackData), TrackEncoding from fishjam.events (was fishjam.agent), TRACK_ENCODING_PCM16 enum value (was PCM16), AgentOptions, ServerMessagePeerAdded, ServerMessageRoomCreated, pydantic.BaseModel, google.genai client wiring. - vapi_server_sdk replaces non-existent 'vapi' package. - Top-level async with / await wrapped in async def run() + asyncio.run(run()) so snippets are runnable as written.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates multiple Python documentation snippets to align with the current Fishjam Python SDK APIs and to eliminate type-check errors in examples across tutorials/integrations.
Changes:
- Update Python room creation snippets to pass
RoomOptions(...)instead of raw kwargs. - Fix Python agent examples to use current agent/session APIs (
AgentOptions,add_track, awaiting async calls) and correct imports/enums. - Adjust integration examples (Gemini Live, VAPI) and event listener snippets to use correct client wiring and message imports.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/tutorials/livestreaming.mdx | Updates Python livestream room creation to use RoomOptions. |
| docs/tutorials/backend-quick-start.mdx | Adds missing pydantic.BaseModel import for FastAPI request model. |
| docs/tutorials/agents.mdx | Updates agent examples to current SDK APIs and async patterns. |
| docs/integrations/vapi-integration.mdx | Fixes Python VAPI SDK import to use the correct package/module. |
| docs/integrations/gemini-live-integration.mdx | Updates Python example to use google.genai client + runnable async structure. |
| docs/how-to/backend/whip-whep.mdx | Updates Python WHIP/WHEP snippets to use RoomOptions. |
| docs/how-to/backend/server-setup.mdx | Adds missing server message import used in pattern matching. |
| docs/how-to/backend/fastapi-example.mdx | Fixes notifier constructor kwargs + imports for server message matching. |
| docs/explanation/livestreams.mdx | Updates Python livestream examples to use RoomOptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Drop stray ';' from FishjamClient constructor calls in livestreams, whip-whep, and livestreaming snippets so they're valid Python. - gemini-live integration: reuse the gen_ai client created in Step 1 instead of constructing a new genai.Client with a different env var. - vapi-integration install snippet: 'vapi' -> 'vapi_server_sdk' to match the actual PyPI package the import now uses. - agents.mdx disconnect snippet: add 'import asyncio' and 'asyncio.run(run())' so the example actually runs.
scripts/prepare.sh used 'git submodule update --init --remote' (non-recursive) to advance submodules to their tracked-branch tip. Upstream web-client-sdk recently converted react-native-webrtc from an npm dep into a nested submodule referenced as 'workspace:*'. Without --recursive, that nested submodule directory stays empty after the remote bump, and 'yarn install' inside mobile-client fails with 'Workspace not found'. Adding --recursive (and matching --recursive on 'git submodule sync') so nested submodules are initialized too.
scripts/prepare.sh was running 'git submodule update --init --remote', advancing every submodule to the tip of its tracked branch on every install. That made docs CI non-deterministic and surfaced upstream breakage in unrelated PRs: web-client-sdk main moved past v0.27.0 to a state where react-native-webrtc became a nested workspace submodule whose build chain (react-native-builder-bob 0.18 + recent babel) fails with "'production' is not a valid target". prepare.sh now just initializes submodules at the commits pinned in this repo. The deliberate 'pull latest SDK' workflow already lives in scripts/update.sh (yarn update-modules).
cb7d659 to
c686292
Compare
AHGIJMKLKKZNPJKQR
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes FCE-3390
Fixes surfaced running typecheck pipeline against Python code snippets: