Skip to content

Commit 9f845d5

Browse files
authored
[DOCS] Resolving conflicts. (#112391)
1 parent c867f6c commit 9f845d5

13 files changed

+295
-9
lines changed

docs/reference/search/search-your-data/semantic-search-inference.asciidoc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ The instructions in this tutorial shows you how to use the {infer} API workflow
99

1010
IMPORTANT: For the easiest way to perform semantic search in the {stack}, refer to the <<semantic-search-semantic-text, `semantic_text`>> end-to-end tutorial.
1111

12-
The following examples use Cohere's `embed-english-v3.0` model, the `all-mpnet-base-v2` model from HuggingFace, and OpenAI's `text-embedding-ada-002` second generation embedding model.
12+
The following examples use the:
13+
14+
* `embed-english-v3.0` model for https://docs.cohere.com/docs/cohere-embed[Cohere]
15+
* `all-mpnet-base-v2` model from https://huggingface.co/sentence-transformers/all-mpnet-base-v2[HuggingFace]
16+
* `text-embedding-ada-002` second generation embedding model for OpenAI
17+
* models available through https://ai.azure.com/explore/models?selectedTask=embeddings[Azure AI Studio] or https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models[Azure OpenAI]
18+
* `text-embedding-004` model for https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api[Google Vertex AI]
19+
* `mistral-embed` model for https://docs.mistral.ai/getting-started/models/[Mistral]
20+
* `amazon.titan-embed-text-v1` model for https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html[Amazon Bedrock]
21+
1322
You can use any Cohere and OpenAI models, they are all supported by the {infer} API.
1423
For a list of recommended models available on HuggingFace, refer to <<inference-example-hugging-face-supported-models, the supported model list>>.
1524

16-
Azure based examples use models available through https://ai.azure.com/explore/models?selectedTask=embeddings[Azure AI Studio]
17-
or https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models[Azure OpenAI].
18-
Mistral examples use the `mistral-embed` model from https://docs.mistral.ai/getting-started/models/[the Mistral API].
19-
Amazon Bedrock examples use the `amazon.titan-embed-text-v1` model from https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html[the Amazon Bedrock base models].
20-
2125
Click the name of the service you want to use on any of the widgets below to review the corresponding instructions.
2226

2327
[discrete]
@@ -73,8 +77,8 @@ Once the upload is complete, you can see an index named `test-data` with 182469
7377
[[reindexing-data-infer]]
7478
==== Ingest the data through the {infer} ingest pipeline
7579

76-
Create the embeddings from the text by reindexing the data through the {infer}
77-
pipeline that uses the chosen model as the inference model.
80+
Create embeddings from the text by reindexing the data through the {infer} pipeline that uses your chosen model.
81+
This step uses the {ref}/docs-reindex.html[reindex API] to simulate data ingestion through a pipeline.
7882

7983
include::{es-ref-dir}/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc[]
8084

@@ -113,5 +117,6 @@ include::{es-ref-dir}/tab-widgets/inference-api/infer-api-search-widget.asciidoc
113117

114118
You can also find tutorials in an interactive Colab notebook format using the
115119
{es} Python client:
120+
116121
* https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/integrations/cohere/inference-cohere.ipynb[Cohere {infer} tutorial notebook]
117122
* https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/search/07-inference.ipynb[OpenAI {infer} tutorial notebook]

docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
id="infer-api-ingest-azure-ai-studio">
3838
Azure AI Studio
3939
</button>
40+
<button role="tab"
41+
aria-selected="false"
42+
aria-controls="infer-api-ingest-google-vertex-ai-tab"
43+
id="infer-api-ingest-google-vertex-ai">
44+
Google Vertex AI
45+
</button>
4046
<button role="tab"
4147
aria-selected="false"
4248
aria-controls="infer-api-ingest-mistral-tab"
@@ -113,6 +119,17 @@ include::infer-api-ingest-pipeline.asciidoc[tag=azure-openai]
113119

114120
include::infer-api-ingest-pipeline.asciidoc[tag=azure-ai-studio]
115121

122+
++++
123+
</div>
124+
<div tabindex="0"
125+
role="tabpanel"
126+
id="infer-api-ingest-google-vertex-ai-tab"
127+
aria-labelledby="infer-api-ingest-google-vertex-ai"
128+
hidden="">
129+
++++
130+
131+
include::infer-api-ingest-pipeline.asciidoc[tag=google-vertex-ai]
132+
116133
++++
117134
</div>
118135
<div tabindex="0"

docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,32 @@ and the `output_field` that will contain the {infer} results.
165165

166166
// end::azure-ai-studio[]
167167

168+
// tag::google-vertex-ai[]
169+
170+
[source,console]
171+
--------------------------------------------------
172+
PUT _ingest/pipeline/google_vertex_ai_embeddings
173+
{
174+
"processors": [
175+
{
176+
"inference": {
177+
"model_id": "google_vertex_ai_embeddings", <1>
178+
"input_output": { <2>
179+
"input_field": "content",
180+
"output_field": "content_embedding"
181+
}
182+
}
183+
}
184+
]
185+
}
186+
--------------------------------------------------
187+
<1> The name of the inference endpoint you created by using the
188+
<<put-inference-api>>, it's referred to as `inference_id` in that step.
189+
<2> Configuration object that defines the `input_field` for the {infer} process
190+
and the `output_field` that will contain the {infer} results.
191+
192+
// end::google-vertex-ai[]
193+
168194
// tag::mistral[]
169195

170196
[source,console]

docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
id="infer-api-mapping-azure-ai-studio">
3838
Azure AI Studio
3939
</button>
40+
<button role="tab"
41+
aria-selected="false"
42+
aria-controls="infer-api-mapping-google-vertex-ai-tab"
43+
id="infer-api-mapping-google-vertex-ai">
44+
Google Vertex AI
45+
</button>
4046
<button role="tab"
4147
aria-selected="false"
4248
aria-controls="infer-api-mapping-mistral-tab"
@@ -113,6 +119,17 @@ include::infer-api-mapping.asciidoc[tag=azure-openai]
113119

114120
include::infer-api-mapping.asciidoc[tag=azure-ai-studio]
115121

122+
++++
123+
</div>
124+
<div tabindex="0"
125+
role="tabpanel"
126+
id="infer-api-mapping-google-vertex-ai-tab"
127+
aria-labelledby="infer-api-mapping-google-vertex-ai"
128+
hidden="">
129+
++++
130+
131+
include::infer-api-mapping.asciidoc[tag=google-vertex-ai]
132+
116133
++++
117134
</div>
118135
<div tabindex="0"

docs/reference/tab-widgets/inference-api/infer-api-mapping.asciidoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,39 @@ the {infer} pipeline configuration in the next step.
202202

203203
// end::azure-ai-studio[]
204204

205+
// tag::google-vertex-ai[]
206+
207+
[source,console]
208+
--------------------------------------------------
209+
PUT google-vertex-ai-embeddings
210+
{
211+
"mappings": {
212+
"properties": {
213+
"content_embedding": { <1>
214+
"type": "dense_vector", <2>
215+
"dims": 768, <3>
216+
"element_type": "float",
217+
"similarity": "dot_product" <4>
218+
},
219+
"content": { <5>
220+
"type": "text" <6>
221+
}
222+
}
223+
}
224+
}
225+
--------------------------------------------------
226+
<1> The name of the field to contain the generated embeddings. It must be referenced in the {infer} pipeline configuration in the next step.
227+
<2> The field to contain the embeddings is a `dense_vector` field.
228+
<3> The output dimensions of the model. This value may be found on the https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api[Google Vertex AI model reference].
229+
The {infer} API attempts to calculate the output dimensions automatically if `dims` are not specified.
230+
<4> For Google Vertex AI embeddings, the `dot_product` function should be used to calculate similarity.
231+
<5> The name of the field from which to create the dense vector representation.
232+
In this example, the name of the field is `content`. It must be referenced in
233+
the {infer} pipeline configuration in the next step.
234+
<6> The field type which is `text` in this example.
235+
236+
// end::google-vertex-ai[]
237+
205238
// tag::mistral[]
206239

207240
[source,console]

docs/reference/tab-widgets/inference-api/infer-api-reindex-widget.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
id="infer-api-reindex-azure-ai-studio">
3838
Azure AI Studio
3939
</button>
40+
<button role="tab"
41+
aria-selected="false"
42+
aria-controls="infer-api-reindex-google-vertex-ai-tab"
43+
id="infer-api-reindex-google-vertex-ai">
44+
Google Vertex AI
45+
</button>
4046
<button role="tab"
4147
aria-selected="false"
4248
aria-controls="infer-api-reindex-mistral-tab"
@@ -113,6 +119,17 @@ include::infer-api-reindex.asciidoc[tag=azure-openai]
113119

114120
include::infer-api-reindex.asciidoc[tag=azure-ai-studio]
115121

122+
++++
123+
</div>
124+
<div tabindex="0"
125+
role="tabpanel"
126+
id="infer-api-reindex-google-vertex-ai-tab"
127+
aria-labelledby="infer-api-reindex-google-vertex-ai"
128+
hidden="">
129+
++++
130+
131+
include::infer-api-reindex.asciidoc[tag=google-vertex-ai]
132+
116133
++++
117134
</div>
118135
<div tabindex="0"

docs/reference/tab-widgets/inference-api/infer-api-reindex.asciidoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,28 @@ might affect the throughput of the reindexing process. If this happens, change
155155

156156
// end::azure-ai-studio[]
157157

158+
// tag::google-vertex-ai[]
159+
160+
[source,console]
161+
----
162+
POST _reindex?wait_for_completion=false
163+
{
164+
"source": {
165+
"index": "test-data",
166+
"size": 50 <1>
167+
},
168+
"dest": {
169+
"index": "google-vertex-ai-embeddings",
170+
"pipeline": "google_vertex_ai_embeddings"
171+
}
172+
}
173+
----
174+
// TEST[skip:TBD]
175+
<1> The default batch size for reindexing is 1000. Reducing `size` will make updates to the reindexing process faster. This enables you to
176+
follow the progress closely and detect errors early.
177+
178+
// end::google-vertex-ai[]
179+
158180
// tag::mistral[]
159181

160182
[source,console]

docs/reference/tab-widgets/inference-api/infer-api-requirements-widget.asciidoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
aria-selected="false"
3636
aria-controls="infer-api-requirements-azure-ai-studio-tab"
3737
id="infer-api-requirements-azure-ai-studio">
38-
Azure AI Studio
38+
Azure AI Studio
39+
</button>
40+
<button role="tab"
41+
aria-selected="false"
42+
aria-controls="infer-api-requirements-google-vertex-ai-tab"
43+
id="infer-api-requirements-google-vertex-ai">
44+
Google Vertex AI
3945
</button>
4046
<button role="tab"
4147
aria-selected="false"
@@ -113,6 +119,17 @@ include::infer-api-requirements.asciidoc[tag=azure-openai]
113119

114120
include::infer-api-requirements.asciidoc[tag=azure-ai-studio]
115121

122+
++++
123+
</div>
124+
<div tabindex="0"
125+
role="tabpanel"
126+
id="infer-api-requirements-google-vertex-ai-tab"
127+
aria-labelledby="infer-api-requirements-google-vertex-ai"
128+
hidden="">
129+
++++
130+
131+
include::infer-api-requirements.asciidoc[tag=google-vertex-ai]
132+
116133
++++
117134
</div>
118135
<div tabindex="0"

docs/reference/tab-widgets/inference-api/infer-api-requirements.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ You can apply for access to Azure OpenAI by completing the form at https://aka.m
4141
4242
// end::azure-ai-studio[]
4343

44+
// tag::google-vertex-ai[]
45+
* A https://console.cloud.google.com/[Google Cloud account]
46+
* A project in Google Cloud
47+
* The Vertex AI API enabled in your project
48+
* A valid service account for the Google Vertex AI API
49+
* The service account must have the Vertex AI User role and the `aiplatform.endpoints.predict` permission.
50+
51+
// end::google-vertex-ai[]
52+
4453
// tag::mistral[]
4554
* A Mistral Account on https://console.mistral.ai/[La Plateforme]
4655
* An API key generated for your account

docs/reference/tab-widgets/inference-api/infer-api-search-widget.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
aria-controls="infer-api-search-azure-ai-studio-tab"
3737
id="infer-api-search-azure-ai-studio">
3838
Azure AI Studio
39+
</button>
40+
<button role="tab"
41+
aria-selected="false"
42+
aria-controls="infer-api-search-google-vertex-ai-tab"
43+
id="infer-api-search-google-vertex-ai">
44+
Google Vertex AI
3945
</button>
4046
<button role="tab"
4147
aria-selected="false"
@@ -113,6 +119,17 @@ include::infer-api-search.asciidoc[tag=azure-openai]
113119

114120
include::infer-api-search.asciidoc[tag=azure-ai-studio]
115121

122+
++++
123+
</div>
124+
<div tabindex="0"
125+
role="tabpanel"
126+
id="infer-api-search-google-vertex-ai-tab"
127+
aria-labelledby="infer-api-search-google-vertex-ai"
128+
hidden="">
129+
++++
130+
131+
include::infer-api-search.asciidoc[tag=google-vertex-ai]
132+
116133
++++
117134
</div>
118135
<div tabindex="0"

0 commit comments

Comments
 (0)