08. Toolkits Use Agent

The biggest advantage of using the LangChain framework is the variety of features that are 3rd-party integration.

Among them, Toolkits integrates and offers a variety of tools.

You can check out the various Tools/Toolkits at the link below.

Reference

Copy

# Configuration file for managing API keys as environment variables
from dotenv import load_dotenv

# Load API key information
load_dotenv()

Copy

 True 

Copy

# LangSmith set up tracking. https://smith.langchain.com
# !pip install -qU langchain-teddynote
from langchain_teddynote import logging

# Enter a project name.
logging.langsmith("CH15-Agent-Toolkits")

Copy

First, temporary folder tmp Generate.

Copy

FileManagementToolkit

FileManagementToolkit Is a collection of tools for local file management.

Main components

File management tools

  • CopyFileTool : Copy file

  • DeleteFileTool : Delete file

  • FileSearchTool : File Search

  • MoveFileTool : Move file

  • ReadFileTool : Read file

  • WriteFileTool : Write file

  • ListDirectoryTool : Directory list lookup

Settings

  • root_dir : Root directory setting of file operations possible

  • selected_tools : Only certain tools are available selectively

Dynamic tool creation

  • get_tools Create instances of selected tools with methods

this FileManagementToolkit Can be useful when automating local file management tasks or giving AI agents the ability to manipulate files. However, a careful approach is needed in terms of security.

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

Copy

tmp Check inside the folder to see that the file was created as shown below.

Copy

tmp Check inside the folder to see that the file name has changed as shown below.

Copy

Copy

tmp 폴더 λ‚΄λΆ€λ₯Ό 확인해보면 μ•„λž˜μ™€ 같이 news 폴더가 μƒμ„±λ˜κ³  파일이 λ³΅μ‚¬λœ 것을 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

Copy

Copy

tmp Check inside the folder as shown below news You can check that all files except folders have been deleted.

Last updated