We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9684787 commit 9242a17Copy full SHA for 9242a17
js/utility/call-SCR-LLM.js
@@ -51,25 +51,10 @@ async function callSCRLLM(
51
})
52
}
53
)
54
-
55
- const SCRLLMRESPONSEJSON = await SCRLLMRESPONSE.json();
56
- return SCRLLMRESPONSEJSON?.data;
57
- /*
58
- return {url: `${SCREndpoint}/${model}/${model}`, body:{
59
- inputs: [
60
- {
61
- name: "systemPrompt",
62
- value: systemPrompt
63
- },
64
65
- name: "userPrompt",
66
- value: userPrompt
67
68
69
- name: "options",
70
- value: stringOptionsSCRLLM
71
- }
72
- ]
73
-}}
74
-*/
+ if(SCRLLMRESPONSE.status === 200) {
+ const SCRLLMRESPONSEJSON = await SCRLLMRESPONSE.json();
+ return SCRLLMRESPONSEJSON?.data;
+ } else {
+ return {error: `Request for ${model} failed with the HTTP code: ${SCRLLMRESPONSE.status}`}
+ }
75
0 commit comments