Skip to content
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

fix: remove the code execution result from logs in pick_plan #189

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions vision_agent/agent/vision_agent_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def format_plans(plans: Dict[str, Any]) -> str:


def extract_image(
media: Optional[Sequence[Union[str, Path]]]
media: Optional[Sequence[Union[str, Path]]],
) -> Optional[Sequence[Union[str, Path]]]:
if media is None:
return None
Expand Down Expand Up @@ -186,7 +186,8 @@ def pick_plan(
if tool_output.success
else "Code execution failed"
),
"payload": tool_output.to_json(),
"code": DefaultImports.prepend_imports(code),
# "payload": tool_output.to_json(),
"status": "completed" if tool_output.success else "failed",
}
)
Expand All @@ -211,6 +212,9 @@ def pick_plan(
}
)
code = extract_code(model(prompt))
tool_output = code_interpreter.exec_isolation(
DefaultImports.prepend_imports(code)
)
log_progress(
{
"type": "log",
Expand All @@ -220,13 +224,10 @@ def pick_plan(
else "Code execution failed"
),
"code": DefaultImports.prepend_imports(code),
"payload": tool_output.to_json(),
# "payload": tool_output.to_json(),
"status": "completed" if tool_output.success else "failed",
}
)
tool_output = code_interpreter.exec_isolation(
DefaultImports.prepend_imports(code)
)
tool_output_str = ""
if len(tool_output.logs.stdout) > 0:
tool_output_str = tool_output.logs.stdout[0]
Expand Down
Loading