fixed identation lint

inlinecompletion_update
Stéphane Tetsing 1 year ago
parent 59ea0ac9aa
commit 1f4a10537b
  1. 88
      apps/remix-ide/src/app/plugins/solcoderAI.tsx

@ -25,15 +25,15 @@ export class SolCoder extends Plugin {
let result let result
try { try {
result = await( result = await(
await fetch(this.api_url.concat("code_generation"), { await fetch(this.api_url.concat("code_generation"), {
method: 'POST', method: 'POST',
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[prompt,false,1000,0.2,0.8,50]}), body: JSON.stringify({"data":[prompt,false,1000,0.2,0.8,50]}),
}) })
).json() ).json()
return result.data[0] return result.data[0]
} catch (e) { } catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` }) this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
@ -47,15 +47,15 @@ export class SolCoder extends Plugin {
let result let result
try { try {
result = await( result = await(
await fetch(this.api_url.concat("solidity_answer"), { await fetch(this.api_url.concat("solidity_answer"), {
method: 'POST', method: 'POST',
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data":[prompt,false,1000,0.9,0.8,50]}), body: JSON.stringify({"data":[prompt,false,1000,0.9,0.8,50]}),
}) })
).json() ).json()
} catch (e) { } catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` }) this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return return
@ -73,32 +73,32 @@ export class SolCoder extends Plugin {
let result let result
try { try {
result = await( result = await(
await fetch(this.api_url.concat("code_completion"), { await fetch(this.api_url.concat("code_completion"), {
method: 'POST', method: 'POST',
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({"data": !options? [ body: JSON.stringify({"data": !options? [
prompt, // string in 'context_code' Textbox component prompt, // string in 'context_code' Textbox component
"", // string in 'comment' Textbox component "", // string in 'comment' Textbox component
false, // boolean in 'stream_result' Checkbox component false, // boolean in 'stream_result' Checkbox component
200, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component 200, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component
0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component 0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component
0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component 0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component
50, // number (numeric value between 1 and 200) in 'top_k' Slider component 50, // number (numeric value between 1 and 200) in 'top_k' Slider component
] : [ ] : [
prompt, prompt,
"", "",
options.stream_result, options.stream_result,
options.max_new_tokens, options.max_new_tokens,
options.temperature, options.temperature,
options.top_p, options.top_p,
options.top_k options.top_k
] ]
}), }),
}) })
).json() ).json()
return result.data return result.data
} catch (e) { } catch (e) {

Loading…
Cancel
Save