diff --git a/vision_agent/tools/meta_tools.py b/vision_agent/tools/meta_tools.py index bcdbefb6..9012e9d4 100644 --- a/vision_agent/tools/meta_tools.py +++ b/vision_agent/tools/meta_tools.py @@ -214,7 +214,11 @@ def create_code_artifact(artifacts: Artifacts, name: str) -> str: display( { MimeType.APPLICATION_ARTIFACT: json.dumps( - {"name": name, "content": artifacts[name]} + { + "name": name, + "content": artifacts[name], + "action": "create", + } ) }, raw=True, @@ -305,7 +309,11 @@ def edit_code_artifact( display( { MimeType.APPLICATION_ARTIFACT: json.dumps( - {"name": name, "content": artifacts[name]} + { + "name": name, + "content": artifacts[name], + "action": "edit", + } ) }, raw=True, @@ -366,7 +374,16 @@ def detect_dogs(image_path: str): total_lines = len(code_lines) display( - {MimeType.APPLICATION_ARTIFACT: json.dumps({"name": name, "content": code})}, + { + MimeType.APPLICATION_ARTIFACT: json.dumps( + { + "name": name, + "content": code, + "contentType": "vision_code", + "action": "create", + } + ) + }, raw=True, ) return view_lines(code_lines, 0, total_lines, name, total_lines) @@ -434,7 +451,15 @@ def detect_dogs(image_path: str): total_lines = len(code_lines) display( - {MimeType.APPLICATION_ARTIFACT: json.dumps({"name": name, "content": code})}, + { + MimeType.APPLICATION_ARTIFACT: json.dumps( + { + "name": name, + "content": code, + "action": "edit", + } + ) + }, raw=True, ) return view_lines(code_lines, 0, total_lines, name, total_lines)