谷歌
Gmail工具规范 #
基类: BaseToolSpec
Gmail工具规范。
赋予智能体读取、起草和发送Gmail邮件的能力
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 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
加载数据 #
load_data() -> List[Document]
从用户账户加载电子邮件。
Source code in 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
|
用户的查询 |
required |
max_results
|
Optional[int]
|
最大搜索结果数量 |
None
|
Source code in 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
|
Source code in 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(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
|
Source code in 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(draft_id: str = None) -> str
获取草稿邮件。 打印返回草稿的消息和ID。 返回:草稿对象,包括草稿ID和消息元数据。
参数:
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
draft_id
|
str
|
待更新的草稿ID |
None
|
Source code in 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(draft_id: str = None) -> str
发送一封草稿邮件。 打印返回的草稿消息和ID。 返回:草稿对象,包括草稿ID和消息元数据。
参数:
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
draft_id
|
str
|
待更新的草稿ID |
None
|
Source code in 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 |
|
Google日历工具规范 #
基类: BaseToolSpec
Google日历工具规范。
目前仅是对数据加载器的简单封装。 待办事项:为Google日历规范添加更多方法。
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 203 204 205 206 207 208 |
|
加载数据 #
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
|
Source code in 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
|
Source code in 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()
一个返回今天日期的函数。如果不清楚当前日期,请在调用其他函数前先调用此函数。
Source code in llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/calendar/base.py
204 205 206 207 208 |
|
Google搜索工具规范 #
基类: BaseToolSpec
Google搜索工具规格说明。
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 48 |
|
google搜索 #
google_search(query: str)
向谷歌搜索引擎发起查询以获取结果列表。
参数:
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
query
|
str
|
要传递给Google搜索的查询。 |
required |
num
|
int
|
返回的搜索结果数量。默认为None。 |
required |
抛出异常:
类型 | 描述 |
---|---|
ValueError
|
如果'num'不是1到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 48 |
|