Skip to content

Commit

Permalink
feat: new artifact structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyiqunLu committed Sep 19, 2024
1 parent cc8be2e commit 4dec2ab
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions vision_agent/tools/meta_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ def create_code_artifact(artifacts: Artifacts, name: str) -> str:
return_str = f"[Artifact {name} created]"
print(return_str)

display(
{
MimeType.APPLICATION_ARTIFACT: json.dumps(
{"name": name, "content": artifacts[name]}
)
},
raw=True,
)
return return_str


Expand Down Expand Up @@ -305,7 +297,12 @@ def edit_code_artifact(
display(
{
MimeType.APPLICATION_ARTIFACT: json.dumps(
{"name": name, "content": artifacts[name]}
{
"name": name,
"content": artifacts[name],
"contentType": "vision_code",
"action": "edit",
}
)
},
raw=True,
Expand Down Expand Up @@ -366,7 +363,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)
Expand Down Expand Up @@ -434,7 +440,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": "edit",
}
)
},
raw=True,
)
return view_lines(code_lines, 0, total_lines, name, total_lines)
Expand Down

0 comments on commit 4dec2ab

Please sign in to comment.