ElevenLabs - how to send previous step to 11L through the provided code and then get the audio back to pipedream?

Hello everyone,
I’m struggling to figure out how to pass the previous step content to Eleven Labs Code.
What I want to do is to have an audio made from chatgpt text. So, I want to pass the chatgpt content to eleven labs and then return the audio back to Pipedream.
Anyone can help with this?
(I added both Javascript and Python code so you can work with the one that suits you best)

Thank you

Javascript :
import { axios } from “@pipedream/platform”
export default defineComponent({
props: {
elevenlabs: {
type: “app”,
app: “elevenlabs”,
}
},
async run({steps, $}) {
return await axios($, {
url: https://api.elevenlabs.io/v1/user,
headers: {
“Accept”: application/json,
“xi-api-key”: ${this.elevenlabs.$auth.api_key},
},
})
},
})

Python Version :
import requests

def handler(pd: “pipedream”):
headers = {“Accept”: ‘application/json’, “xi-api-key”: f’{pd.inputs[“elevenlabs”][“$auth”][“api_key”]}'}
r = requests.get(‘https://api.elevenlabs.io/v1/user’, headers=headers)

Export the data for use in future steps

return r.json()

Hi @joanacodes,

I think this need a sufficient coding knowledge to implement. If you’re still unsure that you can implement your usecase, you can:

  1. Read more about Pipedream Node.js document here and watch through Pipedream University series to understand how Pipedream works
  2. Read more about Javascript, especially Node.js part. Also you can watch through Pipedream speedrun series to have more references
  3. Submit a ticket for Pipedream, stating the action on the app that you need
  4. If you have subscribed to Pipedream team plan, you will be added to a dedicated slack support channel
  5. If you’d like to hire a Pipedream expert for your usecase, feel free to use this link: Connect with a Pipedream Partner