演示区
游乐场子图连接器工具规范 #
基类:EventGraphQLToolSpec
通过 Playgrounds API 连接到 The Graph 去中心化网络上的子图。
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
spec_functions |
list
|
指定工具功能的功能列表。 |
url |
str
|
GraphQL请求的端点URL。 |
headers |
dict
|
用于GraphQL请求的头部信息。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_connector/base.py
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 | |
graphql_request #
graphql_request(query: str, variables: Optional[dict] = None, operation_name: Optional[str] = None) -> Union[dict, str]
执行一个 GraphQL 查询。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
str
|
要执行的 GraphQL 查询字符串。 |
required |
variables
|
dict
|
GraphQL查询的变量。默认为None。 |
None
|
operation_name
|
str
|
操作的名称,如果查询中存在多个操作。默认为 None。 |
None
|
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
dict |
Union[dict, str]
|
来自 GraphQL 服务器的成功响应。 |
str |
Union[dict, str]
|
如果请求失败,显示错误信息。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_connector/base.py
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 | |
游乐场子图检查器工具规范 #
基类:EventGraphQLToolSpec
通过 Playgrounds API 连接到 The Graph 去中心化网络上的子图,并对子图进行内省。 提供处理和总结内省模式的功能,便于理解。
属性:
| 名称 | 类型 | 描述 |
|---|---|---|
spec_functions |
list
|
指定工具功能的功能列表。 |
url |
str
|
GraphQL请求的端点URL。 |
headers |
dict
|
用于GraphQL请求的头部信息。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_inspector/base.py
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 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 | |
introspect_and_summarize_subgraph #
introspect_and_summarize_subgraph() -> str
内省子图并将其模式总结为文本类别。
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
str |
str
|
内省子图模式的文本摘要。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_inspector/base.py
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 | |
format_section #
format_section(category: str, description: str, example: str, entities: dict) -> str
将子图内省结果的给定部分格式化为可读的字符串格式。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
category
|
str
|
实体的类别名称。 |
required |
description
|
str
|
解释该类别的描述说明。 |
required |
example
|
str
|
一个与类别相关的通用 GraphQL 查询示例。 |
required |
entities
|
dict
|
包含与该类别相关的实体及其字段的字典。 |
required |
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
str |
str
|
所提供部分数据的格式化字符串表示。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_inspector/base.py
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 | |
subgraph_to_text #
subgraph_to_text(subgraph: dict) -> str
将处理后的子图表示根据实体类别转换为文本摘要。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
subgraph
|
dict
|
经过处理的内省模式表示,分类为特定实体查询、列表实体查询和其他实体。 |
required |
返回:
| 名称 | 类型 | 描述 |
|---|---|---|
str |
str
|
已处理的子图模式的文本摘要。 |
workflows/handler.py 中的源代码llama_index/tools/playgrounds/subgraph_inspector/base.py
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 | |
选项: 成员:- PlaygroundsSubgraphConnectorToolSpec - PlaygroundsSubgraphInspectorToolSpec