Spaces:
Sleeping
Sleeping
Change endpoint
Browse files- static/script.js +4 -4
static/script.js
CHANGED
|
@@ -451,7 +451,7 @@ async function categorizeRequirements(max_categories) {
|
|
| 451 |
toggleElementsEnabled(['categorize-requirements-btn'], false);
|
| 452 |
|
| 453 |
try {
|
| 454 |
-
const response = await fetch('https://
|
| 455 |
method: 'POST',
|
| 456 |
headers: { 'Content-Type': 'application/json' },
|
| 457 |
body: JSON.stringify({ requirements: formattedRequirements, "max_n_categories": max_categories })
|
|
@@ -814,19 +814,19 @@ function initializeSolutionAccordion(solutionCriticizedHistory, containerId, sta
|
|
| 814 |
}
|
| 815 |
|
| 816 |
async function generateSolutions(){
|
| 817 |
-
let response = await fetch('https://
|
| 818 |
let responseObj = await response.json()
|
| 819 |
return responseObj;
|
| 820 |
}
|
| 821 |
|
| 822 |
async function generateCriticisms(solutions){
|
| 823 |
-
let response = await fetch('https://
|
| 824 |
let responseObj = await response.json()
|
| 825 |
solutionsCriticizedVersions.push(responseObj)
|
| 826 |
}
|
| 827 |
|
| 828 |
async function refineSolutions(critiques){
|
| 829 |
-
let response = await fetch('https://
|
| 830 |
let responseObj = await response.json()
|
| 831 |
await generateCriticisms(responseObj)
|
| 832 |
}
|
|
|
|
| 451 |
toggleElementsEnabled(['categorize-requirements-btn'], false);
|
| 452 |
|
| 453 |
try {
|
| 454 |
+
const response = await fetch('https://organizedprogrammers-reqxtract-api.hf.space/reqs/categorize_requirements', {
|
| 455 |
method: 'POST',
|
| 456 |
headers: { 'Content-Type': 'application/json' },
|
| 457 |
body: JSON.stringify({ requirements: formattedRequirements, "max_n_categories": max_categories })
|
|
|
|
| 814 |
}
|
| 815 |
|
| 816 |
async function generateSolutions(){
|
| 817 |
+
let response = await fetch('https://organizedprogrammers-reqxtract-api.hf.space/solution/search_solutions_gemini', {method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify(categorizedRequirements)})
|
| 818 |
let responseObj = await response.json()
|
| 819 |
return responseObj;
|
| 820 |
}
|
| 821 |
|
| 822 |
async function generateCriticisms(solutions){
|
| 823 |
+
let response = await fetch('https://organizedprogrammers-reqxtract-api.hf.space/solution/criticize_solution', {method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify(solutions)})
|
| 824 |
let responseObj = await response.json()
|
| 825 |
solutionsCriticizedVersions.push(responseObj)
|
| 826 |
}
|
| 827 |
|
| 828 |
async function refineSolutions(critiques){
|
| 829 |
+
let response = await fetch('https://organizedprogrammers-reqxtract-api.hf.space/solution/refine_solution', {method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify(critiques)})
|
| 830 |
let responseObj = await response.json()
|
| 831 |
await generateCriticisms(responseObj)
|
| 832 |
}
|