Skip to content
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

Stitching not available #64

Open
tval2 opened this issue Jul 12, 2024 · 8 comments
Open

Stitching not available #64

tval2 opened this issue Jul 12, 2024 · 8 comments

Comments

@tval2
Copy link

tval2 commented Jul 12, 2024

I am trying to keep my app low latency and hence am using the streaming api via this node library. I also want to maintain decent flow between my chunks that I am sending in (I am splitting on new sentences) and hence need to stitch them together using the request_ids of previous streams.

However, upon looking into this further it seems that client.generate has no way of also returning the request_id as an optional output and therefore I can't even use this feature at all. I was told in the discord to try the HTTP API but the output format of the HTTP API differs from the SDK, so I need to make other changes in my codebase simply because swapped out how I'm calling the API.

I tried looking in the source code here to see if I could mimic the output of the SDK but it doesn't seem to work. So figured I'd post here asking for a PR where you output the request_id if asked as well.

@dsinghvi
Copy link
Collaborator

@tval2 have you considered using textToSpeech.convert ?

@tval2
Copy link
Author

tval2 commented Jul 13, 2024

@tval2 have you considered using textToSpeech.convert ?

Maybe i'm missing something but my understanding was that convert only returns the response body, no? At least that's what it shows in the repo.

@tval2
Copy link
Author

tval2 commented Jul 13, 2024

@dsinghvi perhaps more broadly: is there any clean way to use the SDK and pass the previous_request_ids parameter at the same time? The generate call allows for it so I still feel like I'm missing something

@tval2
Copy link
Author

tval2 commented Jul 15, 2024

Also on this topic, a contradictory guideline from the API reference:

  • In the API docs it says In case both previous_text and previous_request_ids is send, previous_text will be ignored.

  • In this tutorial it says best possible results are achieved when conditioning both on text and past generations so lets combine the two by providing previous_text, next_text and previous_request_ids in one request

Which one should we follow? Should I send previous_text or no?

@dsinghvi
Copy link
Collaborator

@tval2 you should be able to use textToSpeech.convertAsStream for the streaming api. Additionally that method supports both parameters that you mention such as previous_request_ids

@ofekrom
Copy link

ofekrom commented Aug 7, 2024

I am also encountering the same issue reported in the original message

@ceifa
Copy link

ceifa commented Aug 21, 2024

@tval2 you should be able to use textToSpeech.convertAsStream for the streaming api. Additionally that method supports both parameters that you mention such as previous_request_ids

It's not possible to get the request id from textToSpeech.convertAsStream

@shreecodes
Copy link

shreecodes commented Sep 27, 2024

@tval2 have you considered using textToSpeech.convert ?

@dsinghvi Neither textToSpeech.convert nor textToSpeech.convertAsStream, nor generate return the request_id, which is required to pass into subsequent requests.

Also on this topic, a contradictory guideline from the API reference:
...
Which one should we follow? Should I send previous_text or no?

@tval2 I noticed the same thing 😅

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

No branches or pull requests

5 participants