-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-generated code for 8.15 (#2411)
- Loading branch information
1 parent
e47b135
commit fc80b32
Showing
18 changed files
with
249 additions
and
10 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.inference.put({ | ||
task_type: "text_embedding", | ||
inference_id: "watsonx-embeddings", | ||
inference_config: { | ||
service: "watsonxai", | ||
service_settings: { | ||
api_key: "<api_key>", | ||
url: "<url>", | ||
model_id: "ibm/slate-30m-english-rtrvr", | ||
project_id: "<project_id>", | ||
api_version: "2024-03-14", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.index({ | ||
index: "amazon-reviews", | ||
id: 1, | ||
document: { | ||
review_text: | ||
"This product is lifechanging! I'm telling all my friends about it.", | ||
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
14 changes: 14 additions & 0 deletions
14
docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.inference.streamInference({ | ||
task_type: "completion", | ||
inference_id: "openai-completion", | ||
body: { | ||
input: "What is Elastic?", | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
23 changes: 23 additions & 0 deletions
23
docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.inference.put({ | ||
task_type: "sparse_embedding", | ||
inference_id: "small_chunk_size", | ||
inference_config: { | ||
service: "elasticsearch", | ||
service_settings: { | ||
num_allocations: 1, | ||
num_threads: 1, | ||
}, | ||
chunking_settings: { | ||
strategy: "sentence", | ||
max_chunk_size: 100, | ||
sentence_overlap: 0, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.bulk({ | ||
operations: [ | ||
{ | ||
index: { | ||
_index: "amazon-reviews", | ||
_id: "2", | ||
}, | ||
}, | ||
{ | ||
review_text: "This product is amazing! I love it.", | ||
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], | ||
}, | ||
{ | ||
index: { | ||
_index: "amazon-reviews", | ||
_id: "3", | ||
}, | ||
}, | ||
{ | ||
review_text: "This product is terrible. I hate it.", | ||
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], | ||
}, | ||
{ | ||
index: { | ||
_index: "amazon-reviews", | ||
_id: "4", | ||
}, | ||
}, | ||
{ | ||
review_text: "This product is great. I can do anything with it.", | ||
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], | ||
}, | ||
{ | ||
index: { | ||
_index: "amazon-reviews", | ||
_id: "5", | ||
}, | ||
}, | ||
{ | ||
review_text: | ||
"This product has ruined my life and the lives of my family and friends.", | ||
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1], | ||
}, | ||
], | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.inference.put({ | ||
task_type: "sparse_embedding", | ||
inference_id: "my-elser-model", | ||
inference_config: { | ||
service: "elasticsearch", | ||
service_settings: { | ||
adaptive_allocations: { | ||
enabled: true, | ||
min_number_of_allocations: 1, | ||
max_number_of_allocations: 10, | ||
}, | ||
num_threads: 1, | ||
model_id: ".elser_model_2", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
18 changes: 18 additions & 0 deletions
18
docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.search({ | ||
index: "amazon-reviews", | ||
retriever: { | ||
knn: { | ||
field: "review_vector", | ||
query_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], | ||
k: 2, | ||
num_candidates: 5, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.inference.put({ | ||
task_type: "sparse_embedding", | ||
inference_id: "use_existing_deployment", | ||
inference_config: { | ||
service: "elasticsearch", | ||
service_settings: { | ||
deployment_id: ".elser_model_2", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
docs/doc_examples/96e88611f99e6834bd64b58dc8a282c1.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.indices.create({ | ||
index: "my-index-000002", | ||
mappings: { | ||
properties: { | ||
inference_field: { | ||
type: "semantic_text", | ||
inference_id: "my-openai-endpoint", | ||
}, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.indices.create({ | ||
index: "amazon-reviews", | ||
mappings: { | ||
properties: { | ||
review_vector: { | ||
type: "dense_vector", | ||
dims: 8, | ||
index: true, | ||
similarity: "cosine", | ||
}, | ||
review_text: { | ||
type: "text", | ||
}, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters