Skip to content

Commit

Permalink
tutorial12
Browse files Browse the repository at this point in the history
  • Loading branch information
ronidas39 committed Dec 7, 2023
1 parent 738c1eb commit 21e99a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
Empty file added tutorial12/file9.csv
Empty file.
Empty file added tutorial12/file_names.txt
Empty file.
12 changes: 12 additions & 0 deletions tutorial12/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from langchain.agents import AgentType,initialize_agent,load_tools
from langchain.chat_models import ChatOpenAI
from langchain.agents.agent_toolkits import FileManagementToolkit
import os

wd=os.getcwd()
llm=ChatOpenAI(temperature=0.0)
toolkit=FileManagementToolkit(root_dir=wd)
tools=toolkit.get_tools()
agent=initialize_agent(tools,llm,agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,verbose=True,
agent_executor_kwards={"handle_parsing_erros":True})
print(agent.run("delete all files with .csv extension"))
1 change: 1 addition & 0 deletions tutorial12/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world
Binary file modified tutorial12/tutorial12.pptx
Binary file not shown.

0 comments on commit 21e99a3

Please sign in to comment.