GmailToolSpec #
Bases: BaseToolSpec
GMail tool spec.
Gives the agent the ability to read, draft and send gmail messages
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
load_data #
load_data() -> List[Document]
Load emails from the user's account.
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
44 45 46 47 48 |
|
search_messages #
search_messages(query: str, max_results: Optional[int] = None)
Searches email messages given a query string and the maximum number of results requested by the user Returns: List of relevant message objects up to the maximum number of results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query[str] |
The user's query |
required | |
max_results |
Optional[int]
|
The maximum number of search results |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
create_draft #
create_draft(to: Optional[List[str]] = None, subject: Optional[str] = None, message: Optional[str] = None) -> str
Create and insert a draft email. Print the returned draft's message and id. Returns: Draft object, including draft id and message meta data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
to |
Optional[str]
|
The email addresses to send the message to |
None
|
subject |
Optional[str]
|
The subject for the event |
None
|
message |
Optional[str]
|
The message for the event |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
update_draft #
update_draft(to: Optional[List[str]] = None, subject: Optional[str] = None, message: Optional[str] = None, draft_id: str = None) -> str
Update a draft email. Print the returned draft's message and id. This function is required to be passed a draft_id that is obtained when creating messages Returns: Draft object, including draft id and message meta data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
to |
Optional[str]
|
The email addresses to send the message to |
None
|
subject |
Optional[str]
|
The subject for the event |
None
|
message |
Optional[str]
|
The message for the event |
None
|
draft_id |
str
|
the id of the draft to be updated |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
get_draft #
get_draft(draft_id: str = None) -> str
Get a draft email. Print the returned draft's message and id. Returns: Draft object, including draft id and message meta data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
draft_id |
str
|
the id of the draft to be updated |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
264 265 266 267 268 269 270 271 272 273 274 |
|
send_draft #
send_draft(draft_id: str = None) -> str
Sends a draft email. Print the returned draft's message and id. Returns: Draft object, including draft id and message meta data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
draft_id |
str
|
the id of the draft to be updated |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
GoogleCalendarToolSpec #
Bases: BaseToolSpec
Google Calendar tool spec.
Currently a simple wrapper around the data loader. TODO: add more methods to the Google Calendar spec.
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
load_data #
load_data(number_of_results: Optional[int] = 100, start_date: Optional[Union[str, date]] = None) -> List[Document]
Load data from user's calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
number_of_results |
Optional[int]
|
the number of events to return. Defaults to 100. |
100
|
start_date |
Optional[Union[str, date]]
|
the start date to return events from in date isoformat. Defaults to today. |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
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 |
|
create_event #
create_event(title: Optional[str] = None, description: Optional[str] = None, location: Optional[str] = None, start_datetime: Optional[Union[str, datetime]] = None, end_datetime: Optional[Union[str, datetime]] = None, attendees: Optional[List[str]] = None) -> str
Create an event on the users calendar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
Optional[str]
|
The title for the event |
None
|
description |
Optional[str]
|
The description for the event |
None
|
location |
Optional[str]
|
The location for the event |
None
|
start_datetime |
Optional[Union[str, datetime]]
|
The start datetime for the event |
None
|
end_datetime |
Optional[Union[str, datetime]]
|
The end datetime for the event |
None
|
attendees |
Optional[List[str]]
|
A list of email address to invite to the event |
None
|
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
get_date #
get_date()
A function to return todays date. Call this before any other functions if you are unaware of the date.
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
198 199 200 201 202 |
|
GoogleSearchToolSpec #
Bases: BaseToolSpec
Google Search tool spec.
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/search/base.py
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 |
|
google_search #
google_search(query: str)
Make a query to the Google search engine to receive a list of results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
str
|
The query to be passed to Google search. |
required |
num |
int
|
The number of search results to return. Defaults to None. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the 'num' is not an integer between 1 and 10. |
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/search/base.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|