Add AutoGPT support#9
Closed
metatarz wants to merge 2 commits intomayt:masterfrom
metatarz:metatarz/auto-gpt
Closed
Add AutoGPT support#9metatarz wants to merge 2 commits intomayt:masterfrom metatarz:metatarz/auto-gpt
metatarz wants to merge 2 commits intomayt:masterfrom
metatarz:metatarz/auto-gpt
Conversation
mayt
requested changes
Dec 12, 2023
Owner
mayt
left a comment
There was a problem hiding this comment.
Looks like something is off with the execute part of the code too. It doesn't seem to update browser. I'll take a second pass
| return cleanedCommands; | ||
| } | ||
|
|
||
| async function getPlayWrightCode(task) { |
Owner
There was a problem hiding this comment.
Looks like you can to pass in chatApi and page here
| You are on the website ${page.evaluate('location.href')} | ||
|
|
||
| Here is the overview of the site | ||
| ${await parseSite(page, options)} |
Owner
There was a problem hiding this comment.
the options here is also not defined. You can remove it for now.
| name: 'get playwright code', | ||
| description: | ||
| 'useful for when you need to get playwright code. Returns the playwright code to execute', | ||
| func: async (task) => getPlayWrightCode(task), |
Owner
There was a problem hiding this comment.
do you have to await on getPlayWrightCode(task)?
| } | ||
| } | ||
|
|
||
| let page; // declare here for global reference |
Owner
There was a problem hiding this comment.
looks like you dont need this if you pass it in below
| try { | ||
| await doAction(chatApi, page, task, options); | ||
| if (options.autogpt) { | ||
| await doAutoGPTAction(chatApi, task); |
Owner
There was a problem hiding this comment.
Suggested change
| await doAutoGPTAction(chatApi, task); | |
| await doAutoGPTAction(page, chatApi, task, option); |
you can pass page and option in here too.
Owner
|
I took liberty and took your coded and expanded the autogpt integration. See the PR at #14 If you would mind, I'll close this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#10 This PR allows users to opt in autogpt. It basically breaksdown the
doActionfunction into generate playwright code, execute code and get site overview tools.I thought it would be useful to share for users seeking to achieve more complex tasks.