mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Make agbenchmark a proxy of the evaluated agent (#5279)
Make agbenchmark a Proxy of the evaluated agent Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
@@ -60,19 +60,23 @@ async def run_api_agent(
|
||||
api_instance, artifacts_location, task_id, "artifacts_out"
|
||||
)
|
||||
|
||||
artifacts = await api_instance.list_agent_task_artifacts(task_id=task_id)
|
||||
for artifact in artifacts.artifacts:
|
||||
# current absolute path of the directory of the file
|
||||
directory_location = TEMP_FOLDER_ABS_PATH
|
||||
if artifact.relative_path:
|
||||
directory_location = directory_location / artifact.relative_path
|
||||
await copy_agent_artifacts_into_temp_folder(api_instance, task_id)
|
||||
|
||||
with open(directory_location / artifact.file_name, "wb") as f:
|
||||
content = await api_instance.download_agent_task_artifact(
|
||||
task_id=task_id, artifact_id=artifact.artifact_id
|
||||
)
|
||||
|
||||
f.write(content)
|
||||
async def copy_agent_artifacts_into_temp_folder(api_instance, task_id):
|
||||
artifacts = await api_instance.list_agent_task_artifacts(task_id=task_id)
|
||||
for artifact in artifacts.artifacts:
|
||||
# current absolute path of the directory of the file
|
||||
directory_location = TEMP_FOLDER_ABS_PATH
|
||||
if artifact.relative_path:
|
||||
directory_location = directory_location / artifact.relative_path
|
||||
|
||||
with open(directory_location / artifact.file_name, "wb") as f:
|
||||
content = await api_instance.download_agent_task_artifact(
|
||||
task_id=task_id, artifact_id=artifact.artifact_id
|
||||
)
|
||||
|
||||
f.write(content)
|
||||
|
||||
|
||||
async def append_updates_file(step: Step):
|
||||
|
||||
Reference in New Issue
Block a user