This topic was automatically generated from Slack. You can find the original thread here.
Anyone here to help with Getting an error:
“this.fetch is not a function”
Code block here:
import { axios } from "@pipedream/platform";
import Replicate from "replicate";
export default defineComponent({
props: {
replicateApiToken: {
type: "string",
label: "Replicate API Token",
secret: true,
},
image: {
type: "string",
label: "Image",
},
},
async run({ $ }) {
const replicate = new Replicate({
auth: this.replicateApiToken,
});
const output = await replicate.run(
"yuval-alaluf/sam:9222a21c181b707209ef12b5e0d7e94c994b58f01c7b2fec075d2e892362f13c",
{
input: {
image: this.image,
},
}
);
return output;
},
});