Waii
WaiiToolSpec #
Bases: BaseToolSpec
, BaseReader
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
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 275 276 277 278 |
|
load_data #
load_data(ask: str) -> List[Document]
Query using natural language and load data from the Database, returning a list of Documents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ask |
str
|
a natural language question. |
required |
Returns:
Type | Description |
---|---|
List[Document]
|
List[Document]: A list of Document objects. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
69 70 71 72 73 74 75 76 77 78 79 80 |
|
get_answer #
get_answer(ask: str) -> List[Document]
Generate a SQL query and run it against the database, returning the summarization of the answer Args: ask: a natural language question.
Returns:
Name | Type | Description |
---|---|---|
str |
List[Document]
|
A string containing the summarization of the answer. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
97 98 99 100 101 102 103 104 105 106 107 108 |
|
generate_query_only #
generate_query_only(ask: str) -> str
Generate a SQL query and NOT run it, returning the query. If you need to get answer, you should use get_answer instead.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ask |
str
|
a natural language question. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the query. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
describe_query #
describe_query(question: str, query: str) -> str
Describe a sql query, returning the summarization of the answer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
question |
str
|
a natural language question which the people want to ask. |
required |
query |
str
|
a sql query. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the summarization of the answer. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
performance_analyze #
performance_analyze(query_uuid: str) -> str
Analyze the performance of a query, returning the summarization of the answer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query_uuid |
str
|
a query uuid, e.g. xxxxxxxxxxxxx... |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the summarization of the answer. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
diff_query #
diff_query(previous_query: str, current_query: str) -> str
Diff two sql queries, returning the summarization of the answer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
previous_query |
str
|
previous sql query. |
required |
current_query |
str
|
current sql query. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the summarization of the answer. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
describe_dataset #
describe_dataset(ask: str, schema_name: Optional[str] = None, table_name: Optional[str] = None) -> str
Describe a dataset (no matter if it is a table or schema), returning the summarization of the answer. Example questions like: "describe the dataset", "what the schema is about", "example question for the table xxx", etc. When both schema and table are None, describe the whole database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ask |
str
|
a natural language question (how you want to describe the dataset). |
required |
schema_name |
Optional[str]
|
a schema name (shouldn't include the database name or the table name). |
None
|
table_name |
Optional[str]
|
a table name. (shouldn't include the database name or the schema name). |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the summarization of the answer. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
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 |
|
transcode #
transcode(instruction: Optional[str] = '', source_dialect: Optional[str] = None, source_query: Optional[str] = None, target_dialect: Optional[str] = None) -> str
Transcode a sql query from one dialect to another, returning generated query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instruction |
Optional[str]
|
instruction in natural language. |
''
|
source_dialect |
Optional[str]
|
the source dialect of the query. |
None
|
source_query |
Optional[str]
|
the source query. |
None
|
target_dialect |
Optional[str]
|
the target dialect of the query. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string containing the generated query. |
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
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 |
|
get_semantic_contexts #
get_semantic_contexts() -> Any
Get all pre-defined semantic contexts.
Source code in llama-index-integrations/tools/llama-index-tools-waii/llama_index/tools/waii/base.py
274 275 276 277 278 |
|