Skip to content

Commit e515817

Browse files
committed
rereapply manual fixes
1 parent 748611f commit e515817

File tree

11 files changed

+81
-82
lines changed

11 files changed

+81
-82
lines changed

specification/eql/search/examples/request/EqlSearchRequestExample1.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,5 @@ alternatives:
4949
code: |
5050
client.eql().search(s -> s
5151
.index("my-data-stream")
52-
.query("
53-
process where (process.name == "cmd.exe" and process.pid != 2013)
54-
")
52+
.query(" process where (process.name == \"cmd.exe\" and process.pid != 2013) ")
5553
);

specification/eql/search/examples/request/EqlSearchRequestExample2.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ alternatives:
5454
code: |
5555
client.eql().search(s -> s
5656
.index("my-data-stream")
57-
.query("
58-
sequence by process.pid
59-
[ file where file.name == "cmd.exe" and process.pid != 2013 ]
60-
[ process where stringContains(process.executable, "regsvr32") ]
57+
.query(" sequence by process.pid [ file where file.name == \"cmd.exe\" and process.pid != 2013 ][ process where stringContains(process.executable, \"regsvr32\") ] ")
6158
")
6259
);

specification/esql/query/examples/request/QueryRequestExample1.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ alternatives:
5252
code: |
5353
client.esql().query(q -> q
5454
.includeCcsMetadata(true)
55-
.query("
56-
FROM library,remote-*:library
57-
| EVAL year = DATE_TRUNC(1 YEARS, release_date)
58-
| STATS MAX(page_count) BY year
59-
| SORT year
60-
| LIMIT 5
55+
.query(" FROM library,remote-*:library | EVAL year = DATE_TRUNC(1 YEARS, release_date) | STATS MAX(page_count) BY year | SORT year | LIMIT 5 ")
6156
")
6257
);

specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample2.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,25 @@ alternatives:
152152
- language: Java
153153
code: |
154154
client.inference().chatCompletionUnified(c -> c
155-
.inferenceId("openai-completion")
156-
.chatCompletionRequest(ch -> ch
157-
.messages(List.of(Message.of(m -> m
158-
.content(co -> co
159-
.string("Let's find out what the weather is")
160-
)
161-
.role("assistant")
162-
.toolCalls(t -> t
163-
.id("call_KcAjWtAww20AihPHphUh46Gd")
164-
.function(f -> f
165-
.arguments("{"location":"Boston, MA"}")
166-
.name("get_current_weather")
167-
)
168-
.type("function")
169-
)),Message.of(me -> me
170-
.content(co -> co
171-
.string("The weather is cold")
172-
)
173-
.role("tool")
174-
.toolCallId("call_KcAjWtAww20AihPHphUh46Gd"))))
175-
)
155+
.inferenceId("openai-completion")
156+
.chatCompletionRequest(ch -> ch
157+
.messages(List.of(Message.of(m -> m
158+
.content(co -> co
159+
.string("Let's find out what the weather is")
160+
)
161+
.role("assistant")
162+
.toolCalls(t -> t
163+
.id("call_KcAjWtAww20AihPHphUh46Gd")
164+
.function(f -> f
165+
.arguments("{\"location\":\"Boston, MA\"}")
166+
.name("get_current_weather")
167+
)
168+
.type("function")
169+
)),Message.of(me -> me
170+
.content(co -> co
171+
.string("The weather is cold")
172+
)
173+
.role("tool")
174+
.toolCallId("call_KcAjWtAww20AihPHphUh46Gd"))))
175+
)
176176
);

specification/inference/chat_completion_unified/examples/request/PostChatCompletionRequestExample3.yaml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -218,32 +218,29 @@ alternatives:
218218
- language: Java
219219
code: |
220220
client.inference().chatCompletionUnified(c -> c
221-
.inferenceId("openai-completion")
222-
.chatCompletionRequest(ch -> ch
223-
.messages(m -> m
224-
.content(co -> co
225-
.object(o -> o
226-
.text("What's the price of a scarf?")
227-
.type("text")
228-
)
229-
)
230-
.role("user")
231-
)
232-
.toolChoice(t -> t
233-
.object(o -> o
234-
.type("function")
235-
.function(f -> f
236-
.name("get_current_price")
237-
)
238-
)
239-
)
240-
.tools(to -> to
241-
.type("function")
242-
.function(f -> f
243-
.description("Get the current price of a item")
244-
.name("get_current_price")
245-
.parameters(JsonData.fromJson("{\"type\":\"object\",\"properties\":{\"item\":{\"id\":\"123\"}}}"))
246-
)
247-
)
248-
)
221+
.inferenceId("openai-completion")
222+
.chatCompletionRequest(ch -> ch
223+
.messages(m -> m
224+
.content(co -> co
225+
.string("What's the price of a scarf?")
226+
)
227+
.role("user")
228+
)
229+
.toolChoice(t -> t
230+
.object(o -> o
231+
.type("function")
232+
.function(f -> f
233+
.name("get_current_price")
234+
)
235+
)
236+
)
237+
.tools(to -> to
238+
.type("function")
239+
.function(f -> f
240+
.description("Get the current price of a item")
241+
.name("get_current_price")
242+
.parameters(JsonData.fromJson("{\"type\":\"object\",\"properties\":{\"item\":{\"id\":\"123\"}}}"))
243+
)
244+
)
245+
)
249246
);

specification/ml/infer_trained_model/examples/request/MlInferTrainedModelExample1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ alternatives:
5757
- language: Java
5858
code: |
5959
client.ml().inferTrainedModel(i -> i
60-
.docs("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\""))
60+
.docs(Map.of("text", JsonData.fromJson("\"The fool doth think he is wise, but the wise man knows himself to be a fool.\"")))
6161
.modelId("lang_ident_model_1")
6262
);

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample4.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ alternatives:
134134
.rules(r -> r
135135
.any(List.of(RoleMappingRule.of(ro -> ro
136136
.field(NamedValue.of("username",List.of(FieldValue.of("esadmin"))
137-
)),RoleMappingRule.of(rol -> rol
137+
))), RoleMappingRule.of(rol -> rol
138138
.field(NamedValue.of("groups",List.of(FieldValue.of("cn=admins,dc=example,dc=com"))
139-
))))
139+
)))
140+
)
141+
)
140142
)
141143
);

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample7.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ alternatives:
123123
.rules(r -> r
124124
.all(List.of(RoleMappingRule.of(ro -> ro
125125
.field(NamedValue.of("dn",List.of(FieldValue.of("*,ou=subtree,dc=example,dc=com"))
126-
)),RoleMappingRule.of(rol -> rol
126+
))), RoleMappingRule.of(rol -> rol
127127
.field(NamedValue.of("realm.name",List.of(FieldValue.of("ldap1"))
128-
))))
128+
)))
129+
)
130+
)
129131
)
130132
);

