Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

forge: simplified sample step code

SwiftyOSb32125d0ad32
diff --git a/autogpts/forge/forge/agent.py b/autogpts/forge/forge/agent.py
index c70f623d81..b2f942c260 100644
--- a/autogpts/forge/forge/agent.py
+++ b/autogpts/forge/forge/agent.py
@@ -120,28 +120,23 @@ class ForgeAgent(Agent):
if they want the agent to continue or not.
"""
# An example that
- self.workspace.write(task_id=task_id, path="output.txt", data=b"Washington D.C")
step = await self.db.create_step(
task_id=task_id, input=step_request, is_last=True
)
- step_input = "None"
- if step.input:
- step_input = step.input[:19]
- message = f"\t🔄 Step executed: {step.step_id} input: {step_input}"
- if step.is_last:
- message = (
- f"\t✅ Final Step completed: {step.step_id} input: {step_input}"
- )
-
- LOG.info(message)
-
- artifact = await self.db.create_artifact(
+
+ 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}")
+
return step