sCuz12 / laravel-elevenlabs-client

6 stars 5 forks source link

generate and generate_stream methods on TextToSpeech class #4

Open passasooz opened 1 week ago

passasooz commented 1 week ago

hello, using your library I realised that after I generate a texttospeech it returns an array with a status and a message, but this is useless to me if I want to retrieve information such as the history_item_id or the generated stream file directly, and since you have this information in the $response anyway I suggest you expose it so that whoever wants to use it can use it. This way it will also be easier to use the other methods such as retrieving a history item. I have done this fix with an override of the TextToSpeech class, but it is bad practice to do it this way, if you can fix this it would make the library more convenient and much more useful to use

sCuz12 commented 1 week ago

Thank you for your feedback and for pointing this out. I understand how retrieving the history_item_id or the generated stream file directly would be useful, especially when working with the other methods like retrieving history items.

Youre totally right his information is already available in the $response, and it makes sense to expose it for easier access. I'll work on an update to include these fields in the response directly, which will make the library more flexible!