From cbf0c190f1dbd51ea1308d643469f0c9c8e4797a Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Tue, 6 May 2025 09:34:14 -0700 Subject: [PATCH 1/2] Add cat node -h enumerated values (#4344) (cherry picked from commit af8422e87dea665360304bdbe1ff0d95bf24c470) --- output/openapi/elasticsearch-openapi.json | 282 +++++++- output/schema/schema.json | 766 ++++++++++++++++++++- output/typescript/types.ts | 6 +- specification/cat/_types/CatBase.ts | 456 ++++++++++++ specification/cat/nodes/CatNodesRequest.ts | 14 +- 5 files changed, 1498 insertions(+), 26 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 52145a638a..d96bf9948d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -1937,17 +1937,17 @@ { "in": "query", "name": "h", - "description": "List of columns to appear in the response. Supports simple wildcards.", + "description": "A comma-separated list of columns names to display.\nIt supports simple wildcards.", "deprecated": false, "schema": { - "$ref": "#/components/schemas/_types.Names" + "$ref": "#/components/schemas/cat._types.CatNodeColumns" }, "style": "form" }, { "in": "query", "name": "s", - "description": "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name.", + "description": "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.Names" @@ -1957,7 +1957,7 @@ { "in": "query", "name": "master_timeout", - "description": "Period to wait for a connection to the master node.", + "description": "The period to wait for a connection to the master node.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.Duration" @@ -1967,7 +1967,7 @@ { "in": "query", "name": "time", - "description": "Unit used to display time values.", + "description": "The unit used to display time values.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types.TimeUnit" @@ -59307,6 +59307,278 @@ } } }, + "cat._types.CatNodeColumns": { + "oneOf": [ + { + "$ref": "#/components/schemas/cat._types.CatNodeColumn" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/cat._types.CatNodeColumn" + } + } + ] + }, + "cat._types.CatNodeColumn": { + "type": "string", + "enum": [ + "build", + "b", + "completion.size", + "cs", + "completionSize", + "cpu", + "disk.avail", + "d", + "disk", + "diskAvail", + "disk.total", + "dt", + "diskTotal", + "disk.used", + "du", + "diskUsed", + "disk.used_percent", + "dup", + "diskUsedPercent", + "fielddata.evictions", + "fe", + "fielddataEvictions", + "fielddata.memory_size", + "fm", + "fielddataMemory", + "file_desc.current", + "fdc", + "fileDescriptorCurrent", + "file_desc.max", + "fdm", + "fileDescriptorMax", + "file_desc.percent", + "fdp", + "fileDescriptorPercent", + "flush.total", + "ft", + "flushTotal", + "flush.total_time", + "ftt", + "flushTotalTime", + "get.current", + "gc", + "getCurrent", + "get.exists_time", + "geti", + "getExistsTime", + "get.exists_total", + "geto", + "getExistsTotal", + "get.missing_time", + "gmti", + "getMissingTime", + "get.missing_total", + "gmto", + "getMissingTotal", + "get.time", + "gti", + "getTime", + "get.total", + "gto", + "getTotal", + "heap.current", + "hc", + "heapCurrent", + "heap.max", + "hm", + "heapMax", + "heap.percent", + "hp", + "heapPercent", + "http_address", + "http", + "id", + "nodeId", + "indexing.delete_current", + "idc", + "indexingDeleteCurrent", + "indexing.delete_time", + "idti", + "indexingDeleteTime", + "indexing.delete_total", + "idto", + "indexingDeleteTotal", + "indexing.index_current", + "iic", + "indexingIndexCurrent", + "indexing.index_failed", + "iif", + "indexingIndexFailed", + "indexing.index_failed_due_to_version_conflict", + "iifvc", + "indexingIndexFailedDueToVersionConflict", + "indexing.index_time", + "iiti", + "indexingIndexTime", + "indexing.index_total", + "iito", + "indexingIndexTotal", + "ip", + "i", + "jdk", + "j", + "load_1m", + "l", + "load_5m", + "l", + "load_15m", + "l", + "mappings.total_count", + "mtc", + "mappingsTotalCount", + "mappings.total_estimated_overhead_in_bytes", + "mteo", + "mappingsTotalEstimatedOverheadInBytes", + "master", + "m", + "merges.current", + "mc", + "mergesCurrent", + "merges.current_docs", + "mcd", + "mergesCurrentDocs", + "merges.current_size", + "mcs", + "mergesCurrentSize", + "merges.total", + "mt", + "mergesTotal", + "merges.total_docs", + "mtd", + "mergesTotalDocs", + "merges.total_size", + "mts", + "mergesTotalSize", + "merges.total_time", + "mtt", + "mergesTotalTime", + "name", + "n", + "node.role", + "r", + "role", + "nodeRole", + "pid", + "p", + "port", + "po", + "query_cache.memory_size", + "qcm", + "queryCacheMemory", + "query_cache.evictions", + "qce", + "queryCacheEvictions", + "query_cache.hit_count", + "qchc", + "queryCacheHitCount", + "query_cache.miss_count", + "qcmc", + "queryCacheMissCount", + "ram.current", + "rc", + "ramCurrent", + "ram.max", + "rm", + "ramMax", + "ram.percent", + "rp", + "ramPercent", + "refresh.total", + "rto", + "refreshTotal", + "refresh.time", + "rti", + "refreshTime", + "request_cache.memory_size", + "rcm", + "requestCacheMemory", + "request_cache.evictions", + "rce", + "requestCacheEvictions", + "request_cache.hit_count", + "rchc", + "requestCacheHitCount", + "request_cache.miss_count", + "rcmc", + "requestCacheMissCount", + "script.compilations", + "scrcc", + "scriptCompilations", + "script.cache_evictions", + "scrce", + "scriptCacheEvictions", + "search.fetch_current", + "sfc", + "searchFetchCurrent", + "search.fetch_time", + "sfti", + "searchFetchTime", + "search.fetch_total", + "sfto", + "searchFetchTotal", + "search.open_contexts", + "so", + "searchOpenContexts", + "search.query_current", + "sqc", + "searchQueryCurrent", + "search.query_time", + "sqti", + "searchQueryTime", + "search.query_total", + "sqto", + "searchQueryTotal", + "search.scroll_current", + "scc", + "searchScrollCurrent", + "search.scroll_time", + "scti", + "searchScrollTime", + "search.scroll_total", + "scto", + "searchScrollTotal", + "segments.count", + "sc", + "segmentsCount", + "segments.fixed_bitset_memory", + "sfbm", + "fixedBitsetMemory", + "segments.index_writer_memory", + "siwm", + "segmentsIndexWriterMemory", + "segments.memory", + "sm", + "segmentsMemory", + "segments.version_map_memory", + "svmm", + "segmentsVersionMapMemory", + "shard_stats.total_count", + "sstc", + "shards", + "shardStatsTotalCount", + "suggest.current", + "suc", + "suggestCurrent", + "suggest.time", + "suti", + "suggestTime", + "suggest.total", + "suto", + "suggestTotal", + "uptime", + "u", + "version", + "v" + ] + }, "cat.nodes.NodesRecord": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 4f06536f72..60c3e74756 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -94905,7 +94905,7 @@ "name": "CatDatafeedColumns", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L559-L559", + "specLocation": "cat/_types/CatBase.ts#L1014-L1014", "type": { "kind": "union_of", "items": [ @@ -95055,7 +95055,7 @@ "name": "CatDfaColumn", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L472-L557" + "specLocation": "cat/_types/CatBase.ts#L473-L558" }, { "kind": "type_alias", @@ -95063,7 +95063,7 @@ "name": "CatDfaColumns", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L558-L558", + "specLocation": "cat/_types/CatBase.ts#L1013-L1013", "type": { "kind": "union_of", "items": [ @@ -95087,6 +95087,743 @@ ] } }, + { + "kind": "enum", + "members": [ + { + "aliases": [ + "b" + ], + "description": "The Elasticsearch build hash. For example: `5c03844`.", + "name": "build" + }, + { + "aliases": [ + "cs", + "completionSize" + ], + "description": "The size of completion. For example: `0b`.", + "name": "completion.size" + }, + { + "description": "The percentage of recent system CPU used.", + "name": "cpu" + }, + { + "aliases": [ + "d", + "disk", + "diskAvail" + ], + "description": "The available disk space. For example: `198.4gb`.", + "name": "disk.avail" + }, + { + "aliases": [ + "dt", + "diskTotal" + ], + "description": "The total disk space. For example: `458.3gb`.", + "name": "disk.total" + }, + { + "aliases": [ + "du", + "diskUsed" + ], + "description": "The used disk space. For example: `259.8gb`.", + "name": "disk.used" + }, + { + "aliases": [ + "dup", + "diskUsedPercent" + ], + "description": "The percentage of disk space used.", + "name": "disk.used_percent" + }, + { + "aliases": [ + "fe", + "fielddataEvictions" + ], + "description": "The number of fielddata cache evictions.", + "name": "fielddata.evictions" + }, + { + "aliases": [ + "fm", + "fielddataMemory" + ], + "description": "The fielddata cache memory used. For example: `0b`.", + "name": "fielddata.memory_size" + }, + { + "aliases": [ + "fdc", + "fileDescriptorCurrent" + ], + "description": "The number of file descriptors used.", + "name": "file_desc.current" + }, + { + "aliases": [ + "fdm", + "fileDescriptorMax" + ], + "description": "The maximum number of file descriptors.", + "name": "file_desc.max" + }, + { + "aliases": [ + "fdp", + "fileDescriptorPercent" + ], + "description": "The percentage of file descriptors used.", + "name": "file_desc.percent" + }, + { + "aliases": [ + "ft", + "flushTotal" + ], + "description": "The number of flushes.", + "name": "flush.total" + }, + { + "aliases": [ + "ftt", + "flushTotalTime" + ], + "description": "The amount of time spent in flush.", + "name": "flush.total_time" + }, + { + "aliases": [ + "gc", + "getCurrent" + ], + "description": "The number of current get operations.", + "name": "get.current" + }, + { + "aliases": [ + "geti", + "getExistsTime" + ], + "description": "The time spent in successful get operations. For example: `14ms`.", + "name": "get.exists_time" + }, + { + "aliases": [ + "geto", + "getExistsTotal" + ], + "description": "The number of successful get operations.", + "name": "get.exists_total" + }, + { + "aliases": [ + "gmti", + "getMissingTime" + ], + "description": "The time spent in failed get operations. For example: `0s`.", + "name": "get.missing_time" + }, + { + "aliases": [ + "gmto", + "getMissingTotal" + ], + "description": "The number of failed get operations.", + "name": "get.missing_total" + }, + { + "aliases": [ + "gti", + "getTime" + ], + "description": "The amount of time spent in get operations. For example: `14ms`.", + "name": "get.time" + }, + { + "aliases": [ + "gto", + "getTotal" + ], + "description": "The number of get operations.", + "name": "get.total" + }, + { + "aliases": [ + "hc", + "heapCurrent" + ], + "description": "The used heap size. For example: `311.2mb`.", + "name": "heap.current" + }, + { + "aliases": [ + "hm", + "heapMax" + ], + "description": "The total heap size. For example: `4gb`.", + "name": "heap.max" + }, + { + "aliases": [ + "hp", + "heapPercent" + ], + "description": "The used percentage of total allocated Elasticsearch JVM heap.\nThis value reflects only the Elasticsearch process running within the operating system and is the most direct indicator of its JVM, heap, or memory resource performance.", + "name": "heap.percent" + }, + { + "aliases": [ + "http" + ], + "description": "The bound HTTP address.", + "name": "http_address" + }, + { + "aliases": [ + "nodeId" + ], + "description": "The identifier for the node.", + "name": "id" + }, + { + "aliases": [ + "idc", + "indexingDeleteCurrent" + ], + "description": "The number of current deletion operations.", + "name": "indexing.delete_current" + }, + { + "aliases": [ + "idti", + "indexingDeleteTime" + ], + "description": "The time spent in deletion operations. For example: `2ms`.", + "name": "indexing.delete_time" + }, + { + "aliases": [ + "idto", + "indexingDeleteTotal" + ], + "description": "The number of deletion operations.", + "name": "indexing.delete_total" + }, + { + "aliases": [ + "iic", + "indexingIndexCurrent" + ], + "description": "The number of current indexing operations.", + "name": "indexing.index_current" + }, + { + "aliases": [ + "iif", + "indexingIndexFailed" + ], + "description": "The number of failed indexing operations.", + "name": "indexing.index_failed" + }, + { + "aliases": [ + "iifvc", + "indexingIndexFailedDueToVersionConflict" + ], + "description": "The number of indexing operations that failed due to version conflict.", + "name": "indexing.index_failed_due_to_version_conflict" + }, + { + "aliases": [ + "iiti", + "indexingIndexTime" + ], + "description": "The time spent in indexing operations. For example: `134ms`.", + "name": "indexing.index_time" + }, + { + "aliases": [ + "iito", + "indexingIndexTotal" + ], + "description": "The number of indexing operations.", + "name": "indexing.index_total" + }, + { + "aliases": [ + "i" + ], + "description": "The IP address.", + "name": "ip" + }, + { + "aliases": [ + "j" + ], + "description": "The Java version. For example: `1.8.0`.", + "name": "jdk" + }, + { + "aliases": [ + "l" + ], + "description": "The most recent load average. For example: `0.22`.", + "name": "load_1m" + }, + { + "aliases": [ + "l" + ], + "description": "The load average for the last five minutes. For example: `0.78`.", + "name": "load_5m" + }, + { + "aliases": [ + "l" + ], + "description": "The load average for the last fifteen minutes. For example: `1.24`.", + "name": "load_15m" + }, + { + "aliases": [ + "mtc", + "mappingsTotalCount" + ], + "description": "The number of mappings, including runtime and object fields.", + "name": "mappings.total_count" + }, + { + "aliases": [ + "mteo", + "mappingsTotalEstimatedOverheadInBytes" + ], + "description": "The estimated heap overhead, in bytes, of mappings on this node, which allows for 1KiB of heap for every mapped field.", + "name": "mappings.total_estimated_overhead_in_bytes" + }, + { + "aliases": [ + "m" + ], + "description": "Indicates whether the node is the elected master node.\nReturned values include `*` (elected master) and `-` (not elected master).", + "name": "master" + }, + { + "aliases": [ + "mc", + "mergesCurrent" + ], + "description": "The number of current merge operations.", + "name": "merges.current" + }, + { + "aliases": [ + "mcd", + "mergesCurrentDocs" + ], + "description": "The number of current merging documents.", + "name": "merges.current_docs" + }, + { + "aliases": [ + "mcs", + "mergesCurrentSize" + ], + "description": "The size of current merges. For example: `0b`.", + "name": "merges.current_size" + }, + { + "aliases": [ + "mt", + "mergesTotal" + ], + "description": "The number of completed merge operations.", + "name": "merges.total" + }, + { + "aliases": [ + "mtd", + "mergesTotalDocs" + ], + "description": "The number of merged documents.", + "name": "merges.total_docs" + }, + { + "aliases": [ + "mts", + "mergesTotalSize" + ], + "description": "The total size of merges. For example: `0b`.", + "name": "merges.total_size" + }, + { + "aliases": [ + "mtt", + "mergesTotalTime" + ], + "description": "The time spent merging documents. For example: `0s`.", + "name": "merges.total_time" + }, + { + "aliases": [ + "n" + ], + "description": "The node name.", + "name": "name" + }, + { + "aliases": [ + "r", + "role", + "nodeRole" + ], + "description": "The roles of the node.\nReturned values include `c` (cold node), `d` (data node), `f` (frozen node), `h` (hot node), `i` (ingest node), `l` (machine learning node), `m` (master-eligible node), `r` (remote cluster client node), `s` (content node), `t` (transform node), `v` (voting-only node), `w` (warm node), and `-` (coordinating node only).\nFor example, `dim` indicates a master-eligible data and ingest node.", + "name": "node.role" + }, + { + "aliases": [ + "p" + ], + "description": "The process identifier.", + "name": "pid" + }, + { + "aliases": [ + "po" + ], + "description": "The bound transport port number.", + "name": "port" + }, + { + "aliases": [ + "qcm", + "queryCacheMemory" + ], + "description": "The used query cache memory. For example: `0b`.", + "name": "query_cache.memory_size" + }, + { + "aliases": [ + "qce", + "queryCacheEvictions" + ], + "description": "The number of query cache evictions.", + "name": "query_cache.evictions" + }, + { + "aliases": [ + "qchc", + "queryCacheHitCount" + ], + "description": "The query cache hit count.", + "name": "query_cache.hit_count" + }, + { + "aliases": [ + "qcmc", + "queryCacheMissCount" + ], + "description": "The query cache miss count.", + "name": "query_cache.miss_count" + }, + { + "aliases": [ + "rc", + "ramCurrent" + ], + "description": "The used total memory. For example: `513.4mb`.", + "name": "ram.current" + }, + { + "aliases": [ + "rm", + "ramMax" + ], + "description": "The total memory. For example: `2.9gb`.", + "name": "ram.max" + }, + { + "aliases": [ + "rp", + "ramPercent" + ], + "description": "The used percentage of the total operating system memory.\nThis reflects all processes running on the operating system instead of only Elasticsearch and is not guaranteed to correlate to its performance.", + "name": "ram.percent" + }, + { + "aliases": [ + "rto", + "refreshTotal" + ], + "description": "The number of refresh operations.", + "name": "refresh.total" + }, + { + "aliases": [ + "rti", + "refreshTime" + ], + "description": "The time spent in refresh operations. For example: `91ms`.", + "name": "refresh.time" + }, + { + "aliases": [ + "rcm", + "requestCacheMemory" + ], + "description": "The used request cache memory. For example: `0b`.", + "name": "request_cache.memory_size" + }, + { + "aliases": [ + "rce", + "requestCacheEvictions" + ], + "description": "The number of request cache evictions.", + "name": "request_cache.evictions" + }, + { + "aliases": [ + "rchc", + "requestCacheHitCount" + ], + "description": "The request cache hit count.", + "name": "request_cache.hit_count" + }, + { + "aliases": [ + "rcmc", + "requestCacheMissCount" + ], + "description": "The request cache miss count.", + "name": "request_cache.miss_count" + }, + { + "aliases": [ + "scrcc", + "scriptCompilations" + ], + "description": "The number of total script compilations.", + "name": "script.compilations" + }, + { + "aliases": [ + "scrce", + "scriptCacheEvictions" + ], + "description": "The number of total compiled scripts evicted from cache.", + "name": "script.cache_evictions" + }, + { + "aliases": [ + "sfc", + "searchFetchCurrent" + ], + "description": "The number of current fetch phase operations.", + "name": "search.fetch_current" + }, + { + "aliases": [ + "sfti", + "searchFetchTime" + ], + "description": "The time spent in fetch phase. For example: `37ms`.", + "name": "search.fetch_time" + }, + { + "aliases": [ + "sfto", + "searchFetchTotal" + ], + "description": "The number of fetch operations.", + "name": "search.fetch_total" + }, + { + "aliases": [ + "so", + "searchOpenContexts" + ], + "description": "The number of open search contexts.", + "name": "search.open_contexts" + }, + { + "aliases": [ + "sqc", + "searchQueryCurrent" + ], + "description": "The number of current query phase operations.", + "name": "search.query_current" + }, + { + "aliases": [ + "sqti", + "searchQueryTime" + ], + "description": "The time spent in query phase. For example: `43ms`.", + "name": "search.query_time" + }, + { + "aliases": [ + "sqto", + "searchQueryTotal" + ], + "description": "The number of query operations.", + "name": "search.query_total" + }, + { + "aliases": [ + "scc", + "searchScrollCurrent" + ], + "description": "The number of open scroll contexts.", + "name": "search.scroll_current" + }, + { + "aliases": [ + "scti", + "searchScrollTime" + ], + "description": "The amount of time scroll contexts were held open. For example: `2m`.", + "name": "search.scroll_time" + }, + { + "aliases": [ + "scto", + "searchScrollTotal" + ], + "description": "The number of completed scroll contexts.", + "name": "search.scroll_total" + }, + { + "aliases": [ + "sc", + "segmentsCount" + ], + "description": "The number of segments.", + "name": "segments.count" + }, + { + "aliases": [ + "sfbm", + "fixedBitsetMemory" + ], + "description": "The memory used by fixed bit sets for nested object field types and type filters for types referred in join fields.\nFor example: `1.0kb`.", + "name": "segments.fixed_bitset_memory" + }, + { + "aliases": [ + "siwm", + "segmentsIndexWriterMemory" + ], + "description": "The memory used by the index writer. For example: `18mb`.", + "name": "segments.index_writer_memory" + }, + { + "aliases": [ + "sm", + "segmentsMemory" + ], + "description": "The memory used by segments. For example: `1.4kb`.", + "name": "segments.memory" + }, + { + "aliases": [ + "svmm", + "segmentsVersionMapMemory" + ], + "description": "The memory used by the version map. For example: `1.0kb`.", + "name": "segments.version_map_memory" + }, + { + "aliases": [ + "sstc", + "shards", + "shardStatsTotalCount" + ], + "description": "The number of shards assigned.", + "name": "shard_stats.total_count" + }, + { + "aliases": [ + "suc", + "suggestCurrent" + ], + "description": "The number of current suggest operations.", + "name": "suggest.current" + }, + { + "aliases": [ + "suti", + "suggestTime" + ], + "description": "The time spent in suggest operations.", + "name": "suggest.time" + }, + { + "aliases": [ + "suto", + "suggestTotal" + ], + "description": "The number of suggest operations.", + "name": "suggest.total" + }, + { + "aliases": [ + "u" + ], + "description": "The amount of node uptime. For example: `17.3m`.", + "name": "uptime" + }, + { + "aliases": [ + "v" + ], + "description": "The Elasticsearch version. For example: `9.0.0`.", + "name": "version" + } + ], + "name": { + "name": "CatNodeColumn", + "namespace": "cat._types" + }, + "specLocation": "cat/_types/CatBase.ts#L560-L1011" + }, + { + "kind": "type_alias", + "name": { + "name": "CatNodeColumns", + "namespace": "cat._types" + }, + "specLocation": "cat/_types/CatBase.ts#L1015-L1015", + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "CatNodeColumn", + "namespace": "cat._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "CatNodeColumn", + "namespace": "cat._types" + } + } + } + ] + } + }, { "kind": "interface", "attachedBehaviors": [ @@ -95227,7 +95964,7 @@ "name": "CatTrainedModelsColumn", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L561-L635" + "specLocation": "cat/_types/CatBase.ts#L1017-L1091" }, { "kind": "type_alias", @@ -95235,7 +95972,7 @@ "name": "CatTrainedModelsColumns", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L636-L638", + "specLocation": "cat/_types/CatBase.ts#L1092-L1094", "type": { "kind": "union_of", "items": [ @@ -95501,7 +96238,7 @@ "name": "CatTransformColumn", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L640-L844" + "specLocation": "cat/_types/CatBase.ts#L1096-L1300" }, { "kind": "type_alias", @@ -95509,7 +96246,7 @@ "name": "CatTransformColumns", "namespace": "cat._types" }, - "specLocation": "cat/_types/CatBase.ts#L845-L845", + "specLocation": "cat/_types/CatBase.ts#L1301-L1301", "type": { "kind": "union_of", "items": [ @@ -103694,19 +104431,20 @@ } }, { - "description": "List of columns to appear in the response. Supports simple wildcards.", + "description": "A comma-separated list of columns names to display.\nIt supports simple wildcards.", "name": "h", "required": false, + "serverDefault": "ip,hp,rp,r,m,n,cpu,l", "type": { "kind": "instance_of", "type": { - "name": "Names", - "namespace": "_types" + "name": "CatNodeColumns", + "namespace": "cat._types" } } }, { - "description": "List of columns that determine how the table should be sorted.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name.", + "description": "A comma-separated list of column names or aliases that determines the sort order.\nSorting defaults to ascending and can be changed by setting `:asc`\nor `:desc` as a suffix to the column name.", "name": "s", "required": false, "type": { @@ -103718,7 +104456,7 @@ } }, { - "description": "Period to wait for a connection to the master node.", + "description": "The period to wait for a connection to the master node.", "name": "master_timeout", "required": false, "serverDefault": "30s", @@ -103731,7 +104469,7 @@ } }, { - "description": "Unit used to display time values.", + "description": "The unit used to display time values.", "name": "time", "required": false, "type": { @@ -103743,7 +104481,7 @@ } } ], - "specLocation": "cat/nodes/CatNodesRequest.ts#L24-L77" + "specLocation": "cat/nodes/CatNodesRequest.ts#L24-L79" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 16c0cfc99d..532d749514 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -7026,6 +7026,10 @@ export type CatCatDfaColumn = 'assignment_explanation' | 'ae' | 'create_time' | export type CatCatDfaColumns = CatCatDfaColumn | CatCatDfaColumn[] +export type CatCatNodeColumn = 'build' | 'b' | 'completion.size' | 'cs' | 'completionSize' | 'cpu' | 'disk.avail' | 'd' | 'disk' | 'diskAvail' | 'disk.total' | 'dt' | 'diskTotal' | 'disk.used' | 'du' | 'diskUsed' | 'disk.used_percent' | 'dup' | 'diskUsedPercent' | 'fielddata.evictions' | 'fe' | 'fielddataEvictions' | 'fielddata.memory_size' | 'fm' | 'fielddataMemory' | 'file_desc.current' | 'fdc' | 'fileDescriptorCurrent' | 'file_desc.max' | 'fdm' | 'fileDescriptorMax' | 'file_desc.percent' | 'fdp' | 'fileDescriptorPercent' | 'flush.total' | 'ft' | 'flushTotal' | 'flush.total_time' | 'ftt' | 'flushTotalTime' | 'get.current' | 'gc' | 'getCurrent' | 'get.exists_time' | 'geti' | 'getExistsTime' | 'get.exists_total' | 'geto' | 'getExistsTotal' | 'get.missing_time' | 'gmti' | 'getMissingTime' | 'get.missing_total' | 'gmto' | 'getMissingTotal' | 'get.time' | 'gti' | 'getTime' | 'get.total' | 'gto' | 'getTotal' | 'heap.current' | 'hc' | 'heapCurrent' | 'heap.max' | 'hm' | 'heapMax' | 'heap.percent' | 'hp' | 'heapPercent' | 'http_address' | 'http' | 'id' | 'nodeId' | 'indexing.delete_current' | 'idc' | 'indexingDeleteCurrent' | 'indexing.delete_time' | 'idti' | 'indexingDeleteTime' | 'indexing.delete_total' | 'idto' | 'indexingDeleteTotal' | 'indexing.index_current' | 'iic' | 'indexingIndexCurrent' | 'indexing.index_failed' | 'iif' | 'indexingIndexFailed' | 'indexing.index_failed_due_to_version_conflict' | 'iifvc' | 'indexingIndexFailedDueToVersionConflict' | 'indexing.index_time' | 'iiti' | 'indexingIndexTime' | 'indexing.index_total' | 'iito' | 'indexingIndexTotal' | 'ip' | 'i' | 'jdk' | 'j' | 'load_1m' | 'l' | 'load_5m' | 'l' | 'load_15m' | 'l' | 'mappings.total_count' | 'mtc' | 'mappingsTotalCount' | 'mappings.total_estimated_overhead_in_bytes' | 'mteo' | 'mappingsTotalEstimatedOverheadInBytes' | 'master' | 'm' | 'merges.current' | 'mc' | 'mergesCurrent' | 'merges.current_docs' | 'mcd' | 'mergesCurrentDocs' | 'merges.current_size' | 'mcs' | 'mergesCurrentSize' | 'merges.total' | 'mt' | 'mergesTotal' | 'merges.total_docs' | 'mtd' | 'mergesTotalDocs' | 'merges.total_size' | 'mts' | 'mergesTotalSize' | 'merges.total_time' | 'mtt' | 'mergesTotalTime' | 'name' | 'n' | 'node.role' | 'r' | 'role' | 'nodeRole' | 'pid' | 'p' | 'port' | 'po' | 'query_cache.memory_size' | 'qcm' | 'queryCacheMemory' | 'query_cache.evictions' | 'qce' | 'queryCacheEvictions' | 'query_cache.hit_count' | 'qchc' | 'queryCacheHitCount' | 'query_cache.miss_count' | 'qcmc' | 'queryCacheMissCount' | 'ram.current' | 'rc' | 'ramCurrent' | 'ram.max' | 'rm' | 'ramMax' | 'ram.percent' | 'rp' | 'ramPercent' | 'refresh.total' | 'rto' | 'refreshTotal' | 'refresh.time' | 'rti' | 'refreshTime' | 'request_cache.memory_size' | 'rcm' | 'requestCacheMemory' | 'request_cache.evictions' | 'rce' | 'requestCacheEvictions' | 'request_cache.hit_count' | 'rchc' | 'requestCacheHitCount' | 'request_cache.miss_count' | 'rcmc' | 'requestCacheMissCount' | 'script.compilations' | 'scrcc' | 'scriptCompilations' | 'script.cache_evictions' | 'scrce' | 'scriptCacheEvictions' | 'search.fetch_current' | 'sfc' | 'searchFetchCurrent' | 'search.fetch_time' | 'sfti' | 'searchFetchTime' | 'search.fetch_total' | 'sfto' | 'searchFetchTotal' | 'search.open_contexts' | 'so' | 'searchOpenContexts' | 'search.query_current' | 'sqc' | 'searchQueryCurrent' | 'search.query_time' | 'sqti' | 'searchQueryTime' | 'search.query_total' | 'sqto' | 'searchQueryTotal' | 'search.scroll_current' | 'scc' | 'searchScrollCurrent' | 'search.scroll_time' | 'scti' | 'searchScrollTime' | 'search.scroll_total' | 'scto' | 'searchScrollTotal' | 'segments.count' | 'sc' | 'segmentsCount' | 'segments.fixed_bitset_memory' | 'sfbm' | 'fixedBitsetMemory' | 'segments.index_writer_memory' | 'siwm' | 'segmentsIndexWriterMemory' | 'segments.memory' | 'sm' | 'segmentsMemory' | 'segments.version_map_memory' | 'svmm' | 'segmentsVersionMapMemory' | 'shard_stats.total_count' | 'sstc' | 'shards' | 'shardStatsTotalCount' | 'suggest.current' | 'suc' | 'suggestCurrent' | 'suggest.time' | 'suti' | 'suggestTime' | 'suggest.total' | 'suto' | 'suggestTotal' | 'uptime' | 'u' | 'version' | 'v' + +export type CatCatNodeColumns = CatCatNodeColumn | CatCatNodeColumn[] + export interface CatCatRequestBase extends RequestBase, SpecUtilsCommonCatQueryParameters { } @@ -8215,7 +8219,7 @@ export interface CatNodesRequest extends CatCatRequestBase { bytes?: Bytes full_id?: boolean | string include_unloaded_segments?: boolean - h?: Names + h?: CatCatNodeColumns s?: Names master_timeout?: Duration time?: TimeUnit diff --git a/specification/cat/_types/CatBase.ts b/specification/cat/_types/CatBase.ts index 3517171226..7f019d591f 100644 --- a/specification/cat/_types/CatBase.ts +++ b/specification/cat/_types/CatBase.ts @@ -469,6 +469,7 @@ export enum CatDatafeedColumn { */ s } + export enum CatDfaColumn { /** * Contains messages relating to the selection of a node. @@ -555,8 +556,463 @@ export enum CatDfaColumn { */ version } + +export enum CatNodeColumn { + /** + * The Elasticsearch build hash. For example: `5c03844`. + * @aliases b + */ + build, + /** + * The size of completion. For example: `0b`. + * @aliases cs, completionSize + */ + 'completion.size', + /** + * The percentage of recent system CPU used. + */ + cpu, + /** + * The available disk space. For example: `198.4gb`. + * @aliases d, disk, diskAvail + */ + 'disk.avail', + /** + * The total disk space. For example: `458.3gb`. + * @aliases dt, diskTotal + */ + 'disk.total', + /** + * The used disk space. For example: `259.8gb`. + * @aliases du, diskUsed + */ + 'disk.used', + /** + * The percentage of disk space used. + * @aliases dup, diskUsedPercent + */ + 'disk.used_percent', + /** + * The number of fielddata cache evictions. + * @aliases fe, fielddataEvictions + */ + 'fielddata.evictions', + /** + * The fielddata cache memory used. For example: `0b`. + * @aliases fm, fielddataMemory + */ + 'fielddata.memory_size', + /** + * The number of file descriptors used. + * @aliases fdc, fileDescriptorCurrent + */ + 'file_desc.current', + /** + * The maximum number of file descriptors. + * @aliases fdm, fileDescriptorMax + */ + 'file_desc.max', + /** + * The percentage of file descriptors used. + * @aliases fdp, fileDescriptorPercent + */ + 'file_desc.percent', + /** + * The number of flushes. + * @aliases ft, flushTotal + */ + 'flush.total', + /** + * The amount of time spent in flush. + * @aliases ftt, flushTotalTime + */ + 'flush.total_time', + /** + * The number of current get operations. + * @aliases gc, getCurrent + */ + 'get.current', + /** + * The time spent in successful get operations. For example: `14ms`. + * @aliases geti, getExistsTime + */ + 'get.exists_time', + /** + * The number of successful get operations. + * @aliases geto, getExistsTotal + */ + 'get.exists_total', + /** + * The time spent in failed get operations. For example: `0s`. + * @aliases gmti, getMissingTime + */ + 'get.missing_time', + /** + * The number of failed get operations. + * @aliases gmto, getMissingTotal + */ + 'get.missing_total', + /** + * The amount of time spent in get operations. For example: `14ms`. + * @aliases gti, getTime + */ + 'get.time', + /** + * The number of get operations. + * @aliases gto, getTotal + */ + 'get.total', + /** + * The used heap size. For example: `311.2mb`. + * @aliases hc, heapCurrent + */ + 'heap.current', + /** + * The total heap size. For example: `4gb`. + * @aliases hm, heapMax + */ + 'heap.max', + /** + * The used percentage of total allocated Elasticsearch JVM heap. + * This value reflects only the Elasticsearch process running within the operating system and is the most direct indicator of its JVM, heap, or memory resource performance. + * @aliases hp, heapPercent + */ + 'heap.percent', + /** + * The bound HTTP address. + * @aliases http + */ + 'http_address', + /** + * The identifier for the node. + * @aliases nodeId + */ + id, + /** + * The number of current deletion operations. + * @aliases idc, indexingDeleteCurrent + */ + 'indexing.delete_current', + /** + * The time spent in deletion operations. For example: `2ms`. + * @aliases idti, indexingDeleteTime + */ + 'indexing.delete_time', + /** + * The number of deletion operations. + * @aliases idto, indexingDeleteTotal + */ + 'indexing.delete_total', + /** + * The number of current indexing operations. + * @aliases iic, indexingIndexCurrent + */ + 'indexing.index_current', + /** + * The number of failed indexing operations. + * @aliases iif, indexingIndexFailed + */ + 'indexing.index_failed', + /** + * The number of indexing operations that failed due to version conflict. + * @aliases iifvc, indexingIndexFailedDueToVersionConflict + */ + 'indexing.index_failed_due_to_version_conflict', + /** + * The time spent in indexing operations. For example: `134ms`. + * @aliases iiti, indexingIndexTime + */ + 'indexing.index_time', + /** + * The number of indexing operations. + * @aliases iito, indexingIndexTotal + */ + 'indexing.index_total', + /** + * The IP address. + * @aliases i + */ + ip, + /** + * The Java version. For example: `1.8.0`. + * @aliases j + */ + jdk, + /** + * The most recent load average. For example: `0.22`. + * @aliases l + */ + 'load_1m', + /** + * The load average for the last five minutes. For example: `0.78`. + * @aliases l + */ + 'load_5m', + /** + * The load average for the last fifteen minutes. For example: `1.24`. + * @aliases l + */ + 'load_15m', + /** + * The number of mappings, including runtime and object fields. + * @aliases mtc, mappingsTotalCount + */ + 'mappings.total_count', + /** + * The estimated heap overhead, in bytes, of mappings on this node, which allows for 1KiB of heap for every mapped field. + * @aliases mteo, mappingsTotalEstimatedOverheadInBytes + */ + 'mappings.total_estimated_overhead_in_bytes', + /** + * Indicates whether the node is the elected master node. + * Returned values include `*` (elected master) and `-` (not elected master). + * @aliases m + */ + master, + /** + * The number of current merge operations. + * @aliases mc, mergesCurrent + */ + 'merges.current', + /** + * The number of current merging documents. + * @aliases mcd, mergesCurrentDocs + */ + 'merges.current_docs', + /** + * The size of current merges. For example: `0b`. + * @aliases mcs, mergesCurrentSize + */ + 'merges.current_size', + /** + * The number of completed merge operations. + * @aliases mt, mergesTotal + */ + 'merges.total', + /** + * The number of merged documents. + * @aliases mtd, mergesTotalDocs + */ + 'merges.total_docs', + /** + * The total size of merges. For example: `0b`. + * @aliases mts, mergesTotalSize + */ + 'merges.total_size', + /** + * The time spent merging documents. For example: `0s`. + * @aliases mtt, mergesTotalTime + */ + 'merges.total_time', + /** + * The node name. + * @aliases n + */ + name, + /** + * The roles of the node. + * Returned values include `c` (cold node), `d` (data node), `f` (frozen node), `h` (hot node), `i` (ingest node), `l` (machine learning node), `m` (master-eligible node), `r` (remote cluster client node), `s` (content node), `t` (transform node), `v` (voting-only node), `w` (warm node), and `-` (coordinating node only). + * For example, `dim` indicates a master-eligible data and ingest node. + * @aliases r, role, nodeRole + */ + 'node.role', + /** + * The process identifier. + * @aliases p + */ + pid, + /** + * The bound transport port number. + * @aliases po + */ + port, + /** + * The used query cache memory. For example: `0b`. + * @aliases qcm, queryCacheMemory + */ + 'query_cache.memory_size', + /** + * The number of query cache evictions. + * @aliases qce, queryCacheEvictions + */ + 'query_cache.evictions', + /** + * The query cache hit count. + * @aliases qchc, queryCacheHitCount + */ + 'query_cache.hit_count', + /** + * The query cache miss count. + * @aliases qcmc, queryCacheMissCount + */ + 'query_cache.miss_count', + /** + * The used total memory. For example: `513.4mb`. + * @aliases rc, ramCurrent + */ + 'ram.current', + /** + * The total memory. For example: `2.9gb`. + * @aliases rm, ramMax + */ + 'ram.max', + /** + * The used percentage of the total operating system memory. + * This reflects all processes running on the operating system instead of only Elasticsearch and is not guaranteed to correlate to its performance. + * @aliases rp, ramPercent + */ + 'ram.percent', + /** + * The number of refresh operations. + * @aliases rto, refreshTotal + */ + 'refresh.total', + /** + * The time spent in refresh operations. For example: `91ms`. + * @aliases rti, refreshTime + */ + 'refresh.time', + /** + * The used request cache memory. For example: `0b`. + * @aliases rcm, requestCacheMemory + */ + 'request_cache.memory_size', + /** + * The number of request cache evictions. + * @aliases rce, requestCacheEvictions + */ + 'request_cache.evictions', + /** + * The request cache hit count. + * @aliases rchc, requestCacheHitCount + */ + 'request_cache.hit_count', + /** + * The request cache miss count. + * @aliases rcmc, requestCacheMissCount + */ + 'request_cache.miss_count', + /** + * The number of total script compilations. + * @aliases scrcc, scriptCompilations + */ + 'script.compilations', + /** + * The number of total compiled scripts evicted from cache. + * @aliases scrce, scriptCacheEvictions + */ + 'script.cache_evictions', + /** + * The number of current fetch phase operations. + * @aliases sfc, searchFetchCurrent + */ + 'search.fetch_current', + /** + * The time spent in fetch phase. For example: `37ms`. + * @aliases sfti, searchFetchTime + */ + 'search.fetch_time', + /** + * The number of fetch operations. + * @aliases sfto, searchFetchTotal + */ + 'search.fetch_total', + /** + * The number of open search contexts. + * @aliases so, searchOpenContexts + */ + 'search.open_contexts', + /** + * The number of current query phase operations. + * @aliases sqc, searchQueryCurrent + */ + 'search.query_current', + /** + * The time spent in query phase. For example: `43ms`. + * @aliases sqti, searchQueryTime + */ + 'search.query_time', + /** + * The number of query operations. + * @aliases sqto, searchQueryTotal + */ + 'search.query_total', + /** + * The number of open scroll contexts. + * @aliases scc, searchScrollCurrent + */ + 'search.scroll_current', + /** + * The amount of time scroll contexts were held open. For example: `2m`. + * @aliases scti, searchScrollTime + */ + 'search.scroll_time', + /** + * The number of completed scroll contexts. + * @aliases scto, searchScrollTotal + */ + 'search.scroll_total', + /** + * The number of segments. + * @aliases sc, segmentsCount + */ + 'segments.count', + /** + * The memory used by fixed bit sets for nested object field types and type filters for types referred in join fields. + * For example: `1.0kb`. + * @aliases sfbm, fixedBitsetMemory + */ + 'segments.fixed_bitset_memory', + /** + * The memory used by the index writer. For example: `18mb`. + * @aliases siwm, segmentsIndexWriterMemory + */ + 'segments.index_writer_memory', + /** + * The memory used by segments. For example: `1.4kb`. + * @aliases sm, segmentsMemory + */ + 'segments.memory', + /** + * The memory used by the version map. For example: `1.0kb`. + * @aliases svmm, segmentsVersionMapMemory + */ + 'segments.version_map_memory', + /** + * The number of shards assigned. + * @aliases sstc, shards, shardStatsTotalCount + */ + 'shard_stats.total_count', + /** + * The number of current suggest operations. + * @aliases suc, suggestCurrent + */ + 'suggest.current', + /** + * The time spent in suggest operations. + * @aliases suti, suggestTime + */ + 'suggest.time', + /** + * The number of suggest operations. + * @aliases suto, suggestTotal + */ + 'suggest.total', + /** + * The amount of node uptime. For example: `17.3m`. + * @aliases u + */ + uptime, + /** + * The Elasticsearch version. For example: `9.0.0`. + * @aliases v + */ + version +} + export type CatDfaColumns = CatDfaColumn | CatDfaColumn[] export type CatDatafeedColumns = CatDatafeedColumn | CatDatafeedColumn[] +export type CatNodeColumns = CatNodeColumn | CatNodeColumn[] export enum CatTrainedModelsColumn { /** diff --git a/specification/cat/nodes/CatNodesRequest.ts b/specification/cat/nodes/CatNodesRequest.ts index 00520a2566..096d56c51a 100644 --- a/specification/cat/nodes/CatNodesRequest.ts +++ b/specification/cat/nodes/CatNodesRequest.ts @@ -17,7 +17,7 @@ * under the License. */ -import { CatRequestBase } from '@cat/_types/CatBase' +import { CatNodeColumns, CatRequestBase } from '@cat/_types/CatBase' import { Bytes, Names } from '@_types/common' import { Duration, TimeUnit } from '@_types/Time' @@ -55,22 +55,24 @@ export interface Request extends CatRequestBase { */ include_unloaded_segments?: boolean /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. + * It supports simple wildcards. + * @server_default ip,hp,rp,r,m,n,cpu,l */ - h?: Names + h?: CatNodeColumns /** - * List of columns that determine how the table should be sorted. + * A comma-separated list of column names or aliases that determines the sort order. * Sorting defaults to ascending and can be changed by setting `:asc` * or `:desc` as a suffix to the column name. */ s?: Names /** - * Period to wait for a connection to the master node. + * The period to wait for a connection to the master node. * @server_default 30s */ master_timeout?: Duration /** - * Unit used to display time values. + * The unit used to display time values. */ time?: TimeUnit } From dd702c4815f8868d4ff7524440134857916922de Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 6 May 2025 09:44:05 -0700 Subject: [PATCH 2/2] Regenerate output --- output/openapi/elasticsearch-openapi.json | 30 ++- .../elasticsearch-serverless-openapi.json | 28 ++- output/schema/schema.json | 185 ++++++++++-------- 3 files changed, 157 insertions(+), 86 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index d96bf9948d..0c01a7895f 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -1937,7 +1937,7 @@ { "in": "query", "name": "h", - "description": "A comma-separated list of columns names to display.\nIt supports simple wildcards.", + "description": "A comma-separated list of columns names to display.\nIt supports simple wildcards.\n\nSupported values include:\n - `build` (or `b`): The Elasticsearch build hash. For example: `5c03844`.\n - `completion.size` (or `cs`, `completionSize`): The size of completion. For example: `0b`.\n - `cpu`: The percentage of recent system CPU used.\n - `disk.avail` (or `d`, `disk`, `diskAvail`): The available disk space. For example: `198.4gb`.\n - `disk.total` (or `dt`, `diskTotal`): The total disk space. For example: `458.3gb`.\n - `disk.used` (or `du`, `diskUsed`): The used disk space. For example: `259.8gb`.\n - `disk.used_percent` (or `dup`, `diskUsedPercent`): The percentage of disk space used.\n - `fielddata.evictions` (or `fe`, `fielddataEvictions`): The number of fielddata cache evictions.\n - `fielddata.memory_size` (or `fm`, `fielddataMemory`): The fielddata cache memory used. For example: `0b`.\n - `file_desc.current` (or `fdc`, `fileDescriptorCurrent`): The number of file descriptors used.\n - `file_desc.max` (or `fdm`, `fileDescriptorMax`): The maximum number of file descriptors.\n - `file_desc.percent` (or `fdp`, `fileDescriptorPercent`): The percentage of file descriptors used.\n - `flush.total` (or `ft`, `flushTotal`): The number of flushes.\n - `flush.total_time` (or `ftt`, `flushTotalTime`): The amount of time spent in flush.\n - `get.current` (or `gc`, `getCurrent`): The number of current get operations.\n - `get.exists_time` (or `geti`, `getExistsTime`): The time spent in successful get operations. For example: `14ms`.\n - `get.exists_total` (or `geto`, `getExistsTotal`): The number of successful get operations.\n - `get.missing_time` (or `gmti`, `getMissingTime`): The time spent in failed get operations. For example: `0s`.\n - `get.missing_total` (or `gmto`, `getMissingTotal`): The number of failed get operations.\n - `get.time` (or `gti`, `getTime`): The amount of time spent in get operations. For example: `14ms`.\n - `get.total` (or `gto`, `getTotal`): The number of get operations.\n - `heap.current` (or `hc`, `heapCurrent`): The used heap size. For example: `311.2mb`.\n - `heap.max` (or `hm`, `heapMax`): The total heap size. For example: `4gb`.\n - `heap.percent` (or `hp`, `heapPercent`): The used percentage of total allocated Elasticsearch JVM heap.\nThis value reflects only the Elasticsearch process running within the operating system and is the most direct indicator of its JVM, heap, or memory resource performance.\n - `http_address` (or `http`): The bound HTTP address.\n - `id` (or `nodeId`): The identifier for the node.\n - `indexing.delete_current` (or `idc`, `indexingDeleteCurrent`): The number of current deletion operations.\n - `indexing.delete_time` (or `idti`, `indexingDeleteTime`): The time spent in deletion operations. For example: `2ms`.\n - `indexing.delete_total` (or `idto`, `indexingDeleteTotal`): The number of deletion operations.\n - `indexing.index_current` (or `iic`, `indexingIndexCurrent`): The number of current indexing operations.\n - `indexing.index_failed` (or `iif`, `indexingIndexFailed`): The number of failed indexing operations.\n - `indexing.index_failed_due_to_version_conflict` (or `iifvc`, `indexingIndexFailedDueToVersionConflict`): The number of indexing operations that failed due to version conflict.\n - `indexing.index_time` (or `iiti`, `indexingIndexTime`): The time spent in indexing operations. For example: `134ms`.\n - `indexing.index_total` (or `iito`, `indexingIndexTotal`): The number of indexing operations.\n - `ip` (or `i`): The IP address.\n - `jdk` (or `j`): The Java version. For example: `1.8.0`.\n - `load_1m` (or `l`): The most recent load average. For example: `0.22`.\n - `load_5m` (or `l`): The load average for the last five minutes. For example: `0.78`.\n - `load_15m` (or `l`): The load average for the last fifteen minutes. For example: `1.24`.\n - `mappings.total_count` (or `mtc`, `mappingsTotalCount`): The number of mappings, including runtime and object fields.\n - `mappings.total_estimated_overhead_in_bytes` (or `mteo`, `mappingsTotalEstimatedOverheadInBytes`): The estimated heap overhead, in bytes, of mappings on this node, which allows for 1KiB of heap for every mapped field.\n - `master` (or `m`): Indicates whether the node is the elected master node.\nReturned values include `*` (elected master) and `-` (not elected master).\n - `merges.current` (or `mc`, `mergesCurrent`): The number of current merge operations.\n - `merges.current_docs` (or `mcd`, `mergesCurrentDocs`): The number of current merging documents.\n - `merges.current_size` (or `mcs`, `mergesCurrentSize`): The size of current merges. For example: `0b`.\n - `merges.total` (or `mt`, `mergesTotal`): The number of completed merge operations.\n - `merges.total_docs` (or `mtd`, `mergesTotalDocs`): The number of merged documents.\n - `merges.total_size` (or `mts`, `mergesTotalSize`): The total size of merges. For example: `0b`.\n - `merges.total_time` (or `mtt`, `mergesTotalTime`): The time spent merging documents. For example: `0s`.\n - `name` (or `n`): The node name.\n - `node.role` (or `r`, `role`, `nodeRole`): The roles of the node.\nReturned values include `c` (cold node), `d` (data node), `f` (frozen node), `h` (hot node), `i` (ingest node), `l` (machine learning node), `m` (master-eligible node), `r` (remote cluster client node), `s` (content node), `t` (transform node), `v` (voting-only node), `w` (warm node), and `-` (coordinating node only).\nFor example, `dim` indicates a master-eligible data and ingest node.\n - `pid` (or `p`): The process identifier.\n - `port` (or `po`): The bound transport port number.\n - `query_cache.memory_size` (or `qcm`, `queryCacheMemory`): The used query cache memory. For example: `0b`.\n - `query_cache.evictions` (or `qce`, `queryCacheEvictions`): The number of query cache evictions.\n - `query_cache.hit_count` (or `qchc`, `queryCacheHitCount`): The query cache hit count.\n - `query_cache.miss_count` (or `qcmc`, `queryCacheMissCount`): The query cache miss count.\n - `ram.current` (or `rc`, `ramCurrent`): The used total memory. For example: `513.4mb`.\n - `ram.max` (or `rm`, `ramMax`): The total memory. For example: `2.9gb`.\n - `ram.percent` (or `rp`, `ramPercent`): The used percentage of the total operating system memory.\nThis reflects all processes running on the operating system instead of only Elasticsearch and is not guaranteed to correlate to its performance.\n - `refresh.total` (or `rto`, `refreshTotal`): The number of refresh operations.\n - `refresh.time` (or `rti`, `refreshTime`): The time spent in refresh operations. For example: `91ms`.\n - `request_cache.memory_size` (or `rcm`, `requestCacheMemory`): The used request cache memory. For example: `0b`.\n - `request_cache.evictions` (or `rce`, `requestCacheEvictions`): The number of request cache evictions.\n - `request_cache.hit_count` (or `rchc`, `requestCacheHitCount`): The request cache hit count.\n - `request_cache.miss_count` (or `rcmc`, `requestCacheMissCount`): The request cache miss count.\n - `script.compilations` (or `scrcc`, `scriptCompilations`): The number of total script compilations.\n - `script.cache_evictions` (or `scrce`, `scriptCacheEvictions`): The number of total compiled scripts evicted from cache.\n - `search.fetch_current` (or `sfc`, `searchFetchCurrent`): The number of current fetch phase operations.\n - `search.fetch_time` (or `sfti`, `searchFetchTime`): The time spent in fetch phase. For example: `37ms`.\n - `search.fetch_total` (or `sfto`, `searchFetchTotal`): The number of fetch operations.\n - `search.open_contexts` (or `so`, `searchOpenContexts`): The number of open search contexts.\n - `search.query_current` (or `sqc`, `searchQueryCurrent`): The number of current query phase operations.\n - `search.query_time` (or `sqti`, `searchQueryTime`): The time spent in query phase. For example: `43ms`.\n - `search.query_total` (or `sqto`, `searchQueryTotal`): The number of query operations.\n - `search.scroll_current` (or `scc`, `searchScrollCurrent`): The number of open scroll contexts.\n - `search.scroll_time` (or `scti`, `searchScrollTime`): The amount of time scroll contexts were held open. For example: `2m`.\n - `search.scroll_total` (or `scto`, `searchScrollTotal`): The number of completed scroll contexts.\n - `segments.count` (or `sc`, `segmentsCount`): The number of segments.\n - `segments.fixed_bitset_memory` (or `sfbm`, `fixedBitsetMemory`): The memory used by fixed bit sets for nested object field types and type filters for types referred in join fields.\nFor example: `1.0kb`.\n - `segments.index_writer_memory` (or `siwm`, `segmentsIndexWriterMemory`): The memory used by the index writer. For example: `18mb`.\n - `segments.memory` (or `sm`, `segmentsMemory`): The memory used by segments. For example: `1.4kb`.\n - `segments.version_map_memory` (or `svmm`, `segmentsVersionMapMemory`): The memory used by the version map. For example: `1.0kb`.\n - `shard_stats.total_count` (or `sstc`, `shards`, `shardStatsTotalCount`): The number of shards assigned.\n - `suggest.current` (or `suc`, `suggestCurrent`): The number of current suggest operations.\n - `suggest.time` (or `suti`, `suggestTime`): The time spent in suggest operations.\n - `suggest.total` (or `suto`, `suggestTotal`): The number of suggest operations.\n - `uptime` (or `u`): The amount of node uptime. For example: `17.3m`.\n - `version` (or `v`): The Elasticsearch version. For example: `9.0.0`.\n\n", "deprecated": false, "schema": { "$ref": "#/components/schemas/cat._types.CatNodeColumns" @@ -17301,7 +17301,8 @@ "tags": [ "inference" ], - "summary": "Perform chat completion inference", + "summary": "Perform chat completion inference\n", + "description": "The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. \nIt only works with the `chat_completion` task type for `openai` and `elastic` inference services.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nNOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.\nThe Chat completion inference API and the Stream inference API differ in their response structure and capabilities.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nIf you use the `openai` service or the `elastic` service, use the Chat completion inference API.", "operationId": "inference-chat-completion-unified", "parameters": [ { @@ -17331,6 +17332,23 @@ "application/json": { "schema": { "$ref": "#/components/schemas/inference._types.RequestChatCompletion" + }, + "examples": { + "PostChatCompletionRequestExample1": { + "summary": "A chat completion task", + "description": "Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion on the example question with streaming.", + "value": "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample2": { + "summary": "A chat completion task with tool_calls", + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using an Assistant message with `tool_calls`.", + "value": "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample3": { + "summary": "A chat completion task with tools and tool_calls", + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using a User message with `tools` and `tool_choice`.", + "value": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" + } } } }, @@ -17343,6 +17361,12 @@ "application/json": { "schema": { "$ref": "#/components/schemas/_types.StreamResult" + }, + "examples": { + "PostChatCompletionResponseExample1": { + "description": "A successful response when performing a chat completion task using a User message with `tools` and `tool_choice`.", + "value": "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":Elastic\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\" is\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44}}} \n\nevent: message\ndata: [DONE]" + } } } } @@ -78942,7 +78966,7 @@ "type": "object", "properties": { "messages": { - "description": "A list of objects representing the conversation.", + "description": "A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.", "type": "array", "items": { "$ref": "#/components/schemas/inference._types.Message" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f04be6cab7..2769715f84 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -9234,7 +9234,8 @@ "tags": [ "inference" ], - "summary": "Perform chat completion inference", + "summary": "Perform chat completion inference\n", + "description": "The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. \nIt only works with the `chat_completion` task type for `openai` and `elastic` inference services.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nNOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.\nThe Chat completion inference API and the Stream inference API differ in their response structure and capabilities.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nIf you use the `openai` service or the `elastic` service, use the Chat completion inference API.", "operationId": "inference-chat-completion-unified", "parameters": [ { @@ -9264,6 +9265,23 @@ "application/json": { "schema": { "$ref": "#/components/schemas/inference._types.RequestChatCompletion" + }, + "examples": { + "PostChatCompletionRequestExample1": { + "summary": "A chat completion task", + "description": "Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion on the example question with streaming.", + "value": "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample2": { + "summary": "A chat completion task with tool_calls", + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using an Assistant message with `tool_calls`.", + "value": "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample3": { + "summary": "A chat completion task with tools and tool_calls", + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using a User message with `tools` and `tool_choice`.", + "value": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" + } } } }, @@ -9276,6 +9294,12 @@ "application/json": { "schema": { "$ref": "#/components/schemas/_types.StreamResult" + }, + "examples": { + "PostChatCompletionResponseExample1": { + "description": "A successful response when performing a chat completion task using a User message with `tools` and `tool_choice`.", + "value": "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":Elastic\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\" is\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44}}} \n\nevent: message\ndata: [DONE]" + } } } } @@ -50263,7 +50287,7 @@ "type": "object", "properties": { "messages": { - "description": "A list of objects representing the conversation.", + "description": "A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.", "type": "array", "items": { "$ref": "#/components/schemas/inference._types.Message" diff --git a/output/schema/schema.json b/output/schema/schema.json index 60c3e74756..a668c077f7 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9047,7 +9047,7 @@ "visibility": "public" } }, - "description": "Perform chat completion inference", + "description": "Perform chat completion inference\n\nThe chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. \nIt only works with the `chat_completion` task type for `openai` and `elastic` inference services.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nNOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.\nThe Chat completion inference API and the Stream inference API differ in their response structure and capabilities.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nIf you use the `openai` service or the `elastic` service, use the Chat completion inference API.", "docId": "inference-api-chat-completion", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-inference-unified-inference", "name": "inference.chat_completion_unified", @@ -151873,7 +151873,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L60-L77" + "specLocation": "inference/_types/CommonTypes.ts#L62-L79" }, { "kind": "interface", @@ -151945,7 +151945,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L219-L264" + "specLocation": "inference/_types/CommonTypes.ts#L221-L266" }, { "kind": "enum", @@ -151958,7 +151958,7 @@ "name": "AlibabaCloudServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L289-L291" + "specLocation": "inference/_types/CommonTypes.ts#L291-L293" }, { "kind": "interface", @@ -151992,7 +151992,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L266-L280" + "specLocation": "inference/_types/CommonTypes.ts#L268-L282" }, { "kind": "enum", @@ -152014,7 +152014,7 @@ "name": "AlibabaCloudTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L282-L287" + "specLocation": "inference/_types/CommonTypes.ts#L284-L289" }, { "kind": "interface", @@ -152102,7 +152102,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L293-L335" + "specLocation": "inference/_types/CommonTypes.ts#L295-L337" }, { "kind": "enum", @@ -152115,7 +152115,7 @@ "name": "AmazonBedrockServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L368-L370" + "specLocation": "inference/_types/CommonTypes.ts#L370-L372" }, { "kind": "interface", @@ -152174,7 +152174,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L337-L361" + "specLocation": "inference/_types/CommonTypes.ts#L339-L363" }, { "kind": "enum", @@ -152190,7 +152190,7 @@ "name": "AmazonBedrockTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L363-L366" + "specLocation": "inference/_types/CommonTypes.ts#L365-L368" }, { "kind": "interface", @@ -152237,7 +152237,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L372-L388" + "specLocation": "inference/_types/CommonTypes.ts#L374-L390" }, { "kind": "enum", @@ -152250,7 +152250,7 @@ "name": "AnthropicServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L421-L423" + "specLocation": "inference/_types/CommonTypes.ts#L423-L425" }, { "kind": "interface", @@ -152310,7 +152310,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L390-L415" + "specLocation": "inference/_types/CommonTypes.ts#L392-L417" }, { "kind": "enum", @@ -152323,7 +152323,7 @@ "name": "AnthropicTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L417-L419" + "specLocation": "inference/_types/CommonTypes.ts#L419-L421" }, { "kind": "interface", @@ -152397,7 +152397,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L425-L467" + "specLocation": "inference/_types/CommonTypes.ts#L427-L469" }, { "kind": "enum", @@ -152410,7 +152410,7 @@ "name": "AzureAiStudioServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L504-L506" + "specLocation": "inference/_types/CommonTypes.ts#L506-L508" }, { "kind": "interface", @@ -152481,7 +152481,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L469-L497" + "specLocation": "inference/_types/CommonTypes.ts#L471-L499" }, { "kind": "enum", @@ -152497,7 +152497,7 @@ "name": "AzureAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L499-L502" + "specLocation": "inference/_types/CommonTypes.ts#L501-L504" }, { "kind": "interface", @@ -152589,7 +152589,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L508-L553" + "specLocation": "inference/_types/CommonTypes.ts#L510-L555" }, { "kind": "enum", @@ -152602,7 +152602,7 @@ "name": "AzureOpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L568-L570" + "specLocation": "inference/_types/CommonTypes.ts#L570-L572" }, { "kind": "interface", @@ -152624,7 +152624,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L555-L561" + "specLocation": "inference/_types/CommonTypes.ts#L557-L563" }, { "kind": "enum", @@ -152640,7 +152640,7 @@ "name": "AzureOpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L563-L566" + "specLocation": "inference/_types/CommonTypes.ts#L565-L568" }, { "kind": "enum", @@ -152659,7 +152659,7 @@ "name": "CohereEmbeddingType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L625-L629" + "specLocation": "inference/_types/CommonTypes.ts#L627-L631" }, { "kind": "enum", @@ -152681,7 +152681,7 @@ "name": "CohereInputType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L631-L636" + "specLocation": "inference/_types/CommonTypes.ts#L633-L638" }, { "kind": "interface", @@ -152754,7 +152754,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L572-L613" + "specLocation": "inference/_types/CommonTypes.ts#L574-L615" }, { "kind": "enum", @@ -152767,7 +152767,7 @@ "name": "CohereServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L621-L623" + "specLocation": "inference/_types/CommonTypes.ts#L623-L625" }, { "kind": "enum", @@ -152786,7 +152786,7 @@ "name": "CohereSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L638-L642" + "specLocation": "inference/_types/CommonTypes.ts#L640-L644" }, { "kind": "interface", @@ -152844,7 +152844,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L650-L682" + "specLocation": "inference/_types/CommonTypes.ts#L652-L684" }, { "kind": "enum", @@ -152863,7 +152863,7 @@ "name": "CohereTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L615-L619" + "specLocation": "inference/_types/CommonTypes.ts#L617-L621" }, { "kind": "enum", @@ -152882,7 +152882,7 @@ "name": "CohereTruncateType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L644-L648" + "specLocation": "inference/_types/CommonTypes.ts#L646-L650" }, { "kind": "interface", @@ -152964,7 +152964,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L205-L217" + "specLocation": "inference/_types/CommonTypes.ts#L207-L219" }, { "kind": "interface", @@ -152999,7 +152999,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L168-L180" + "specLocation": "inference/_types/CommonTypes.ts#L170-L182" }, { "kind": "interface", @@ -153022,7 +153022,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L157-L166" + "specLocation": "inference/_types/CommonTypes.ts#L159-L168" }, { "kind": "interface", @@ -153077,7 +153077,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L182-L203" + "specLocation": "inference/_types/CommonTypes.ts#L184-L205" }, { "kind": "type_alias", @@ -153089,7 +153089,7 @@ "name": "CompletionToolType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L79-L82", + "specLocation": "inference/_types/CommonTypes.ts#L81-L84", "type": { "kind": "union_of", "items": [ @@ -153143,7 +153143,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L84-L96" + "specLocation": "inference/_types/CommonTypes.ts#L86-L98" }, { "kind": "interface", @@ -153284,7 +153284,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L704-L738" + "specLocation": "inference/_types/CommonTypes.ts#L706-L740" }, { "kind": "enum", @@ -153297,7 +153297,7 @@ "name": "ElasticsearchServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L754-L756" + "specLocation": "inference/_types/CommonTypes.ts#L756-L758" }, { "kind": "interface", @@ -153320,7 +153320,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L740-L746" + "specLocation": "inference/_types/CommonTypes.ts#L742-L748" }, { "kind": "enum", @@ -153339,7 +153339,7 @@ "name": "ElasticsearchTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L748-L752" + "specLocation": "inference/_types/CommonTypes.ts#L750-L754" }, { "kind": "interface", @@ -153385,7 +153385,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L758-L784" + "specLocation": "inference/_types/CommonTypes.ts#L760-L786" }, { "kind": "enum", @@ -153398,7 +153398,7 @@ "name": "ElserServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L790-L792" + "specLocation": "inference/_types/CommonTypes.ts#L792-L794" }, { "kind": "enum", @@ -153411,7 +153411,7 @@ "name": "ElserTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L786-L788" + "specLocation": "inference/_types/CommonTypes.ts#L788-L790" }, { "kind": "enum", @@ -153424,7 +153424,7 @@ "name": "GoogleAiServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L817-L819" + "specLocation": "inference/_types/CommonTypes.ts#L819-L821" }, { "kind": "interface", @@ -153472,7 +153472,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L794-L810" + "specLocation": "inference/_types/CommonTypes.ts#L796-L812" }, { "kind": "enum", @@ -153488,7 +153488,7 @@ "name": "GoogleAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L812-L815" + "specLocation": "inference/_types/CommonTypes.ts#L814-L817" }, { "kind": "interface", @@ -153562,7 +153562,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L821-L847" + "specLocation": "inference/_types/CommonTypes.ts#L823-L849" }, { "kind": "enum", @@ -153575,7 +153575,7 @@ "name": "GoogleVertexAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L865-L867" + "specLocation": "inference/_types/CommonTypes.ts#L867-L869" }, { "kind": "interface", @@ -153609,7 +153609,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L849-L858" + "specLocation": "inference/_types/CommonTypes.ts#L851-L860" }, { "kind": "enum", @@ -153625,7 +153625,7 @@ "name": "GoogleVertexAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L860-L863" + "specLocation": "inference/_types/CommonTypes.ts#L862-L865" }, { "kind": "interface", @@ -153673,7 +153673,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L869-L890" + "specLocation": "inference/_types/CommonTypes.ts#L871-L892" }, { "kind": "enum", @@ -153686,7 +153686,7 @@ "name": "HuggingFaceServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L896-L898" + "specLocation": "inference/_types/CommonTypes.ts#L898-L900" }, { "kind": "enum", @@ -153699,7 +153699,7 @@ "name": "HuggingFaceTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L892-L894" + "specLocation": "inference/_types/CommonTypes.ts#L894-L896" }, { "kind": "interface", @@ -154022,7 +154022,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L900-L929" + "specLocation": "inference/_types/CommonTypes.ts#L902-L931" }, { "kind": "enum", @@ -154035,7 +154035,7 @@ "name": "JinaAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L959-L961" + "specLocation": "inference/_types/CommonTypes.ts#L961-L963" }, { "kind": "enum", @@ -154054,7 +154054,7 @@ "name": "JinaAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L963-L967" + "specLocation": "inference/_types/CommonTypes.ts#L965-L969" }, { "kind": "interface", @@ -154100,7 +154100,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L931-L952" + "specLocation": "inference/_types/CommonTypes.ts#L933-L954" }, { "kind": "enum", @@ -154116,7 +154116,7 @@ "name": "JinaAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L954-L957" + "specLocation": "inference/_types/CommonTypes.ts#L956-L959" }, { "kind": "enum", @@ -154138,7 +154138,7 @@ "name": "JinaAITextEmbeddingTask", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L969-L974" + "specLocation": "inference/_types/CommonTypes.ts#L971-L976" }, { "kind": "interface", @@ -154200,7 +154200,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L135-L155" + "specLocation": "inference/_types/CommonTypes.ts#L137-L157" }, { "kind": "type_alias", @@ -154212,7 +154212,7 @@ "name": "MessageContent", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L130-L133", + "specLocation": "inference/_types/CommonTypes.ts#L132-L135", "type": { "kind": "union_of", "items": [ @@ -154296,7 +154296,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L976-L1003" + "specLocation": "inference/_types/CommonTypes.ts#L978-L1005" }, { "kind": "enum", @@ -154309,7 +154309,7 @@ "name": "MistralServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1009-L1011" + "specLocation": "inference/_types/CommonTypes.ts#L1011-L1013" }, { "kind": "enum", @@ -154322,7 +154322,7 @@ "name": "MistralTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1005-L1007" + "specLocation": "inference/_types/CommonTypes.ts#L1007-L1009" }, { "kind": "interface", @@ -154409,7 +154409,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1013-L1055" + "specLocation": "inference/_types/CommonTypes.ts#L1015-L1057" }, { "kind": "enum", @@ -154422,7 +154422,7 @@ "name": "OpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1071-L1073" + "specLocation": "inference/_types/CommonTypes.ts#L1073-L1075" }, { "kind": "interface", @@ -154444,7 +154444,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1057-L1063" + "specLocation": "inference/_types/CommonTypes.ts#L1059-L1065" }, { "kind": "enum", @@ -154463,7 +154463,7 @@ "name": "OpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1065-L1069" + "specLocation": "inference/_types/CommonTypes.ts#L1067-L1071" }, { "kind": "interface", @@ -154539,7 +154539,7 @@ }, "properties": [ { - "description": "A list of objects representing the conversation.", + "description": "A list of objects representing the conversation.\nRequests should generally only add new messages from the user (role `user`).\nThe other message roles (`assistant`, `system`, or `tool`) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation.", "name": "messages", "required": true, "type": { @@ -154644,7 +154644,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L25-L58" + "specLocation": "inference/_types/CommonTypes.ts#L25-L60" }, { "kind": "interface", @@ -154936,7 +154936,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L112-L128" + "specLocation": "inference/_types/CommonTypes.ts#L114-L130" }, { "kind": "interface", @@ -154971,7 +154971,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L98-L110" + "specLocation": "inference/_types/CommonTypes.ts#L100-L112" }, { "kind": "interface", @@ -155035,7 +155035,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1075-L1106" + "specLocation": "inference/_types/CommonTypes.ts#L1077-L1108" }, { "kind": "enum", @@ -155048,7 +155048,7 @@ "name": "VoyageAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1139-L1141" + "specLocation": "inference/_types/CommonTypes.ts#L1141-L1143" }, { "kind": "interface", @@ -155108,7 +155108,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1108-L1132" + "specLocation": "inference/_types/CommonTypes.ts#L1110-L1134" }, { "kind": "enum", @@ -155124,7 +155124,7 @@ "name": "VoyageAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1134-L1137" + "specLocation": "inference/_types/CommonTypes.ts#L1136-L1139" }, { "kind": "interface", @@ -155212,7 +155212,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1143-L1180" + "specLocation": "inference/_types/CommonTypes.ts#L1145-L1182" }, { "kind": "enum", @@ -155225,7 +155225,7 @@ "name": "WatsonxServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1186-L1188" + "specLocation": "inference/_types/CommonTypes.ts#L1188-L1190" }, { "kind": "enum", @@ -155238,7 +155238,7 @@ "name": "WatsonxTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1182-L1184" + "specLocation": "inference/_types/CommonTypes.ts#L1184-L1186" }, { "kind": "request", @@ -155256,7 +155256,24 @@ } } }, - "description": "Perform chat completion inference", + "description": "Perform chat completion inference\n\nThe chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. \nIt only works with the `chat_completion` task type for `openai` and `elastic` inference services.\n\nIMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face.\nFor built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n\nNOTE: The `chat_completion` task type is only available within the _stream API and only supports streaming.\nThe Chat completion inference API and the Stream inference API differ in their response structure and capabilities.\nThe Chat completion inference API provides more comprehensive customization options through more fields and function calling support.\nIf you use the `openai` service or the `elastic` service, use the Chat completion inference API.", + "examples": { + "PostChatCompletionRequestExample1": { + "description": "Run `POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion on the example question with streaming.", + "summary": "A chat completion task", + "value": "{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is Elastic?\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample2": { + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using an Assistant message with `tool_calls`.", + "summary": "A chat completion task with tool_calls", + "value": "{\n \"messages\": [\n {\n \"role\": \"assistant\",\n \"content\": \"Let's find out what the weather is\",\n \"tool_calls\": [ \n {\n \"id\": \"call_KcAjWtAww20AihPHphUh46Gd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_weather\",\n \"arguments\": \"{\\\"location\\\":\\\"Boston, MA\\\"}\"\n }\n }\n ]\n },\n { \n \"role\": \"tool\",\n \"content\": \"The weather is cold\",\n \"tool_call_id\": \"call_KcAjWtAww20AihPHphUh46Gd\"\n }\n ]\n}" + }, + "PostChatCompletionRequestExample3": { + "description": "Run `POST POST _inference/chat_completion/openai-completion/_stream` to perform a chat completion using a User message with `tools` and `tool_choice`.", + "summary": "A chat completion task with tools and tool_calls", + "value": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's the price of a scarf?\"\n }\n ]\n }\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\",\n \"description\": \"Get the current price of a item\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"id\": \"123\"\n }\n }\n }\n }\n }\n ],\n \"tool_choice\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_current_price\"\n }\n }\n}" + } + }, "inherits": { "type": { "name": "RequestBase", @@ -155296,7 +155313,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L24-L53" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L24-L64" }, { "kind": "response", @@ -155311,6 +155328,12 @@ } } }, + "examples": { + "PostChatCompletionResponseExample1": { + "description": "A successful response when performing a chat completion task using a User message with `tools` and `tool_choice`.", + "value": "event: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":Elastic\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[{\"delta\":{\"content\":\" is\"},\"index\":0}],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\"}}\n\n(...)\n\nevent: message\ndata: {\"chat_completion\":{\"id\":\"chatcmpl-Ae0TWsy2VPnSfBbv5UztnSdYUMFP3\",\"choices\":[],\"model\":\"gpt-4o-2024-08-06\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":28,\"prompt_tokens\":16,\"total_tokens\":44}}} \n\nevent: message\ndata: [DONE]" + } + }, "name": { "name": "Response", "namespace": "inference.chat_completion_unified"