You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifies the required output for a natural language request.
579
+
580
+
* `sql` —
581
+
The output is a SQL++ statement.
582
+
583
+
* `jsudf` —
584
+
The output is a `CREATE FUNCTION` statement which you can use to generate a SQL++ managed JavaScript user-defined function.
585
+
586
+
* `ftssql` —
587
+
The output is a SQL++ statement which can use a Flex index, if available.
588
+
589
+
Natural language requests use the Couchbase Capella iQ service as a backend.
590
+
You must have a Couchbase Capella account to make a natural language request.
591
+
592
+
This parameter is available in clusters running Couchbase Server 8.0 and later.
593
+
x-has-default: true
594
+
default: sql
595
+
enum: ["sql", "jsudf", "ftssql"]
516
596
numatrs:
517
597
type: integer
518
598
format: int32
@@ -582,7 +662,7 @@ components:
582
662
type: string
583
663
x-desc-name: prepared
584
664
description: |-
585
-
_Required_ if `statement` not provided.
665
+
_Required_ if `statement` or `natural` not provided.
586
666
587
667
The name of the prepared SQL++ statement to be executed.
588
668
Refer to [EXECUTE][execute] for examples.
@@ -840,7 +920,7 @@ components:
840
920
type: string
841
921
x-desc-name: statement
842
922
description: |-
843
-
_Required_ if `prepared` not provided.
923
+
_Required_ if `prepared` or `natural` not provided.
844
924
845
925
Any valid SQL++ statement for a POST request, or a read-only SQL++ statement (SELECT, EXPLAIN) for a GET request.
846
926
@@ -1105,6 +1185,12 @@ components:
1105
1185
clientContextID:
1106
1186
type: string
1107
1187
description: The client context ID of the request, if one was supplied — see `client_context_id` in [Request Parameters](#Request).
1188
+
generated_statement:
1189
+
type: string
1190
+
description: |-
1191
+
The generated statement, if the request was a natural language prompt.
1192
+
x-has-example: true
1193
+
example: SELECT country, COUNT(*) AS `airline_count` FROM `travel-sample`.`inventory`.`airline` AS `a` GROUP BY country
1108
1194
signature:
1109
1195
type: object
1110
1196
description: |-
@@ -1208,9 +1294,11 @@ components:
1208
1294
properties:
1209
1295
elapsedTime:
1210
1296
type: string
1297
+
format: duration
1211
1298
description: The total time taken for the request, that is the time from when the request was received until the results were returned.
1212
1299
executionTime:
1213
1300
type: string
1301
+
format: duration
1214
1302
description: The time taken for the execution of the request, that is the time from when query execution started until the results were returned.
1215
1303
resultCount:
1216
1304
type: integer
@@ -1220,6 +1308,12 @@ components:
1220
1308
type: integer
1221
1309
format: unsigned
1222
1310
description: The total number of bytes in the results.
1311
+
naturalLanguageProcessingTime:
1312
+
type: string
1313
+
format: duration
1314
+
description: |-
1315
+
The total time spent processing a natural language request.
1316
+
The cumulation of authentication, collecting schema, and time waiting for the response from the LLM, or wait time for the natural language request to be serviced.
1223
1317
mutationCount:
1224
1318
type: integer
1225
1319
description: The number of mutations that were made during the request.
0 commit comments