Skip to content

Commit 4296402

Browse files
authored
Release 8.18.0
1 parent d105e07 commit 4296402

11 files changed

+106
-75
lines changed

docs/examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc

+10-9
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33

44
[source, python]
55
----
6-
resp = client.inference.stream_inference(
7-
task_type="chat_completion",
6+
resp = client.inference.chat_completion_unified(
87
inference_id="openai-completion",
9-
model="gpt-4o",
10-
messages=[
11-
{
12-
"role": "user",
13-
"content": "What is Elastic?"
14-
}
15-
],
8+
chat_completion_request={
9+
"model": "gpt-4o",
10+
"messages": [
11+
{
12+
"role": "user",
13+
"content": "What is Elastic?"
14+
}
15+
]
16+
},
1617
)
1718
print(resp)
1819
----

docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
[source, python]
55
----
6-
resp = client.inference.inference(
7-
task_type="sparse_embedding",
6+
resp = client.inference.sparse_embedding(
87
inference_id="my-elser-model",
98
input="The sky above the port was the color of television tuned to a dead channel.",
109
)

docs/examples/45954b8aaedfed57012be8b6538b0a24.asciidoc

+31-30
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,42 @@
33

44
[source, python]
55
----
6-
resp = client.inference.stream_inference(
7-
task_type="chat_completion",
6+
resp = client.inference.chat_completion_unified(
87
inference_id="openai-completion",
9-
messages=[
10-
{
11-
"role": "user",
12-
"content": [
13-
{
14-
"type": "text",
15-
"text": "What's the price of a scarf?"
16-
}
17-
]
18-
}
19-
],
20-
tools=[
21-
{
22-
"type": "function",
23-
"function": {
24-
"name": "get_current_price",
25-
"description": "Get the current price of a item",
26-
"parameters": {
27-
"type": "object",
28-
"properties": {
29-
"item": {
30-
"id": "123"
8+
chat_completion_request={
9+
"messages": [
10+
{
11+
"role": "user",
12+
"content": [
13+
{
14+
"type": "text",
15+
"text": "What's the price of a scarf?"
16+
}
17+
]
18+
}
19+
],
20+
"tools": [
21+
{
22+
"type": "function",
23+
"function": {
24+
"name": "get_current_price",
25+
"description": "Get the current price of a item",
26+
"parameters": {
27+
"type": "object",
28+
"properties": {
29+
"item": {
30+
"id": "123"
31+
}
3132
}
3233
}
3334
}
3435
}
35-
}
36-
],
37-
tool_choice={
38-
"type": "function",
39-
"function": {
40-
"name": "get_current_price"
36+
],
37+
"tool_choice": {
38+
"type": "function",
39+
"function": {
40+
"name": "get_current_price"
41+
}
4142
}
4243
},
4344
)

docs/examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
[source, python]
55
----
6-
resp = client.inference.stream_inference(
7-
task_type="completion",
6+
resp = client.inference.stream_completion(
87
inference_id="openai-completion",
98
input="What is Elastic?",
109
)

docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
[source, python]
55
----
6-
resp = client.inference.inference(
7-
task_type="text_embedding",
6+
resp = client.inference.text_embedding(
87
inference_id="my-cohere-endpoint",
98
input="The sky above the port was the color of television tuned to a dead channel.",
109
task_settings={

docs/examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc

+23-22
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@
33

44
[source, python]
55
----
6-
resp = client.inference.stream_inference(
7-
task_type="chat_completion",
6+
resp = client.inference.chat_completion_unified(
87
inference_id="openai-completion",
9-
messages=[
10-
{
11-
"role": "assistant",
12-
"content": "Let's find out what the weather is",
13-
"tool_calls": [
14-
{
15-
"id": "call_KcAjWtAww20AihPHphUh46Gd",
16-
"type": "function",
17-
"function": {
18-
"name": "get_current_weather",
19-
"arguments": "{\"location\":\"Boston, MA\"}"
8+
chat_completion_request={
9+
"messages": [
10+
{
11+
"role": "assistant",
12+
"content": "Let's find out what the weather is",
13+
"tool_calls": [
14+
{
15+
"id": "call_KcAjWtAww20AihPHphUh46Gd",
16+
"type": "function",
17+
"function": {
18+
"name": "get_current_weather",
19+
"arguments": "{\"location\":\"Boston, MA\"}"
20+
}
2021
}
21-
}
22-
]
23-
},
24-
{
25-
"role": "tool",
26-
"content": "The weather is cold",
27-
"tool_call_id": "call_KcAjWtAww20AihPHphUh46Gd"
28-
}
29-
],
22+
]
23+
},
24+
{
25+
"role": "tool",
26+
"content": "The weather is cold",
27+
"tool_call_id": "call_KcAjWtAww20AihPHphUh46Gd"
28+
}
29+
]
30+
},
3031
)
3132
print(resp)
3233
----

docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
[source, python]
55
----
6-
resp = client.inference.inference(
7-
task_type="completion",
6+
resp = client.inference.completion(
87
inference_id="openai_chat_completions",
98
input="What is Elastic?",
109
)

docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
[source, python]
55
----
6-
resp = client.inference.inference(
7-
task_type="rerank",
6+
resp = client.inference.rerank(
87
inference_id="cohere_rerank",
98
input=[
109
"luke",

docs/guide/release-notes.asciidoc

+33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
[[release-notes]]
22
== Release notes
33

4+
=== 8.18.0 (2025-04-15)
5+
6+
- Merge `Elasticsearch-DSL <https://github.com/elastic/elasticsearch-dsl-py/>`_ package (https://github.com/elastic/elasticsearch-py/pull/2736[#2736])
7+
- Add Python DSL documentation (https://github.com/elastic/elasticsearch-py/pull/2761[#2761])
8+
- Autogenerate DSL field classes from schema (https://github.com/elastic/elasticsearch-py/pull/2780[#2780])
9+
- Document use of sub-clients (https://github.com/elastic/elasticsearch-py/pull/2798[#2798])
10+
- Improve DSL documentation examples with class-based queries and type hints (https://github.com/elastic/elasticsearch-py/pull/2857[#2857])
11+
- Document the use of `param()` in Python DSL methods (https://github.com/elastic/elasticsearch-py/pull/2861[#2861])
12+
- Fix `simulate` sub-client documentation (https://github.com/elastic/elasticsearch-py/pull/2749[#2749])[#2749])
13+
- Update APIs
14+
* Remove `wait_for_active_shards` from experimental Get field usage stats API
15+
* Rename incorrect `access_token` to `token` in Logout of OpenID Connect API
16+
* Add inference APIs: Alibaba Cloud AI Search, Amazon Bedrock, Anthropic, Azure AI Studio, Azure OpenAI, Cohere, Elasticsearch, ELSER, Google AI Studio, Google Vertex AI, Hugging Face, Jina AI, Mistral, OpenAI, and Voyage AI
17+
* Add Reindex legacy backing indices APIs
18+
* Add Create an index from a source index API
19+
* Add `include_source_on_error` to Create, Index, Update and Bulk APIs
20+
* Add Stop async ES|QL query API
21+
* Add `timeout` to Resolve Cluster API
22+
* Add `adaptive_allocations` body field to Start and Update a trained model deployment API
23+
* Rename `index_template_subtitutions` to `index_template_substitutions` in Simulate data ingestion API* Add `if_primary_term`, `if_seq_no`, `op_type`, `require_alias` and `require_data_stream` to Create API
24+
* Add `max_concurrent_shard_requests` to Open point in time API
25+
* Add `local` and `flat_settings` to Check index templates API
26+
* Add `reopen` to Update index settings API
27+
* Add `resource` to Reload search analyzer API
28+
* Add `lazy` to Roll over to a new index API
29+
* Add `cause` and `create` to Simulate index template APIs
30+
* Add Elastic Inference Service (EIS) chat completion
31+
* Add inference APIs: Alibaba Cloud AI Search, Amazon Bedrock, Anthropic, Azure AI Studio, Azure OpenAI, Cohere, Elastic Inference Service (EIS), Elasticsearch, ELSER, Google AI Studio, Google Vertex AI, Hugging Face, Jina AI, Mistral, OpenAI, and Voyage AI
32+
- Update DSL
33+
* Add `ignore_malformed`, `script`, `on_script_error` and `time_series_dimension` to Boolean field
34+
* Add `index` to GeoShape field
35+
* Add `search_inference_id` to SemanticText field
36+
437
[discrete]
538
[[rn-8-17-2]]
639
=== 8.17.2 (2025-03-04)

elasticsearch/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
__versionstr__ = "8.17.2"
18+
__versionstr__ = "8.18.0"

utils/generate-docs-examples/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)