pull/5241/head
STetsing 1 month ago
parent 0d0dbd195c
commit 5b69872e8e
  1. 3
      libs/remix-ai-core/src/agents/codeExplainAgent.ts
  2. 2
      libs/remix-ai-core/src/prompts/promptBuilder.ts
  3. 2
      libs/remix-ai-core/src/types/types.ts
  4. 2
      libs/remix-ui/remix-ai/src/lib/components/color.css

@ -8,7 +8,6 @@ export class CodeExplainAgent {
constructor(props) {
this.plugin = props
// git or fs
const codebase = this.loadCodebase("codebasePath");
}
@ -23,7 +22,7 @@ export class CodeExplainAgent {
async chatCommand(prompt:string){
// change this function with indexer or related
try{
try {
if (prompt.includes('Explain briefly the current file')){
const file = await this.plugin.call('fileManager', 'getCurrentFile')
const content = `Explain this code:\n ${await this.plugin.call('fileManager', 'readFile', file)}`

@ -24,8 +24,6 @@ export const buildSolgptPromt = (userPrompt:string, modelOP:RemoteBackendOPModel
// remove sol-gpt or gpt from the start of the prompt
const parsedPrompt = userPrompt.replace(/^sol-gpt|^gpt/gm, '')
// finally add the new prompt to the end of the history
newPrompt = "sol-gpt " + newPrompt + PromptBuilder(parsedPrompt, "", modelOP)
return newPrompt
}

@ -98,6 +98,7 @@ export class JsonStreamParser {
this.buffer += chunk;
const results = [];
// eslint-disable-next-line no-constant-condition
while (true) {
try {
const result = JSON.parse(this.buffer);
@ -105,6 +106,7 @@ export class JsonStreamParser {
this.buffer = '';
break;
} catch (error) {
// eslint-disable-next-line no-useless-escape
const match = /^([^\{]*\{[^\}]*\})(.*)/.exec(this.buffer);
if (match) {
try {

@ -73,7 +73,7 @@
--nlux-CodeBlock--Padding: 20px;
--nlux-CodeBlock--TextColor: var(--text);
--nlux-CodeBlock--FontSize: 14px;
--nlux-cvStrt--wd: 180px
--nlux-cvStrt--wd: var(--nlux-ConversationStarter--Width, 100px);
/* Conversation starter colors */
--nlux-ConversationStarter--BackgroundColor: var(--light);

Loading…
Cancel
Save