// This file is autogenerated, DO NOT EDIT
// ingest/processors/inference.asciidoc:750

[source, python]
----
resp = client.ingest.put_pipeline(
    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"
            }
        }
    ],
)
print(resp)
----
