Fixed welcome screen issue # 30 #32
@ -56,16 +56,14 @@ const ChipDetection = ({ updateChipCount }) => {
|
|||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(process.env.EXPO_PUBLIC_API_URL, {
|
||||||
"https://api.openai.com/v1/chat/completions",
|
|
||||||
{
|
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${process.env.EXPO_PUBLIC_API_KEY}`,
|
Authorization: `Bearer ${process.env.EXPO_PUBLIC_API_KEY}`, // Use environment variable for API key
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
model: process.env.EXPO_PUBLIC_MODEL_NAME,
|
model: process.env.EXPO_PUBLIC_MODEL_NAME, // Use environment variable for model name
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: "system",
|
role: "system",
|
||||||
@ -88,8 +86,7 @@ const ChipDetection = ({ updateChipCount }) => {
|
|||||||
],
|
],
|
||||||
max_tokens: 1000,
|
max_tokens: 1000,
|
||||||
}),
|
}),
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user