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