SDK Version: 48.0.4
Platforms: Android (it works on iOS)
“axios”: “^1.4.0”,
When I call the following hook, the app (ExpoGo and production) crash:
export default useAPI = async (prompto) => {
const APIKEY = await authStorage.getToken();
let risposta = await axios.post(“https://api.openai.com/v1/chat/completions”, {
“model”: “gpt-3.5-turbo”,
“messages”: prompto,
“temperature”: 0.5,
“max_tokens”: 500,
“top_p”: 0.3,
“frequency_penalty”: 0.5,
“presence_penalty”: 0.0
}, {
headers: {
“Content-Type”: “application/json”,
“Authorization”: Bearer ${APIKEY}
}
});
return risposta.data
};