appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.64k stars 3.74k forks source link

[Bug]: Getting corrupted file data in response while using ElevenLabs APIs for generating audio files from Text. #33948

Open satpalslabs opened 5 months ago

satpalslabs commented 5 months ago

Is there an existing issue for this?

Description

We are trying to create an admin using Appsmith that generates audio files from text using Elevenlabs APIs. The API is returning a response in a corrupted format neither is it a base64 or a binary data.

Expected Response: Response with 200 statusCode and Generated audio file in base64 or binary format.

API Response: Getting Response with 200 statusCode and corrupted file data.

The same API request is working fine on POSTMAN it returns a file and also on Retool the API is returning base64 file data in API response which we are further converting into an audio file.

Steps To Reproduce

API: POST URL: https://api.elevenlabs.io/v1/text-to-speech/D38z5RcWu1voky8WS1ja Body:

{
    "model_id": "eleven_multilingual_v2",
    "text": "This is a Audio file generated using eleven labs APIs"
}

Header:

{
    "xi-api-key": ••••••,
    "Content-Type": "application/json"
}

Response:

����������z*Dz�ه�b���}��-7j舛����9�qg�'�K�)��3������o\�
�+�κ')�C��s�OB���tO����nazW��}
®���9���]�8<�����c<!�/��b��!2)<Ba�̖�0���ŊN0���&U1Ƅ�
,�q��م�]|\�L$�Il�?J6�D����NRH7g��vmf�
8��1†�N]jV��#��F�n?4d��FK!Y�Mdq7[�&��ʢ�}�A|rSa��:^�bi���8F'[^�\��4�n��I�ۖ�ۈ
 e>@b�|"X
