Skip to content

Commit 7c47873

Browse files
Auto-generated API code
1 parent 292553f commit 7c47873

File tree

11 files changed

+414
-19
lines changed

11 files changed

+414
-19
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ async def bulk(
700700
<li>JavaScript: Check out <code>client.helpers.*</code></li>
701701
<li>.NET: Check out <code>BulkAllObservable</code></li>
702702
<li>PHP: Check out bulk indexing.</li>
703+
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
703704
</ul>
704705
<p><strong>Submitting bulk requests with cURL</strong></p>
705706
<p>If you're providing text file input to <code>curl</code>, you must use the <code>--data-binary</code> flag instead of plain <code>-d</code>.
@@ -6010,7 +6011,7 @@ async def termvectors(
60106011
doc: t.Optional[t.Mapping[str, t.Any]] = None,
60116012
error_trace: t.Optional[bool] = None,
60126013
field_statistics: t.Optional[bool] = None,
6013-
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
6014+
fields: t.Optional[t.Sequence[str]] = None,
60146015
filter: t.Optional[t.Mapping[str, t.Any]] = None,
60156016
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
60166017
human: t.Optional[bool] = None,

elasticsearch/_async/client/esql.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ async def async_query(
107107
which has the name of all the columns.
108108
:param filter: Specify a Query DSL query in the filter parameter to filter the
109109
set of documents that an ES|QL query runs on.
110-
:param format: A short version of the Accept header, for example `json` or `yaml`.
110+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
111+
`tsv`, and `txt` formats will return results in a tabular format, excluding
112+
other metadata fields from the response. For async requests, nothing will
113+
be returned if the async query doesn't finish within the timeout. The query
114+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
115+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
111116
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
112117
query, the response will include an extra `_clusters` object with information
113118
about the clusters that participated in the search along with info such as
@@ -456,7 +461,9 @@ async def query(
456461
`all_columns` which has the name of all columns.
457462
:param filter: Specify a Query DSL query in the filter parameter to filter the
458463
set of documents that an ES|QL query runs on.
459-
:param format: A short version of the Accept header, e.g. json, yaml.
464+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
465+
`tsv`, and `txt` formats will return results in a tabular format, excluding
466+
other metadata fields from the response.
460467
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
461468
query, the response will include an extra `_clusters` object with information
462469
about the clusters that participated in the search along with info such as

elasticsearch/_async/client/inference.py

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,21 +391,23 @@ async def put(
391391
<ul>
392392
<li>AlibabaCloud AI Search (<code>completion</code>, <code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code>)</li>
393393
<li>Amazon Bedrock (<code>completion</code>, <code>text_embedding</code>)</li>
394+
<li>Amazon SageMaker (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code>)</li>
394395
<li>Anthropic (<code>completion</code>)</li>
395396
<li>Azure AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
396397
<li>Azure OpenAI (<code>completion</code>, <code>text_embedding</code>)</li>
397398
<li>Cohere (<code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
398-
<li>DeepSeek (<code>completion</code>, <code>chat_completion</code>)</li>
399+
<li>DeepSeek (<code>chat_completion</code>, <code>completion</code>)</li>
399400
<li>Elasticsearch (<code>rerank</code>, <code>sparse_embedding</code>, <code>text_embedding</code> - this service is for built-in models and models uploaded through Eland)</li>
400401
<li>ELSER (<code>sparse_embedding</code>)</li>
401402
<li>Google AI Studio (<code>completion</code>, <code>text_embedding</code>)</li>
402-
<li>Google Vertex AI (<code>rerank</code>, <code>text_embedding</code>)</li>
403+
<li>Google Vertex AI (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
403404
<li>Hugging Face (<code>chat_completion</code>, <code>completion</code>, <code>rerank</code>, <code>text_embedding</code>)</li>
405+
<li>JinaAI (<code>rerank</code>, <code>text_embedding</code>)</li>
406+
<li>Llama (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
404407
<li>Mistral (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
405408
<li>OpenAI (<code>chat_completion</code>, <code>completion</code>, <code>text_embedding</code>)</li>
406-
<li>VoyageAI (<code>text_embedding</code>, <code>rerank</code>)</li>
409+
<li>VoyageAI (<code>rerank</code>, <code>text_embedding</code>)</li>
407410
<li>Watsonx inference integration (<code>text_embedding</code>)</li>
408-
<li>JinaAI (<code>text_embedding</code>, <code>rerank</code>)</li>
409411
</ul>
410412
411413
@@ -659,6 +661,112 @@ async def put_amazonbedrock(
659661
path_parts=__path_parts,
660662
)
661663

664+
@_rewrite_parameters(
665+
body_fields=(
666+
"service",
667+
"service_settings",
668+
"chunking_settings",
669+
"task_settings",
670+
),
671+
)
672+
async def put_amazonsagemaker(
673+
self,
674+
*,
675+
task_type: t.Union[
676+
str,
677+
t.Literal[
678+
"chat_completion",
679+
"completion",
680+
"rerank",
681+
"sparse_embedding",
682+
"text_embedding",
683+
],
684+
],
685+
amazonsagemaker_inference_id: str,
686+
service: t.Optional[t.Union[str, t.Literal["amazon_sagemaker"]]] = None,
687+
service_settings: t.Optional[t.Mapping[str, t.Any]] = None,
688+
chunking_settings: t.Optional[t.Mapping[str, t.Any]] = None,
689+
error_trace: t.Optional[bool] = None,
690+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
691+
human: t.Optional[bool] = None,
692+
pretty: t.Optional[bool] = None,
693+
task_settings: t.Optional[t.Mapping[str, t.Any]] = None,
694+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
695+
body: t.Optional[t.Dict[str, t.Any]] = None,
696+
) -> ObjectApiResponse[t.Any]:
697+
"""
698+
.. raw:: html
699+
700+
<p>Create an Amazon SageMaker inference endpoint.</p>
701+
<p>Create an inference endpoint to perform an inference task with the <code>amazon_sagemaker</code> service.</p>
702+
703+
704+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-amazonsagemaker>`_
705+
706+
:param task_type: The type of the inference task that the model will perform.
707+
:param amazonsagemaker_inference_id: The unique identifier of the inference endpoint.
708+
:param service: The type of service supported for the specified task type. In
709+
this case, `amazon_sagemaker`.
710+
:param service_settings: Settings used to install the inference model. These
711+
settings are specific to the `amazon_sagemaker` service and `service_settings.api`
712+
you specified.
713+
:param chunking_settings: The chunking configuration object.
714+
:param task_settings: Settings to configure the inference task. These settings
715+
are specific to the task type and `service_settings.api` you specified.
716+
:param timeout: Specifies the amount of time to wait for the inference endpoint
717+
to be created.
718+
"""
719+
if task_type in SKIP_IN_PATH:
720+
raise ValueError("Empty value passed for parameter 'task_type'")
721+
if amazonsagemaker_inference_id in SKIP_IN_PATH:
722+
raise ValueError(
723+
"Empty value passed for parameter 'amazonsagemaker_inference_id'"
724+
)
725+
if service is None and body is None:
726+
raise ValueError("Empty value passed for parameter 'service'")
727+
if service_settings is None and body is None:
728+
raise ValueError("Empty value passed for parameter 'service_settings'")
729+
__path_parts: t.Dict[str, str] = {
730+
"task_type": _quote(task_type),
731+
"amazonsagemaker_inference_id": _quote(amazonsagemaker_inference_id),
732+
}
733+
__path = f'/_inference/{__path_parts["task_type"]}/{__path_parts["amazonsagemaker_inference_id"]}'
734+
__query: t.Dict[str, t.Any] = {}
735+
__body: t.Dict[str, t.Any] = body if body is not None else {}
736+
if error_trace is not None:
737+
__query["error_trace"] = error_trace
738+
if filter_path is not None:
739+
__query["filter_path"] = filter_path
740+
if human is not None:
741+
__query["human"] = human
742+
if pretty is not None:
743+
__query["pretty"] = pretty
744+
if timeout is not None:
745+
__query["timeout"] = timeout
746+
if not __body:
747+
if service is not None:
748+
__body["service"] = service
749+
if service_settings is not None:
750+
__body["service_settings"] = service_settings
751+
if chunking_settings is not None:
752+
__body["chunking_settings"] = chunking_settings
753+
if task_settings is not None:
754+
__body["task_settings"] = task_settings
755+
if not __body:
756+
__body = None # type: ignore[assignment]
757+
__headers = {"accept": "application/json"}
758+
if __body is not None:
759+
__headers["content-type"] = "application/json"
760+
return await self.perform_request( # type: ignore[return-value]
761+
"PUT",
762+
__path,
763+
params=__query,
764+
headers=__headers,
765+
body=__body,
766+
endpoint_id="inference.put_amazonsagemaker",
767+
path_parts=__path_parts,
768+
)
769+
662770
@_rewrite_parameters(
663771
body_fields=(
664772
"service",

elasticsearch/_async/client/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async def query(
283283
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
284284
keep_on_completion: t.Optional[bool] = None,
285285
page_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
286-
params: t.Optional[t.Mapping[str, t.Any]] = None,
286+
params: t.Optional[t.Sequence[t.Any]] = None,
287287
pretty: t.Optional[bool] = None,
288288
query: t.Optional[str] = None,
289289
request_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,

elasticsearch/_sync/client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ def bulk(
698698
<li>JavaScript: Check out <code>client.helpers.*</code></li>
699699
<li>.NET: Check out <code>BulkAllObservable</code></li>
700700
<li>PHP: Check out bulk indexing.</li>
701+
<li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
701702
</ul>
702703
<p><strong>Submitting bulk requests with cURL</strong></p>
703704
<p>If you're providing text file input to <code>curl</code>, you must use the <code>--data-binary</code> flag instead of plain <code>-d</code>.
@@ -6008,7 +6009,7 @@ def termvectors(
60086009
doc: t.Optional[t.Mapping[str, t.Any]] = None,
60096010
error_trace: t.Optional[bool] = None,
60106011
field_statistics: t.Optional[bool] = None,
6011-
fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
6012+
fields: t.Optional[t.Sequence[str]] = None,
60126013
filter: t.Optional[t.Mapping[str, t.Any]] = None,
60136014
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
60146015
human: t.Optional[bool] = None,

elasticsearch/_sync/client/esql.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ def async_query(
107107
which has the name of all the columns.
108108
:param filter: Specify a Query DSL query in the filter parameter to filter the
109109
set of documents that an ES|QL query runs on.
110-
:param format: A short version of the Accept header, for example `json` or `yaml`.
110+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
111+
`tsv`, and `txt` formats will return results in a tabular format, excluding
112+
other metadata fields from the response. For async requests, nothing will
113+
be returned if the async query doesn't finish within the timeout. The query
114+
ID and running status are available in the `X-Elasticsearch-Async-Id` and
115+
`X-Elasticsearch-Async-Is-Running` HTTP headers of the response, respectively.
111116
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
112117
query, the response will include an extra `_clusters` object with information
113118
about the clusters that participated in the search along with info such as
@@ -456,7 +461,9 @@ def query(
456461
`all_columns` which has the name of all columns.
457462
:param filter: Specify a Query DSL query in the filter parameter to filter the
458463
set of documents that an ES|QL query runs on.
459-
:param format: A short version of the Accept header, e.g. json, yaml.
464+
:param format: A short version of the Accept header, e.g. json, yaml. `csv`,
465+
`tsv`, and `txt` formats will return results in a tabular format, excluding
466+
other metadata fields from the response.
460467
:param include_ccs_metadata: When set to `true` and performing a cross-cluster
461468
query, the response will include an extra `_clusters` object with information
462469
about the clusters that participated in the search along with info such as

0 commit comments

Comments
 (0)