Skip to content

Commit

Permalink
Corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
redji committed Apr 16, 2024
1 parent d6bc62a commit 7ba7795
Showing 1 changed file with 4 additions and 53 deletions.
57 changes: 4 additions & 53 deletions prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,8 @@ fetch('https://tasks.aidevs.pl/token/meme', {

})
.catch(error => console.error('Error:', error));
})
.catch(error => console.error('Error:', error));
fetch('https://tasks.aidevs.pl/token/optimaldb', {
method: 'POST',
headers: {
Expand All @@ -987,10 +989,7 @@ fetch('https://tasks.aidevs.pl/token/optimaldb', {
const jsonData = await fetchJSONData(jsonDataUrl);
let a = 0;
for (let key in jsonData) {
// Check if the key is a property of the object itself
if (jsonData.hasOwnProperty(key)) {
// Call the action function with the key and its corresponding value
console.log(key)
await chatCompletion({
messages: [{ role: 'user', content: 'Reformat given text to contain all information and not exceed 3kb. Text: ' + jsonData[key].join('') }],
model: 'gpt-3.5-turbo',
Expand All @@ -1010,55 +1009,7 @@ fetch('https://tasks.aidevs.pl/token/optimaldb', {
});
}
}
// for (let i = 0; i<jsonData.length; i++) {
// let entry = jsonData[i];
// }
} catch (error) {
console.error('An error occurred:', error);
}
// fetch('https://get.renderform.io/api/v2/render', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// 'X-API-KEY': 'key-XZc3QNWlmEqDUremH04CUjntXDE75bCED6'
// },
// body: JSON.stringify({
// template: 'silly-hares-race-loosely-1467',
// data: {
// 'title.text': '#FFFFFF',
// 'title.text': response2.text,
// 'image.src': response2.image
// },
// "fileName": "automation-meme",
// "version": "my-cache-key",
// "metadata": {
// "my-text.text": "Automation"
// },
// "batchName": "my-batch-name"
// })
// }).then(async (response) => {
// const data = await response.json();
// memeAnwser = data.href;
// const response4 = await makeRequestWithDelay(`https://tasks.aidevs.pl/answer/${token}`, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify({answer: memeAnwser})
// }, 10);
// console.log(response4);

})
.catch(error => console.error('Error:', error));


// // const response4 = await makeRequestWithDelay(`https://tasks.aidevs.pl/answer/${token}`, {
// // method: 'POST',
// // headers: {
// // 'Content-Type': 'application/json'
// // },
// // body: JSON.stringify({answer: 'https://frog01-21730.wykr.es/chat'})
// // }, 10);
// // console.log('Answer from API', response4);
// })
// .catch(error => console.error('Error:', error));
}})
.catch(error => console.error('Error:', error));

0 comments on commit 7ba7795

Please sign in to comment.