wishmi1234 commited on
Commit
06e4a3d
·
verified ·
1 Parent(s): 7c425b1

Update tools.py

Browse files

Added loading the dataset

Files changed (1) hide show
  1. tools.py +10 -1
tools.py CHANGED
@@ -29,8 +29,17 @@ class GuestInfoRetrieverTool(Tool):
29
  else:
30
  return "No matching guest information found."
31
 
 
 
 
 
 
 
 
 
 
32
  # Initialize the tool
33
- # guest_info_tool = GuestInfoRetrieverTool(docs)
34
 
35
 
36
 
 
29
  else:
30
  return "No matching guest information found."
31
 
32
+ from datasets import load_dataset
33
+ from langchain_core.documents import Document
34
+
35
+ # Load the dataset from Hugging Face
36
+ dataset = load_dataset("agents-course/unit3-invitees")["train"]
37
+
38
+ # Create Document objects from the "info" column
39
+ docs = [Document(page_content=row["info"]) for row in dataset]
40
+
41
  # Initialize the tool
42
+ guest_info_tool = GuestInfoRetrieverTool(docs)
43
 
44
 
45