Skip to content

Fix type errors in Python docs snippets#260

Merged
PiotrWodecki merged 4 commits into
mainfrom
fix-python-types
Jun 3, 2026
Merged

Fix type errors in Python docs snippets#260
PiotrWodecki merged 4 commits into
mainfrom
fix-python-types

Conversation

@PiotrWodecki

@PiotrWodecki PiotrWodecki commented Jun 2, 2026

Copy link
Copy Markdown
Member

Description

Fixes FCE-3390

Fixes surfaced running typecheck pipeline against Python code snippets:

  • 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.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/tutorials/livestreaming.mdx Outdated
Comment thread docs/how-to/backend/whip-whep.mdx Outdated
Comment thread docs/how-to/backend/whip-whep.mdx Outdated
Comment thread docs/explanation/livestreams.mdx Outdated
Comment thread docs/explanation/livestreams.mdx Outdated
Comment thread docs/tutorials/agents.mdx
Comment thread docs/integrations/gemini-live-integration.mdx Outdated
Comment thread docs/integrations/vapi-integration.mdx
Comment thread docs/tutorials/agents.mdx
@PiotrWodecki PiotrWodecki marked this pull request as draft June 2, 2026 10:10
- 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).
@PiotrWodecki PiotrWodecki requested a review from Copilot June 3, 2026 10:05
@PiotrWodecki PiotrWodecki marked this pull request as ready for review June 3, 2026 10:05
@linear

linear Bot commented Jun 3, 2026

Copy link
Copy Markdown

FCE-3390

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread scripts/prepare.sh
Comment thread docs/tutorials/agents.mdx
Comment thread docs/tutorials/agents.mdx
@PiotrWodecki PiotrWodecki merged commit 229dcda into main Jun 3, 2026
2 checks passed
@PiotrWodecki PiotrWodecki deleted the fix-python-types branch June 3, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants