mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Fix to store e2b code execution text output file content as string
Previously was encoding E2B code execution text output content as b64. This was breaking - The AI model's ability to see the content of the file - Downloading the output text file with appropriately encoded content Issue created when adding E2B code sandbox in #1120
This commit is contained in:
@@ -257,7 +257,7 @@ async def execute_e2b(code: str, input_files: list[dict]) -> dict[str, Any]:
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
# Text files - encode utf-8 string as base64
|
# Text files - encode utf-8 string as base64
|
||||||
b64_data = base64.b64encode(content.encode("utf-8")).decode("utf-8")
|
b64_data = content
|
||||||
output_files.append({"filename": f.name, "b64_data": b64_data})
|
output_files.append({"filename": f.name, "b64_data": b64_data})
|
||||||
|
|
||||||
# Collect output files from execution results
|
# Collect output files from execution results
|
||||||
|
|||||||
Reference in New Issue
Block a user