Skip to content

Commit

Permalink
change from dict to tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
yzld2002 committed Sep 9, 2024
1 parent 515a4b1 commit 9350e40
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions vision_agent/tools/tool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ToolCallTrace(BaseModel):
request: MutableMapping[str, Any]
response: MutableMapping[str, Any]
error: Optional[Error]
files: Optional[List[Dict[str, str]]]
files: Optional[List[tuple[str, str]]]


def send_inference_request(
Expand Down Expand Up @@ -206,12 +206,7 @@ def _call_post(
) -> Any:
files_in_b64 = None
if files:
files_in_b64 = [
{"video": b64encode(file[1]).decode("utf-8")}
if file[0] == "video"
else {"image": b64encode(file[0]).decode("utf-8")}
for file in files
]
files_in_b64 = [(file[0], b64encode(file[1]).decode("utf-8")) for file in files]
try:
tool_call_trace = ToolCallTrace(
endpoint_url=url,
Expand Down

0 comments on commit 9350e40

Please sign in to comment.