|
|
@ -50,6 +50,8 @@ export class SolCoder extends Plugin { |
|
|
|
async code_generation(prompt): Promise<any> { |
|
|
|
async code_generation(prompt): Promise<any> { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'code_generation']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
@ -78,6 +80,9 @@ export class SolCoder extends Plugin { |
|
|
|
async solidity_answer(prompt): Promise<any> { |
|
|
|
async solidity_answer(prompt): Promise<any> { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
|
|
|
|
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for SOL-GPT answer...` }) |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'answering']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
const main_prompt = this._build_solgpt_promt(prompt) |
|
|
|
const main_prompt = this._build_solgpt_promt(prompt) |
|
|
@ -112,6 +117,9 @@ export class SolCoder extends Plugin { |
|
|
|
async code_explaining(prompt, context:string=""): Promise<any> { |
|
|
|
async code_explaining(prompt, context:string=""): Promise<any> { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
|
|
|
|
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for SOL-GPT answer...` }) |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'explaining']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
@ -138,6 +146,8 @@ export class SolCoder extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async code_completion(prompt, options:SuggestOptions=null): Promise<any> { |
|
|
|
async code_completion(prompt, options:SuggestOptions=null): Promise<any> { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'code_completion']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
@ -184,6 +194,8 @@ export class SolCoder extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async code_insertion(msg_pfx, msg_sfx): Promise<any> { |
|
|
|
async code_insertion(msg_pfx, msg_sfx): Promise<any> { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'code_insertion']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|
result = await( |
|
|
|
result = await( |
|
|
@ -222,6 +234,7 @@ export class SolCoder extends Plugin { |
|
|
|
this.emit("aiInfering") |
|
|
|
this.emit("aiInfering") |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
this.call('layout', 'maximizeTerminal') |
|
|
|
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for SOL-GPT answer...` }) |
|
|
|
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for SOL-GPT answer...` }) |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ai', 'solcoder', 'explaining']) |
|
|
|
|
|
|
|
|
|
|
|
let result |
|
|
|
let result |
|
|
|
try { |
|
|
|
try { |
|
|
|