Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Dec 9, 2024
1 parent 00675bf commit cc6a74a
Show file tree
Hide file tree
Showing 92 changed files with 2,976 additions and 25,572 deletions.
18 changes: 18 additions & 0 deletions docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc
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.ingest.simulate({
id: "query_helper_pipeline",
docs: [
{
_source: {
content:
"artificial intelligence in medicine articles published in the last 12 months",
},
},
],
});
console.log(response);
----
32 changes: 32 additions & 0 deletions docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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.ingest.putPipeline({
id: "query_helper_pipeline",
processors: [
{
script: {
source:
"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",
},
},
{
inference: {
model_id: "openai_chat_completions",
input_output: {
input_field: "prompt",
output_field: "query",
},
},
},
{
remove: {
field: "prompt",
},
},
],
});
console.log(response);
----
24 changes: 24 additions & 0 deletions docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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: "test-index",
query: {
semantic: {
field: "my_semantic_field",
},
},
highlight: {
fields: {
my_semantic_field: {
type: "semantic",
number_of_fragments: 2,
order: "score",
},
},
},
});
console.log(response);
----
Loading

0 comments on commit cc6a74a

Please sign in to comment.