diff --git a/apps/remix-ide/src/app/plugins/solcoderAI.tsx b/apps/remix-ide/src/app/plugins/solcoderAI.tsx index 8eccbeebd6..f4da44af3f 100644 --- a/apps/remix-ide/src/app/plugins/solcoderAI.tsx +++ b/apps/remix-ide/src/app/plugins/solcoderAI.tsx @@ -32,7 +32,7 @@ export class SolCoder extends Plugin { async code_generation(prompt): Promise { this.emit("aiInfering") this.call('layout', 'maximizeTerminal') - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Code Generation: Waiting for Solcoder answer...'}) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Code Generation: Waiting for Solcoder answer...'}) let result try { result = await( @@ -47,7 +47,7 @@ export class SolCoder extends Plugin { ).json() console.log(result) if ("error" in result){ - this.call('terminal', 'log', { type: 'typewriterwarning', value: result.error }) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error }) return result } return result.data @@ -56,14 +56,13 @@ export class SolCoder extends Plugin { return }finally { this.emit("aiInferingDone") - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Code Generation: Done'}) } } async solidity_answer(prompt): Promise { this.emit("aiInfering") this.call('layout', 'maximizeTerminal') - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Waiting for Solcoder answer...'}) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Waiting for Solcoder answer...'}) let result try { result = await( @@ -81,12 +80,11 @@ export class SolCoder extends Plugin { return }finally { this.emit("aiInferingDone") - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Solcoder: Done'}) } if (result) { - this.call('terminal', 'log', { type: 'typewriterwarning', value: result.data[0]}) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]}) } else if (result.error) { - this.call('terminal', 'log', { type: 'typewriterwarning', value: "Error on request" }) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "Error on request" }) } } @@ -94,7 +92,7 @@ export class SolCoder extends Plugin { async code_explaining(prompt): Promise { this.emit("aiInfering") this.call('layout', 'maximizeTerminal') - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Explain Code: Waiting for Solcoder answer...'}) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Explain Code: Waiting for Solcoder answer...'}) let result try { result = await( @@ -108,7 +106,7 @@ export class SolCoder extends Plugin { }) ).json() if (result) { - this.call('terminal', 'log', { type: 'typewriterwarning', value: result.data[0]}) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]}) } return result.data[0] } catch (e) { @@ -116,7 +114,6 @@ export class SolCoder extends Plugin { return }finally { this.emit("aiInferingDone") - this.call('terminal', 'log', { type: 'typewriterwarning', value: 'Explaining: Done'}) } } @@ -154,13 +151,13 @@ export class SolCoder extends Plugin { ).json() if ("error" in result){ - this.call('terminal', 'log', { type: 'typewriterwarning', value: result.error }) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error }) return result } return result.data } catch (e) { - this.call('terminal', 'log', { type: 'typewriterwarning', value: `Unable to get a response ${e.message}` }) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `Unable to get a response ${e.message}` }) return } finally { this.emit("aiInferingDone") diff --git a/apps/remix-ide/src/app/tabs/locales/en/settings.json b/apps/remix-ide/src/app/tabs/locales/en/settings.json index 18806855e6..983ca0b36b 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/settings.json +++ b/apps/remix-ide/src/app/tabs/locales/en/settings.json @@ -41,6 +41,5 @@ "settings.copilot.activate": "Load & Activate copilot", "settings.copilot.max_new_tokens": "Maximum number of words to generate", "settings.copilot.temperature": "Temperature", - "settings.copilot.top_k": "top_k", - "settings.copilot.top_p": "top_p" + "settings.enableSaveEnvState": "Save environment state" } diff --git a/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts b/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts index 694af2a6b1..fd035f2ebb 100644 --- a/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts +++ b/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts @@ -52,7 +52,7 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli const ask = split[split.length - 2].trimStart() if (split[split.length - 1].trim() === '' && ask.startsWith('///')) { // use the code generation model, only take max 1000 word as context - this.props.plugin.call('terminal', 'log', {type: 'typewriterwarning', value: 'Solcoder - generating code for following comment: ' + ask.replace('///', '')}) + this.props.plugin.call('terminal', 'log', {type: 'aitypewriterwarning', value: 'Solcoder - generating code for following comment: ' + ask.replace('///', '')}) const data = await this.props.plugin.call('solcoder', 'code_generation', word) diff --git a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts index 760138fcd9..f81f9914ac 100644 --- a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts +++ b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts @@ -1,4 +1,4 @@ -import { CLEAR_CONSOLE, CMD_HISTORY, EMPTY_BLOCK, ERROR, HTML, INFO, KNOWN_TRANSACTION, LISTEN_ON_NETWORK, LOG, TYPEWRITERLOG, TYPEWRITERWARNING, TYPEWRITERSUCCESS, NEW_TRANSACTION, SCRIPT, UNKNOWN_TRANSACTION, WARN } from '../types/terminalTypes' +import { CLEAR_CONSOLE, CMD_HISTORY, EMPTY_BLOCK, ERROR, HTML, INFO, KNOWN_TRANSACTION, LISTEN_ON_NETWORK, LOG, TYPEWRITERLOG, TYPEWRITERWARNING, AITYPEWRITERWARNING, TYPEWRITERSUCCESS, NEW_TRANSACTION, SCRIPT, UNKNOWN_TRANSACTION, WARN } from '../types/terminalTypes' export const initialState = { journalBlocks: [ @@ -156,11 +156,16 @@ export const registerScriptRunnerReducer = (state, action) => { ...state, journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-log', provider: action.payload.provider }) } - case TYPEWRITERWARNING: + case AITYPEWRITERWARNING: return { ...state, journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-ai', provider: action.payload.provider }) } + case TYPEWRITERWARNING: + return { + ...state, + journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, typewriter: true, style: 'text-warning', provider: action.payload.provider }) + } case TYPEWRITERSUCCESS: return { ...state, diff --git a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts index 29d5af476a..cfea4013f7 100644 --- a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts +++ b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts @@ -17,6 +17,7 @@ export const HTML = 'html' export const LOG = 'log' export const TYPEWRITERLOG = 'typewriterlog' export const TYPEWRITERWARNING = 'typewriterwarning' +export const AITYPEWRITERWARNING = 'aitypewriterwarning' export const TYPEWRITERSUCCESS = 'typewritersuccess' export const INFO = 'info' export const WARN = 'warn'