Skip to content

Commit 3627a4c

Browse files
Auto-generated API code (#2580)
1 parent fecda56 commit 3627a4c

9 files changed

+130
-16
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_inference/chat_completion/openai-completion/_stream",
9+
body: {
10+
model: "gpt-4o",
11+
messages: [
12+
{
13+
role: "user",
14+
content: "What is Elastic?",
15+
},
16+
],
17+
},
18+
});
19+
console.log(response);
20+
----

docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc renamed to docs/doc_examples/141ef0ebaa3b0772892b79b9bb85efb0.asciidoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
[source, js]
55
----
6-
const response = await client.inference.inference({
6+
const response = await client.inference.put({
77
task_type: "my-inference-endpoint",
88
inference_id: "_update",
9-
service_settings: {
10-
api_key: "<API_KEY>",
9+
inference_config: {
10+
service_settings: {
11+
api_key: "<API_KEY>",
12+
},
1113
},
1214
});
1315
console.log(response);

docs/doc_examples/31bc93e429ad0de11dd2dd231e8f2c5e.asciidoc

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_inference/chat_completion/openai-completion/_stream",
9+
body: {
10+
messages: [
11+
{
12+
role: "user",
13+
content: [
14+
{
15+
type: "text",
16+
text: "What's the price of a scarf?",
17+
},
18+
],
19+
},
20+
],
21+
tools: [
22+
{
23+
type: "function",
24+
function: {
25+
name: "get_current_price",
26+
description: "Get the current price of a item",
27+
parameters: {
28+
type: "object",
29+
properties: {
30+
item: {
31+
id: "123",
32+
},
33+
},
34+
},
35+
},
36+
},
37+
],
38+
tool_choice: {
39+
type: "function",
40+
function: {
41+
name: "get_current_price",
42+
},
43+
},
44+
},
45+
});
46+
console.log(response);
47+
----
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "image-index",
8+
knn: {
9+
field: "image-vector",
10+
query_vector: [-5, 9, -12],
11+
k: 10,
12+
num_candidates: 100,
13+
rescore_vector: {
14+
oversample: 2,
15+
},
16+
},
17+
fields: ["title", "file-type"],
18+
});
19+
console.log(response);
20+
----

docs/doc_examples/9d47f02a063444da9f098858a1830d28.asciidoc renamed to docs/doc_examples/77cebba946fe648873a1e7375c13df41.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
----
66
const response = await client.cluster.putSettings({
77
persistent: {
8-
"cluster.routing.allocation.disk.watermark.low": "30gb",
8+
"cluster.routing.allocation.disk.watermark.low": "90%",
9+
"cluster.routing.allocation.disk.watermark.high": "95%",
910
},
1011
});
1112
console.log(response);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.transport.request({
7+
method: "POST",
8+
path: "/_inference/chat_completion/openai-completion/_stream",
9+
body: {
10+
messages: [
11+
{
12+
role: "assistant",
13+
content: "Let's find out what the weather is",
14+
tool_calls: [
15+
{
16+
id: "call_KcAjWtAww20AihPHphUh46Gd",
17+
type: "function",
18+
function: {
19+
name: "get_current_weather",
20+
arguments: '{"location":"Boston, MA"}',
21+
},
22+
},
23+
],
24+
},
25+
{
26+
role: "tool",
27+
content: "The weather is cold",
28+
tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd",
29+
},
30+
],
31+
},
32+
});
33+
console.log(response);
34+
----

src/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6894,7 +6894,7 @@ export type CatAllocationResponse = CatAllocationAllocationRecord[]
68946894

68956895
export interface CatComponentTemplatesComponentTemplate {
68966896
name: string
6897-
version: string
6897+
version: string | null
68986898
alias_count: string
68996899
mapping_count: string
69006900
settings_count: string

src/api/typesWithBodyKey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6974,7 +6974,7 @@ export type CatAllocationResponse = CatAllocationAllocationRecord[]
69746974

69756975
export interface CatComponentTemplatesComponentTemplate {
69766976
name: string
6977-
version: string
6977+
version: string | null
69786978
alias_count: string
69796979
mapping_count: string
69806980
settings_count: string

0 commit comments

Comments
 (0)