Skip to content

Commit

Permalink
fix empty string base64 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ac-vibhor authored Jan 13, 2025
1 parent 646066b commit 2880ff8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web-agent/app/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ def process_task(task: Dict[str, Any]) -> Dict[str, Any]:
logger.info("Data is less than %s, sending data in response", max_file_size)
with open(temp_output_file.name, 'rb') as file:
file_data = file.read()
if len(file_data) == 0:
return task
base64_string = base64.b64encode(file_data).decode('utf-8')
task['responseBase64'] = True
task['output'] = base64_string
Expand Down

0 comments on commit 2880ff8

Please sign in to comment.