Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

update: optimized code.

Stitch-z22d509419708
diff --git a/metagpt/actions/invoice_ocr.py b/metagpt/actions/invoice_ocr.py
index 2532543d9..b37aa6885 100644
--- a/metagpt/actions/invoice_ocr.py
+++ b/metagpt/actions/invoice_ocr.py
@@ -71,9 +71,8 @@ class InvoiceOCR(Action):
# Use CP437 to encode the file name, and then use GBK decoding to prevent Chinese garbled code
relative_name = Path(zip_info.filename.encode("cp437").decode("gbk"))
if relative_name.suffix:
- name = relative_name.name
full_filename = file_directory / relative_name
- await File.write(full_filename.parent, name, zip_ref.read(zip_info.filename))
+ await File.write(full_filename.parent, relative_name.name, zip_ref.read(zip_info.filename))
logger.info(f"unzip_path: {file_directory}")
return file_directory