|
|
@ -13,8 +13,10 @@ const profile = { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export class SolCoder extends Plugin { |
|
|
|
export class SolCoder extends Plugin { |
|
|
|
|
|
|
|
api_url: string |
|
|
|
constructor() { |
|
|
|
constructor() { |
|
|
|
super(profile) |
|
|
|
super(profile) |
|
|
|
|
|
|
|
this.api_url = "https://hkfll35zthu6e2-7861.proxy.runpod.net/api/" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async code_generation(prompt): Promise<any> { |
|
|
|
async code_generation(prompt): Promise<any> { |
|
|
@ -23,7 +25,7 @@ export class SolCoder extends Plugin { |
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
|
await fetch("https://hkfll35zthu6e2-7861.proxy.runpod.net/api/code_generation", { |
|
|
|
await fetch(this.api_url.concat("code_generation"), { |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
Accept: 'application/json', |
|
|
|
Accept: 'application/json', |
|
|
@ -45,7 +47,7 @@ export class SolCoder extends Plugin { |
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
|
await fetch("https://hkfll35zthu6e2-7861.proxy.runpod.net/api/solidity_answer", { |
|
|
|
await fetch(this.api_url.concat("solidity_answer"), { |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
Accept: 'application/json', |
|
|
|
Accept: 'application/json', |
|
|
@ -71,7 +73,7 @@ export class SolCoder extends Plugin { |
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
|
await fetch("https://hkfll35zthu6e2-7861.proxy.runpod.net/api/code_completion", { |
|
|
|
await fetch(this.api_url.concat("code_completion"), { |
|
|
|
method: 'POST', |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
Accept: 'application/json', |
|
|
|
Accept: 'application/json', |
|
|
|