You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/ingest/processors/inference.asciidoc
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -735,3 +735,70 @@ You can also specify the target field as follows:
735
735
736
736
In this case, {feat-imp} is exposed in the
737
737
`my_field.foo.feature_importance` field.
738
+
739
+
740
+
[discrete]
741
+
[[inference-processor-examples]]
742
+
==== {infer-cap} processor examples
743
+
744
+
The following example uses an <<inference-apis,{infer} endpoint>> in an {infer} processor named `query_helper_pipeline` to perform a chat completion task.
745
+
The processor generates an {es} query from natural language input using a prompt designed for a completion task type.
746
+
Refer to <<put-inference-api-desc,this list>> for the {infer} service you use and check the corresponding examples of setting up an endpoint with the chat completion task type.
"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" <1>
// TEST[skip: An inference processor with an inference endpoint is required.]
797
+
<1> The natural language query used to generate an {es} query within the prompt created by the {infer} processor.
798
+
799
+
800
+
[discrete]
801
+
[[infer-proc-readings]]
802
+
==== Further readings
803
+
804
+
* https://www.elastic.co/search-labs/blog/openwebcrawler-llms-semantic-text-resume-job-search[Which job is the best for you? Using LLMs and semantic_text to match resumes to jobs]
0 commit comments