forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Adds cohere service example to the inference API tutorial (ela…
…stic#105904) Co-authored-by: Jonathan Buttner <[email protected]>
- Loading branch information
1 parent
787fae9
commit ec7da7a
Showing
13 changed files
with
654 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline-widget.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
++++ | ||
<div class="tabs" data-tab-group="model"> | ||
<div role="tablist" aria-label="model"> | ||
<button role="tab" | ||
aria-selected="true" | ||
aria-controls="infer-api-ingest-cohere-tab" | ||
id="infer-api-ingest-cohere"> | ||
Cohere | ||
</button> | ||
<button role="tab" | ||
aria-selected="false" | ||
aria-controls="infer-api-ingest-openai-tab" | ||
id="infer-api-ingest-openai"> | ||
OpenAI | ||
</button> | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="infer-api-ingest-cohere-tab" | ||
aria-labelledby="infer-api-ingest-cohere"> | ||
++++ | ||
|
||
include::infer-api-ingest-pipeline.asciidoc[tag=cohere] | ||
|
||
++++ | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="infer-api-ingest-openai-tab" | ||
aria-labelledby="infer-api-ingest-openai" | ||
hidden=""> | ||
++++ | ||
|
||
include::infer-api-ingest-pipeline.asciidoc[tag=openai] | ||
|
||
++++ | ||
</div> | ||
</div> | ||
++++ |
63 changes: 63 additions & 0 deletions
63
docs/reference/tab-widgets/inference-api/infer-api-ingest-pipeline.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
//// | ||
|
||
[source,console] | ||
---- | ||
DELETE _ingest/pipeline/*_embeddings | ||
---- | ||
// TEST | ||
// TEARDOWN | ||
|
||
//// | ||
|
||
// tag::cohere[] | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/cohere_embeddings | ||
{ | ||
"processors": [ | ||
{ | ||
"inference": { | ||
"model_id": "cohere_embeddings", <1> | ||
"input_output": { <2> | ||
"input_field": "content", | ||
"output_field": "content_embedding" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
<1> The name of the inference configuration you created by using the | ||
<<put-inference-api>>. | ||
<2> Configuration object that defines the `input_field` for the {infer} process | ||
and the `output_field` that will contain the {infer} results. | ||
|
||
// end::cohere[] | ||
|
||
|
||
// tag::openai[] | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
PUT _ingest/pipeline/openai_embeddings | ||
{ | ||
"processors": [ | ||
{ | ||
"inference": { | ||
"model_id": "openai_embeddings", <1> | ||
"input_output": { <2> | ||
"input_field": "content", | ||
"output_field": "content_embedding" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
<1> The name of the inference configuration you created by using the | ||
<<put-inference-api>>. | ||
<2> Configuration object that defines the `input_field` for the {infer} process | ||
and the `output_field` that will contain the {infer} results. | ||
|
||
// end::openai[] |
39 changes: 39 additions & 0 deletions
39
docs/reference/tab-widgets/inference-api/infer-api-mapping-widget.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
++++ | ||
<div class="tabs" data-tab-group="model"> | ||
<div role="tablist" aria-label="model"> | ||
<button role="tab" | ||
aria-selected="true" | ||
aria-controls="infer-api-mapping-cohere-tab" | ||
id="infer-api-mapping-cohere"> | ||
Cohere | ||
</button> | ||
<button role="tab" | ||
aria-selected="false" | ||
aria-controls="infer-api-mapping-openai-tab" | ||
id="infer-api-mapping-openai"> | ||
OpenAI | ||
</button> | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="infer-api-mapping-cohere-tab" | ||
aria-labelledby="infer-api-mapping-cohere"> | ||
++++ | ||
|
||
include::infer-api-mapping.asciidoc[tag=cohere] | ||
|
||
++++ | ||
</div> | ||
<div tabindex="0" | ||
role="tabpanel" | ||
id="infer-api-mapping-openai-tab" | ||
aria-labelledby="infer-api-mapping-openai" | ||
hidden=""> | ||
++++ | ||
|
||
include::infer-api-mapping.asciidoc[tag=openai] | ||
|
||
++++ | ||
</div> | ||
</div> | ||
++++ |
Oops, something went wrong.