gpt4 book ai didi

react-native - Expo react-native Error : URL. search is not implemented when working with openai.createImage 一般API讨论

转载 作者:行者123 更新时间:2023-12-02 05:47:01 25 4
gpt4 key购买 nike

这是我的任务

async function generateImage() {
try {
const response = await openai.createImage({
prompt: 'a white siamese cat',
n: 1,
size: '1024x1024',
});
console.log(response);
} catch (error) {
console.error(error);
}
}

我在手机上使用时遇到这个错误:错误:URL.search 未实现

我真的被困在这个问题上,所以感谢任何帮助

最佳答案

我找到了你必须安装 npm install react-native-url-polyfill 的解决方案并在您的 App.js 中导入“react-native-url-polyfill/auto”

关于react-native - Expo react-native Error : URL. search is not implemented when working with openai.createImage 一般API讨论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74977575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com