-
Notifications
You must be signed in to change notification settings - Fork 43.7k
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
feat(forge): Implement a very very bad, but "functional" agent by default #7021
base: master
Are you sure you want to change the base?
Conversation
Note, this is a very bad agent lol
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
✅ Deploy Preview for auto-gpt-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
description="The creation datetime of the task.", | ||
example="2023-01-01T00:00:00Z", | ||
json_encoders={datetime: lambda v: v.isoformat()}, |
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 is why the openapi docs doesn't work btw
@@ -108,6 +108,7 @@ def load_prompt(self, template: str, **kwargs) -> str: | |||
template = os.path.join(self.model, template) | |||
if self.debug_enabled: | |||
LOG.debug(f"Loading template: {template}") | |||
template = template.replace("\\", "/") |
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.
windows compat
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.
Why needed for Windows compat? Do you know of Path.as_posix()
?
"type": "string", | ||
"required": True, | ||
} | ||
ActionParameter( |
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.
type fix
], | ||
output_type="list[str]", | ||
) | ||
async def list_files(agent, task_id: str, path: str) -> List[str]: | ||
async def list_files(agent: Agent, task_id: str, path: str) -> List[str]: |
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.
type hint
@@ -186,8 +188,11 @@ async def run_action( | |||
|
|||
if __name__ == "__main__": | |||
import sys | |||
import asyncio |
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.
swifty removal and replacement with more amenable action to not actually having an agent seeded. list_files requires a full agent to be able to be pulled in to actually work
@@ -231,7 +233,9 @@ async def read_webpage( | |||
except WebDriverException as e: | |||
# These errors are often quite long and include lots of context. | |||
# Just grab the first line. | |||
msg = e.msg.split("\n")[0] | |||
msg = "An error occurred while trying to load the page" |
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.
type fix
# self.workspace.write(task_id=task_id, path="output.txt", data=b"Washington D.C") | ||
|
||
# await self.db.create_artifact( | ||
# task_id=task_id, | ||
# step_id=step.step_id, | ||
# file_name="output.txt", | ||
# relative_path="", | ||
# agent_created=True, | ||
# ) | ||
|
||
# step.output = "Washington D.C" | ||
|
||
# LOG.info( | ||
# f"\t✅ Final Step completed: {step.step_id}. \n" | ||
# + f"Output should be placeholder text Washington D.C. You'll need to \n" | ||
# + f"modify execute_step to include LLM behavior. Follow the tutorial " | ||
# + f"if confused. " | ||
# ) | ||
|
||
# return step |
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 is from the tutorial so left here, but replaced with something that "can" work. Its bad at responding though. Could really use some help on the prompts to maek this work sometimes
@@ -2,7 +2,7 @@ | |||
The Forge SDK. This is the core of the Forge. It contains the agent protocol, which is the | |||
core of the Forge. | |||
""" | |||
from ..llm import chat_completion_request, create_embedding_request, transcribe_audio | |||
# from forge.llm import chat_completion_request, create_embedding_request, transcribe_audio |
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.
Circular import fix.
Why do we need this file?
|
||
Note: this is a placeholder method and must be overridden by the agent with the actions | ||
that the agent should perform on one step. Override this method in the ForgeAgent class. |
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.
Pointer for users of this to look in the right place
status_code=200, | ||
media_type="application/json", | ||
) | ||
steps = await agent.list_steps(task_id, page or 1, page_size or 10) |
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.
type error fix
try: | ||
# An empty step request represents a yes to continue command | ||
if not step: | ||
step = StepRequestBody(input="y") | ||
step = StepRequestBody(name=None, input="y") |
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.
type error fix
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
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.
Looks good overall
@@ -108,6 +108,7 @@ def load_prompt(self, template: str, **kwargs) -> str: | |||
template = os.path.join(self.model, template) | |||
if self.debug_enabled: | |||
LOG.debug(f"Loading template: {template}") | |||
template = template.replace("\\", "/") |
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.
Why needed for Windows compat? Do you know of Path.as_posix()
?
@CodiumAI-Agent /review |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
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.
Application crashes when the LLM picks a non-existent command, which is also why it fails CI
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Background
We’ve received some notes about Forge being difficult to use and a bit broken. This PR aims to solve some of the core issues with that.
Changes 🏗️
Do we want to keep Washington DCcand make a real agent instead?
PR Quality Scorecard ✨
+2 pts
+5 pts
+5 pts
+5 pts
-4 pts
+4 pts
+5 pts
-5 pts
agbenchmark
to verify that these changes do not regress performance?+10 pts