gradio-app / gradio-app/fastrtc

Passing additional values through the offer/stream module

Open
#415 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.6k
Forks
433
PR merge metrics
No merged PRs in 30d

Description

So here is the use case, the stream module uses the "echo" function to handle stt and tts, and the offer (frontend endpoint) used to establish the connection.

is there a way to pass a unique value to the "echo" function (new parameter), so we can use it to fetch data from other sources (database) for memory context AI instead of general responses.

I've tried several methods, but none of them seem to work.

Example:

`def echo(audio, additional_inputs):`

`stream = Stream(
ReplyOnPause(echo),
modality="audio",
mode="send-receive",
additional_inputs=["maybe data will be passed here" (i tried but doesn't work"],
)`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the Stream and ReplyOnPause entry points referenced in the example, then trace how the offer establishes the connection and invokes echo. Define the intended path for a per-connection value and verify it with a focused example or test showing that echo receives the value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.