GmailToolSpec #
基类: BaseToolSpec
GMail 工具规范。
赋予代理读取、起草和发送 Gmail 消息的能力
源代码位于 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 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
load_data #
load_data() -> List[Document]
从用户账户加载电子邮件。
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
45 46 47 48 49 |
|
search_messages #
search_messages(query: str, max_results: Optional[int] = None)
根据查询字符串和用户请求的最大结果数搜索电子邮件。返回:最多包含最大结果数的相关消息对象列表。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
query[str]
|
用户查询 |
必需 | |
max_results
|
Optional[int]
|
最大搜索结果数 |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
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 |
|
create_draft #
create_draft(to: Optional[List[str]] = None, subject: Optional[str] = None, message: Optional[str] = None) -> str
创建并插入一封草稿电子邮件。打印返回的草稿消息和ID。返回:草稿对象,包括草稿ID和消息元数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
to
|
Optional[str]
|
收件人电子邮件地址 |
None
|
subject
|
Optional[str]
|
电子邮件主题 |
None
|
message
|
Optional[str]
|
电子邮件正文 |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
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 |
|
update_draft #
update_draft(to: Optional[List[str]] = None, subject: Optional[str] = None, message: Optional[str] = None, draft_id: str = None) -> str
更新草稿电子邮件。打印返回的草稿消息和ID。此函数需要传入创建消息时获得的draft_id。返回:草稿对象,包括草稿ID和消息元数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
to
|
Optional[str]
|
收件人电子邮件地址 |
None
|
subject
|
Optional[str]
|
电子邮件主题 |
None
|
message
|
Optional[str]
|
电子邮件正文 |
None
|
draft_id
|
str
|
要更新的草稿ID |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
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 |
|
get_draft #
get_draft(draft_id: str = None) -> str
获取草稿电子邮件。打印返回的草稿消息和ID。返回:草稿对象,包括草稿ID和消息元数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
draft_id
|
str
|
要更新的草稿ID |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
send_draft #
send_draft(draft_id: str = None) -> str
发送草稿电子邮件。打印返回的草稿消息和ID。返回:草稿对象,包括草稿ID和消息元数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
draft_id
|
str
|
要更新的草稿ID |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/gmail/base.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
GoogleCalendarToolSpec #
基类: BaseToolSpec
Google Calendar 工具规范。
目前只是数据加载器的简单包装。TODO:向Google Calendar规范添加更多方法。
源代码位于 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 203 204 205 206 207 208 |
|
load_data #
load_data(number_of_results: Optional[int] = 100, start_date: Optional[Union[str, date]] = None) -> List[Document]
从用户日历加载数据。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
number_of_results
|
Optional[int]
|
要返回的事件数量。默认为100。 |
100
|
start_date
|
Optional[Union[str, date]]
|
以日期 ISO 格式返回事件的开始日期。默认为今天。 |
None
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
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 |
|
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.
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
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
|
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
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 |
|
get_date #
get_date()
返回今天日期的函数。如果您不知道日期,请在调用其他函数之前调用此函数。
源代码位于 llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
204 205 206 207 208 |
|
GoogleSearchToolSpec #
基类: BaseToolSpec
Google Search 工具规范。
源代码位于 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 48 |
|
google_search #
google_search(query: str)
向 Google 搜索引擎发出查询以接收结果列表。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
query
|
str
|
要传递给 Google 搜索的查询。 |
必需 |
num
|
int
|
要返回的搜索结果数量。默认为 None。 |
必需 |
抛出
类型 | 描述 |
---|---|
ValueError
|
如果 'num' 不是介于 1 和 10 之间的整数。 |
源代码位于 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 48 |
|