Skip to content

Commit cc6a74a

Browse files
Auto-generated API code
1 parent 00675bf commit cc6a74a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2976
-25572
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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.ingest.simulate({
7+
id: "query_helper_pipeline",
8+
docs: [
9+
{
10+
_source: {
11+
content:
12+
"artificial intelligence in medicine articles published in the last 12 months",
13+
},
14+
},
15+
],
16+
});
17+
console.log(response);
18+
----
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.ingest.putPipeline({
7+
id: "query_helper_pipeline",
8+
processors: [
9+
{
10+
script: {
11+
source:
12+
"ctx.prompt = 'Please generate an elasticsearch search query on index `articles_index` for the following natural language query. Dates are in the field `@timestamp`, document types are in the field `type` (options are `news`, `publication`), categories in the field `category` and can be multiple (options are `medicine`, `pharmaceuticals`, `technology`), and document names are in the field `title` which should use a fuzzy match. Ignore fields which cannot be determined from the natural language query context: ' + ctx.content",
13+
},
14+
},
15+
{
16+
inference: {
17+
model_id: "openai_chat_completions",
18+
input_output: {
19+
input_field: "prompt",
20+
output_field: "query",
21+
},
22+
},
23+
},
24+
{
25+
remove: {
26+
field: "prompt",
27+
},
28+
},
29+
],
30+
});
31+
console.log(response);
32+
----
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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.indices.create({
7+
index: "test-index",
8+
query: {
9+
semantic: {
10+
field: "my_semantic_field",
11+
},
12+
},
13+
highlight: {
14+
fields: {
15+
my_semantic_field: {
16+
type: "semantic",
17+
number_of_fragments: 2,
18+
order: "score",
19+
},
20+
},
21+
},
22+
});
23+
console.log(response);
24+
----

0 commit comments

Comments
 (0)