Skip to content

fix(community): mask API keys, add async file tools, fix CSV encoding#548

Open
DoTA (dotuananh0712) wants to merge 1 commit intolangchain-ai:mainfrom
dotuananh0712:fix/async-file-tools-v2
Open

fix(community): mask API keys, add async file tools, fix CSV encoding#548
DoTA (dotuananh0712) wants to merge 1 commit intolangchain-ai:mainfrom
dotuananh0712:fix/async-file-tools-v2

Conversation

@dotuananh0712
Copy link

Summary

Changes

ChatOpenAI repr (Security)

  • Masks openai_api_key with *** in string representation
  • Prevents accidental API key exposure in logs and debugging

Async file management tools

  • Added _arun async methods to: read, write, delete, move, copy, list_dir, file_search
  • Uses asyncio.to_thread for file I/O operations
  • Uses aiofiles for read/write operations

UnstructuredCSVLoader (Bug fix #505)

  • Pass encoding parameter to partition_csv to support non-UTF-8 CSV files

Testing

  • All 27 unit tests pass
  • Ruff linting and formatting pass

…s, fix CSV encoding

- Security: Add __repr__ method to ChatOpenAI that masks API keys with ***
- Feature: Add async (_arun) methods to 7 file management tools
- Fix: Pass encoding to partition_csv in UnstructuredCSVLoader (issue langchain-ai#505)
@github-actions github-actions bot added the fix label Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need to pass encoding to partition_csv() in langchain_community/document_loaders/csv_loader.py --> _get_elements

1 participant