specification/security/put_role_mapping/examples/request/SecurityPutRoleMappingRequestExample8.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,25 @@ alternatives:
223223
.roles("superuser")
224224
.rules(r -> r
225225
.all(List.of(RoleMappingRule.of(ro -> ro
226-
.any(List.of(RoleMappingRule.of(rol -> rol
227-
.field(NamedValue.of("dn",List.of(FieldValue.of("*,ou=admin,dc=example,dc=com"))
228-
)),RoleMappingRule.of(role -> role
229-
.field(NamedValue.of("username",List.of(FieldValue.of("es-admin"),FieldValue.of("es-system"))
230-
)))
231-
)),RoleMappingRule.of(roleM -> roleM
232-
.field(NamedValue.of("groups",List.of(FieldValue.of("cn=people,dc=example,dc=com"))
233-
)),RoleMappingRule.of(roleMa -> roleMa
234-
.except(e -> e
235-
.field(NamedValue.of("metadata.terminated_date",List.of(FieldValue.of(null))
226+
.any(List.of(RoleMappingRule.of(rol -> rol
227+
.field(NamedValue.of("dn", List.of(FieldValue.of("*,ou=admin," +
228+
"dc=example,dc=com"))
229+
))
230+
), RoleMappingRule.of(role -> role
231+
.field(NamedValue.of("username", List.of(FieldValue.of("es-admin"),
232+
FieldValue.of("es-system"))
233+
)))), RoleMappingRule.of(roleM -> roleM
234+
.field(NamedValue.of("groups", List.of(FieldValue.of("cn=people," +
235+
"dc=example,dc=com"))
236+
)), RoleMappingRule.of(roleMa -> roleMa
237+
.except(e -> e
238+
.field(NamedValue.of("metadata.terminated_date",
239+
List.of(FieldValue.of(null))
240+
)
241+
))))
242+
)
236243
)
237-
))))
244+
)
245+
)
238246
)
239247
);

specification/snapshot/restore/examples/request/SnapshotRestoreRequestExample2.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ alternatives:
3838
''{"indices":"index_1"}'' "$ELASTICSEARCH_URL/_cluster/settings"'
3939
- language: Java
4040
code: |
41-
client.cluster().putSettings(p -> p)
42-
);
41+
client.cluster().putSettings();
42+

0 commit comments

Comments
 (0)