Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK to support creating VAPI peers (“VAPI agents”) and refreshes generated OpenAPI/proto bindings to match newer Fishjam API surface (including track forwarding and livestream response wrappers).
Changes:
- Add
PeerType.VAPI,PeerOptionsVapi, and aFishjamClient.create_vapi_agent()helper, plus tests. - Regenerate/update OpenAPI client models/endpoints (new
*DetailsResponsewrappers, track forwarding models/endpoints, new room fields, etc.). - Simplify local test script wiring (
uv run pytest) and adjust dependency groups/scripts.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds google-genai to the test dependency group lock. |
| pyproject.toml | Renames test scripts and adds google-genai to test deps. |
| scripts.py | Simplifies run_tests() to run pytest directly via uv. |
| tests/test_room_api.py | Adds integration tests for creating/deleting a VAPI peer. |
| fishjam/api/_fishjam_client.py | Adds create_vapi_agent() API method. |
| fishjam/init.py | Exports PeerOptionsVapi at package level. |
| fishjam/_openapi_client/models/peer_type.py | Adds PeerType.VAPI. |
| fishjam/_openapi_client/models/peer_options_vapi.py | Introduces VAPI peer options model. |
| fishjam/_openapi_client/models/peer_config.py | Expands peer options union to include VAPI. |
| fishjam/_openapi_client/api/room/add_peer.py | Adds 402 error parsing. |
| fishjam/_openapi_client/api/room/create_room.py | Adds 402 error parsing. |
| fishjam/events/_protos/fishjam/init.py | Updates generated proto enums/messages (VAPI peer type, VAD + track forwarding notifications). |
| fishjam/_openapi_client/** (multiple) | Regenerates models/endpoints for viewers/streamers/streams and adds track forwarding & composition info support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def create_vapi_agent( | ||
| self, | ||
| room_id: str, | ||
| options: PeerOptionsVapi, | ||
| ) -> Peer: | ||
| """Creates a vapi agent in the room. | ||
|
|
||
| Args: | ||
| room_id: The ID of the room where the vapi agent will be created. | ||
| options: Configuration options for the vapi peer. | ||
|
|
||
| Returns: | ||
| - Peer: The created peer object. | ||
| """ | ||
| body = PeerConfig(type_=PeerType.VAPI, options=options) | ||
|
|
||
| resp = cast( | ||
| PeerDetailsResponse, | ||
| self._request(room_add_peer, room_id=room_id, body=body), | ||
| ) | ||
|
|
||
| return resp.data.peer |
There was a problem hiding this comment.
suggestion: maybe we should instead just have create_peer handle both webrtc and vapi peers?
The main reason create_agent exists is to simplify the create -> run flow for an agent, but for vapi this is unnecessary.
It would suffice to just discriminate PeerOptions on type or kind
There was a problem hiding this comment.
It's a matter of taste for sure, one thing against this approach, is that create_peer returns token, which is useless in the context of vapi.
There was a problem hiding this comment.
Valid, let's keep it like this for now then
Description
Describe your changes.
Motivation and Context
Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here.
Documentation impact
Types of changes
not work as expected)