�� �0`���T��    �qz�F��V�:.>@
BD��
�� 8�j\��H�
I��r��
#8�V��g�`謝�R���JǡJY�6�f)[�o����:����a D�7 ��2�gTA�}���M��E$۹�g�k����K�+(d�!��P��6
qn�4?�Wn�55���ⳝ���r}�S
�9�E�CJ�� ���"�ML ��j&v�!]���`t�y�A�J�^��������"05c(McFa��P�"��h�I�%m>��=�5[��o��G�b���t�H�ř}$�������NҘb{�D��0ɗ�)�k��
q��.��U`�mY��81�=��"}��F�M$%$ȀqɁq\�T*�����D
�hx� ��T��]8���X~����8��܍�T��P��o�ц�.\>��h���t�/$��XWp��Cs&+���8��@TO0�(,+!~�aT0c������s+�0�����q�������d`c`i�D�I��rϺP�ޒ���@o;Ob��0��)c}�Npx��.����z�g#U<X8tʹO�Y��cJ�ґL��(�;>a<8b,��E����kZ_}vk����S��l}���l���Q�\� ���J�?�@�H�_B��eP9A��9�M8�&+-F����f&cR4:t�|�NO<F�0�@��D���*ʜC
C�|����[� ��}/t��~(��Ќ]�񔌓V��|���0�3�w�N�쁥{Zq�(�A� H$����'i�Y_5l\��Ai�唪�r�����+3^�k���D%kӣ����4���8�*���LY�~�z�!p��$�ε�]��F��&`e��1J|���r)�
�ɢ�rC��Ǧ�����M_W�,S��������AI4������)��A��2��o�v"�v|�Zj��qɡ�@�=�u�U�!�P�P�o��5ь��kI��Sv*�d�0��n�;I�aě�E���!����9��8ƀ�r��4(X�F�r��3�&h���j��)��I1�L�N.���ɡ|W*��`�.�<l�yæXw�w��Z��z��]�˓aʍ. ��������p�1��q":�L��J�XQ���L{��q���7CjUty!q��C�S�5�N�r�p��������D!�e��k�K��I�t�tU�^p�6mE�������
��D)��ɽ��ى�i��(и�@8X�
�i� +l�IJ���\p1j�F:�J2.-��,�ˇ�ȣ�Ek�Rp�H�$p!��SC�����.��1�ᑂ�3�i���H]I���8+  ��7�t�5ǁ�gPқ4�0�_��SC�R�:�3�1�N������N�0ј��Œ@䔨C^iS�{Գ�T��"5%�HL)Dit}"��j���p��qB���t��4Z���X�b��t_�W��vV�阹cx���^�o����Ȅ���
��\�z��M@�L
����r���")�h4�o�x3G�ӊK^'"���?�a��Nw]|-Մ��U �4An���U�ǖ���c�"O���c
��
!�8�� ���Ð���.��ÍDD�_  [��ޱ�]y�t��EV�E�|L��x
(A�C������.`��"O����mL�h��� �
��J1�DqJ���q�f����sX�:3iG���-������&����Z5����#�q�I�=���ii�����,"��&�����$��J��$���������3���C�n�‹*�h���>d��3�ݢ����ϫ��f��rk��"��(ݿ9��W��]z��9ql�#;'� H—�e�_�]�9X?������g��P/a���J����$����`�Q�����
�HX�i�0�`��:!]0S
.`�k�[zbs1HS�޿n@�1   $��*<���nJ!�"#���Fh���X�Q�X�dw�DŽ1DC�K]Mt���l �'��Dr��v���q/�`�>zo����R����<�$�$~���(y���C
���{�۵�КVӐ��5������rF����9��+�������"Cb�ca2�#WUT3/�� ���������Em�1��4i����0�"^�,�%���r��-�:Q3�8��hX
���iN�f�Y����Z�L+W�ՎA+�Ha/b���S�+�զ��3�3d&�":n9���������/=��;;�kdŒh�\xEM�N<����>l�y![�$��Y��U��_�^��[����O��P,)t� �i���2۫�bB�Fx���#� \#w_�
i����W^��G�x�2j��T
$(=���t�J����HB�qؔj��J.ʟ&&�\������'R��Vn���(@�x��R�ND���=���s�Sڣ��}'b���ˇ�؁��A[z�6r � ��g�C��錚e�Q���8y>��'OA
������,(‡_0N:�@�"�6�LiN��bh���
p����*�S�IE)�fGRj�����-�O��>�|3m���ss�\��Z��HVB@H�)�,*i��lL��l��ݹ���v
���س��55X�{��(��[���;ǿ����~�w��[Ư�h�4�2��D�� D�
���}�r��=��^���hW'�|�K09x��;�
Ұl�HD��J�jb�HGEkS�q�Y��>��"G�������G�2T��薟cᦌM�x�8l�@�|(>�&�EQ��I9B��D�SG�;��9>g  �We��ٿY����.����o���
�8�}b
hpXe�I��_1Y��|�1�k1ѶWY��   �{�A!������e!X�(�J/L��)Hp8��q��mA�����~S◰&�n7܀��kB ����"́@!��� `��BaQ�9[cN��W�N����0��
�Km�K2i��%���/�P�9e�V�w_y�)Tr�V'� ",�cTS�ޗ���W������s�t`��s�X>�1�<�\��C��٣�~͙Zٶ��?�M_H�s0
�
��R(��  �9�    �?��?����[�hn!�-�H�7��9���h�7O)i�Ɩ��t���O&�P%�P6�Xr�S��t��t\��?�I�d8"@`V�l+
�x!̦f��b��A�:k&�s�qu�,���M����s������?H�t&�Bɣ[�����*�Y�&ֹ6���yC1�~0���a���6_�ꃑ�����1�y_��z1yy@k���J  :Q���fw���TS����p�y�!8ˊ"�h5�gE�W�¯u���ݎ[��B ����r��SF�Z�F�59K-����7�1�Ml��Bl.j��������̗�U��{�W��������LB@˛`5Q�z��s3�T/?�YZ���/�U���w��jbk>� 
ZKdZčFy�f��t�\�R���h��m

------

----- corrupted file data --------

Steps to replicate in the Public Sample App added below:

  1. Open the Appsmith admin app.
  2. Add text to generate audio.
  3. Click on the “Create” button.
  4. Check the response in the API Request & Response Container

Public Sample App

https://app.appsmith.com/app/generateaudiofiles/page1-661e18db4f5bde36a200395d

Environment

Production

Severity

High (Blocker to building or releasing)

Issue video log

No response

Version

Cloud

LagunaElectric commented 5 months ago

@satpalslabs Can you show what the response looks like from Postman in comparison? Have you tried treating the response as binary and converting it to base64?

santonivich commented 5 months ago

I can confirm this is happening for me as well. I am attempting something similar with the DUBBING API endpoint. Both in the Postman and the ElevanLabs playground the api results work as expected but not in Appsmith.

I have not converted anything to base64 I was hoping to play the file...generated from the API.....which I believe is a byte stream binary mp3?

I'm wonder if Appsmith is seeing the whole result is or is it missing some of the data causing a corruption? I was going to try to store the results in a DB and then see if I can play it from there.

It would be great if we someone would take a look at it. Thank so much.

satpalslabs commented 5 months ago

@LagunaElectric Postman is directly giving the audio file as below, and we do not need to encode or decode the response.

Screenshot from 2024-06-13 10-16-02

santonivich commented 5 months ago

Has anyone found a solution yet? Is it related to the size of the generated file? What would be a good work around? What if you stored the generated results in mondodb then used Appsmith audio widget?