ElevenLabs External API Call

Options

Hi, I'm calling ElevenLabs from my Xano API Endpoint - but I'm only getting decoded responses - and not mp3 files or links, how can I get this converted into a usable file for my API?

Thanks ;-)

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    edited August 2023
    Options

    This is the data from the actual audio file being returned to you!

    If you want to save it as a file in Xano, you can use the "content upload" functionality of "create file resource from data". Then make it into an "attachment" using the file resource you just created. Note that the file is only saved when you make the attachment.

    On the left, click on the spread of cards to open up your file library and you will see the file there!

    PS: Love the elevenlabs integration. Was just seeing people having challenges with this on Zapier because the latter has such short timeouts. The long timeouts of Xano give you a big advantage for making these advanced AI systems work for you!

  • verbical
    verbical Member
    Options

    Perfect thank you so much, if I want to send this response to another API provider for example, to add ai background music to it - how would I have to modify the data that is being put out? Since I’m planning to continue working with this file within one API endpoint.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    It depends on how the second vendor wants it. If they are expecting a binary upload, you have the binary. If they want a form/multipart upload, you need to convert the file to a file resource (content upload → make file resource from data) to upload it as a param in the external API request. If they want a link, you need to save it to Xano or external storage first.

    Very cool piece of work! Xano really shines at this kind of data pipeline. It's patient (unlike Zapier) and it has lots of support for complexity. We work on these kinds of harder projects at State Change in our deep dives and daily office hours.

  • verbical
    Options

    Ok perfect - I progress in building it.. Now I'm facing my last issue> How do i modify the input field in Xano, I know how Zapier works, but Xano seems more complicated. If a user enters for example "shoe" i want to reformat it for OpenAI to write a blog article about the following topic: shoe. - Is this possible in Xano?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    yes you have a plethora of text manipulation functions available. For simple prompt tokenization I would use the replace filter. Like “write a blog article about the following topic: TOPIC” and add a filter replace that loooks for TOPIC in all caps and replaces with your input.

  • verbical
    Options

    Thanks for all the help, It worked like a charm. I need to filter the API Response from Chatsonic to get a text only response that Text to Speech can use. But I only get a full JSON response including everything. I tried using subpaths but it always sends an error. I need to figure that out and I'm ready to launch my first Xano App! Yay! Any tips, assistance, and ideas are appreciated ;-)

  • verbical
    Options
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Api result api_1 has no member called result_1. Change that reference to api_1.response.result (Eg removd “result_1.”) as a starting point.

  • verbical
    Options

    Thanks - I'm one step closer, but I only need the pure text response of the API like you can get in Zapier, how do I only get that?

    If I use the dot-notation for the pure text "message" - I always get an error response.

    Thanks so much for all your help.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    So close! For it to return just the text, return api_1.response.result.message as self (by leaving the name of the output member blank".

    Looking forward to hearing of your success!

    BTW this kind of API work - and AI work! - is definitely at the hard end of no-code, and we work on this every day in our forums and daily recorded office hours over at State Change

  • verbical
    Options

    Thx it's working now!