-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate agent #5870
base: master
Are you sure you want to change the base?
Generate agent #5870
Conversation
✅ Deploy Preview for remixproject ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
async compilecontracts(fileName, fileContent): Promise<CompilationResult> { | ||
|
||
const contract = {} | ||
contract[fileName] = { content : fileContent } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to put all the files in there:
contract[fileName1] = { content : fileContent1 }
contract[fileName2] = { content : fileContent2 }
etc...
so you should not loop over the files and compile them one by one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already tried this, the issue might me the import name not including the folder
console.log('Generation attempts', this.generationAttempts) | ||
if (this.nAttempts > this.generationAttempts) { | ||
console.error('Failed to generate the code') | ||
return "Failed to generate secure code on this prompt ```" + userPrompt + "````" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should throw an error instead of returning a string.
return "Failed to generate secure code on this prompt ```" + userPrompt + "````" | ||
} | ||
|
||
for (const file of parsedFiles.files) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't handle yet solidity import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I handle imports by adding all files for compilation see line 33, which make sense, the generation must be complete ( from a compilation point of view)
Introducing an AI contract generation support based on user prompt.
How to use it
In the chat window, start a new generation request with the prefix
/generate
.E.g.
Provided the AI generates a valid contract, a new workspace will be instantiate
SimpleStorage-1742323922
There is a total of 3 provider:
The default provider is set to be
mistralai
,Use
openai
oranthropic
keyword to select model providers relatively as belowChange the AI provider in the chat window
Use the following command to change the AI provider to either
openai
,mistralai
, oranthropic