@ericarias said in Getting consistent results with element seletors:
What is the best method to use to make sure that the elements are always found.
Just avoid using automatically generated selectors by BAS.
Hi, I've been working on this for 2 days, I can connect to OpenAI but I can't get the final response in [[RISPOSTA_FINALE]]. Can you please help me?
// Invio della richiesta
var response = httpRequest("POST", "https://api.openai.com/v1/chat/completions", request, JSON.stringify(body));
// Verifica la risposta
if (response.status == 200) {
var jsonResponse = JSON.parse(response.text);
// Estrai il contenuto della risposta
var responseResult = jsonResponse.choices[0].message.content;
// Salva il risultato nella variabile di output
SetVariable("RISPOSTA_FINALE", responseResult);
// Logga la risposta per debug
log(responseResult);
} else {
// Gestione degli errori
log(Errore: ${response.status} - ${response.text});
}