File size: 2,412 Bytes
cfd3735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "487607cd",
   "metadata": {},
   "source": [
    "# Google Places\n",
    "\n",
    "This notebook goes through how to use Google Places API"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8690845f",
   "metadata": {},
   "outputs": [],
   "source": [
    "#!pip install googlemaps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "fae31ef4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"GPLACES_API_KEY\"] = \"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "abb502b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain.tools import GooglePlacesTool"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "a83a02ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "places = GooglePlacesTool()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "2b65a285",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"1. Delfina Restaurant\\nAddress: 3621 18th St, San Francisco, CA 94110, USA\\nPhone: (415) 552-4055\\nWebsite: https://www.delfinasf.com/\\n\\n\\n2. Piccolo Forno\\nAddress: 725 Columbus Ave, San Francisco, CA 94133, USA\\nPhone: (415) 757-0087\\nWebsite: https://piccolo-forno-sf.com/\\n\\n\\n3. L'Osteria del Forno\\nAddress: 519 Columbus Ave, San Francisco, CA 94133, USA\\nPhone: (415) 982-1124\\nWebsite: Unknown\\n\\n\\n4. Il Fornaio\\nAddress: 1265 Battery St, San Francisco, CA 94111, USA\\nPhone: (415) 986-0100\\nWebsite: https://www.ilfornaio.com/\\n\\n\""
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "places.run(\"al fornos\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "66d3da8a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}