134 134 | "com.amazonaws.bedrockruntime.synthetic",
|
135 135 | "ConverseStreamInput",
|
136 136 | );
|
137 137 | static CONVERSESTREAMINPUT_MEMBER_MODEL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
138 138 | ::aws_smithy_schema::ShapeId::from_static(
|
139 139 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$modelId",
|
140 140 | "com.amazonaws.bedrockruntime.synthetic",
|
141 141 | "ConverseStreamInput",
|
142 142 | ),
|
143 143 | ::aws_smithy_schema::ShapeType::String,
|
144 - | "model_id",
|
144 + | "modelId",
|
145 145 | 0,
|
146 146 | )
|
147 147 | .with_http_label();
|
148 148 | static CONVERSESTREAMINPUT_MEMBER_MESSAGES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
149 149 | ::aws_smithy_schema::ShapeId::from_static(
|
150 150 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$messages",
|
151 151 | "com.amazonaws.bedrockruntime.synthetic",
|
152 152 | "ConverseStreamInput",
|
153 153 | ),
|
154 154 | ::aws_smithy_schema::ShapeType::List,
|
155 155 | "messages",
|
156 156 | 1,
|
157 157 | );
|
158 158 | static CONVERSESTREAMINPUT_MEMBER_SYSTEM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
159 159 | ::aws_smithy_schema::ShapeId::from_static(
|
160 160 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$system",
|
161 161 | "com.amazonaws.bedrockruntime.synthetic",
|
162 162 | "ConverseStreamInput",
|
163 163 | ),
|
164 164 | ::aws_smithy_schema::ShapeType::List,
|
165 165 | "system",
|
166 166 | 2,
|
167 167 | );
|
168 168 | static CONVERSESTREAMINPUT_MEMBER_INFERENCE_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
169 169 | ::aws_smithy_schema::ShapeId::from_static(
|
170 170 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$inferenceConfig",
|
171 171 | "com.amazonaws.bedrockruntime.synthetic",
|
172 172 | "ConverseStreamInput",
|
173 173 | ),
|
174 174 | ::aws_smithy_schema::ShapeType::Structure,
|
175 - | "inference_config",
|
175 + | "inferenceConfig",
|
176 176 | 3,
|
177 177 | );
|
178 178 | static CONVERSESTREAMINPUT_MEMBER_TOOL_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
179 179 | ::aws_smithy_schema::ShapeId::from_static(
|
180 180 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$toolConfig",
|
181 181 | "com.amazonaws.bedrockruntime.synthetic",
|
182 182 | "ConverseStreamInput",
|
183 183 | ),
|
184 184 | ::aws_smithy_schema::ShapeType::Structure,
|
185 - | "tool_config",
|
185 + | "toolConfig",
|
186 186 | 4,
|
187 187 | );
|
188 188 | static CONVERSESTREAMINPUT_MEMBER_GUARDRAIL_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
189 189 | ::aws_smithy_schema::ShapeId::from_static(
|
190 190 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$guardrailConfig",
|
191 191 | "com.amazonaws.bedrockruntime.synthetic",
|
192 192 | "ConverseStreamInput",
|
193 193 | ),
|
194 194 | ::aws_smithy_schema::ShapeType::Structure,
|
195 - | "guardrail_config",
|
195 + | "guardrailConfig",
|
196 196 | 5,
|
197 197 | );
|
198 198 | static CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
199 199 | ::aws_smithy_schema::ShapeId::from_static(
|
200 200 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$additionalModelRequestFields",
|
201 201 | "com.amazonaws.bedrockruntime.synthetic",
|
202 202 | "ConverseStreamInput",
|
203 203 | ),
|
204 204 | ::aws_smithy_schema::ShapeType::Document,
|
205 - | "additional_model_request_fields",
|
205 + | "additionalModelRequestFields",
|
206 206 | 6,
|
207 207 | );
|
208 208 | static CONVERSESTREAMINPUT_MEMBER_PROMPT_VARIABLES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
209 209 | ::aws_smithy_schema::ShapeId::from_static(
|
210 210 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$promptVariables",
|
211 211 | "com.amazonaws.bedrockruntime.synthetic",
|
212 212 | "ConverseStreamInput",
|
213 213 | ),
|
214 214 | ::aws_smithy_schema::ShapeType::Map,
|
215 - | "prompt_variables",
|
215 + | "promptVariables",
|
216 216 | 7,
|
217 217 | );
|
218 218 | static CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
219 219 | ::aws_smithy_schema::ShapeId::from_static(
|
220 220 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$additionalModelResponseFieldPaths",
|
221 221 | "com.amazonaws.bedrockruntime.synthetic",
|
222 222 | "ConverseStreamInput",
|
223 223 | ),
|
224 224 | ::aws_smithy_schema::ShapeType::List,
|
225 - | "additional_model_response_field_paths",
|
225 + | "additionalModelResponseFieldPaths",
|
226 226 | 8,
|
227 227 | );
|
228 228 | static CONVERSESTREAMINPUT_MEMBER_REQUEST_METADATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
229 229 | ::aws_smithy_schema::ShapeId::from_static(
|
230 230 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$requestMetadata",
|
231 231 | "com.amazonaws.bedrockruntime.synthetic",
|
232 232 | "ConverseStreamInput",
|
233 233 | ),
|
234 234 | ::aws_smithy_schema::ShapeType::Map,
|
235 - | "request_metadata",
|
235 + | "requestMetadata",
|
236 236 | 9,
|
237 237 | );
|
238 238 | static CONVERSESTREAMINPUT_MEMBER_PERFORMANCE_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
239 239 | ::aws_smithy_schema::ShapeId::from_static(
|
240 240 | "com.amazonaws.bedrockruntime.synthetic#ConverseStreamInput$performanceConfig",
|
241 241 | "com.amazonaws.bedrockruntime.synthetic",
|
242 242 | "ConverseStreamInput",
|
243 243 | ),
|
244 244 | ::aws_smithy_schema::ShapeType::Structure,
|
245 - | "performance_config",
|
245 + | "performanceConfig",
|
246 246 | 10,
|
247 247 | );
|
248 248 | static CONVERSESTREAMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
249 249 | CONVERSESTREAMINPUT_SCHEMA_ID,
|
250 250 | ::aws_smithy_schema::ShapeType::Structure,
|
251 251 | &[
|
252 252 | &CONVERSESTREAMINPUT_MEMBER_MODEL_ID,
|
253 253 | &CONVERSESTREAMINPUT_MEMBER_MESSAGES,
|
254 254 | &CONVERSESTREAMINPUT_MEMBER_SYSTEM,
|
255 255 | &CONVERSESTREAMINPUT_MEMBER_INFERENCE_CONFIG,
|
256 256 | &CONVERSESTREAMINPUT_MEMBER_TOOL_CONFIG,
|
257 257 | &CONVERSESTREAMINPUT_MEMBER_GUARDRAIL_CONFIG,
|
258 258 | &CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS,
|
259 259 | &CONVERSESTREAMINPUT_MEMBER_PROMPT_VARIABLES,
|
260 260 | &CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS,
|
261 261 | &CONVERSESTREAMINPUT_MEMBER_REQUEST_METADATA,
|
262 262 | &CONVERSESTREAMINPUT_MEMBER_PERFORMANCE_CONFIG,
|
263 263 | ],
|
264 - | );
|
264 + | )
|
265 + | .with_http(aws_smithy_schema::traits::HttpTrait::new(
|
266 + | "POST",
|
267 + | "/model/{modelId}/converse-stream",
|
268 + | None,
|
269 + | ));
|
265 270 | impl ConverseStreamInput {
|
266 271 | /// The schema for this shape.
|
267 272 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CONVERSESTREAMINPUT_SCHEMA;
|
268 273 | }
|
269 274 | impl ::aws_smithy_schema::serde::SerializableStruct for ConverseStreamInput {
|
270 275 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
271 276 | fn serialize_members(
|
272 277 | &self,
|
273 278 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
274 279 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
275 280 | if let Some(ref val) = self.model_id {
|
276 281 | ser.write_string(&CONVERSESTREAMINPUT_MEMBER_MODEL_ID, val)?;
|
277 282 | }
|
278 283 | if let Some(ref val) = self.messages {
|
279 284 | ser.write_list(
|
280 285 | &CONVERSESTREAMINPUT_MEMBER_MESSAGES,
|
281 286 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
282 287 | for item in val {
|
283 288 | ser.write_struct(crate::types::Message::SCHEMA, item)?;
|
284 289 | }
|
285 290 | Ok(())
|
286 291 | },
|
287 292 | )?;
|
288 293 | }
|
289 294 | if let Some(ref val) = self.system {
|
290 295 | ser.write_list(
|
291 296 | &CONVERSESTREAMINPUT_MEMBER_SYSTEM,
|
292 297 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
293 298 | for item in val {
|
294 - | todo!("schema: unsupported list element type");
|
299 + | ser.write_struct(crate::types::SystemContentBlock::SCHEMA, item)?;
|
295 300 | }
|
296 301 | Ok(())
|
297 302 | },
|
298 303 | )?;
|
299 304 | }
|
300 305 | if let Some(ref val) = self.inference_config {
|
301 306 | ser.write_struct(&CONVERSESTREAMINPUT_MEMBER_INFERENCE_CONFIG, val)?;
|
302 307 | }
|
303 308 | if let Some(ref val) = self.tool_config {
|
304 309 | ser.write_struct(&CONVERSESTREAMINPUT_MEMBER_TOOL_CONFIG, val)?;
|
305 310 | }
|
306 311 | if let Some(ref val) = self.guardrail_config {
|
307 312 | ser.write_struct(&CONVERSESTREAMINPUT_MEMBER_GUARDRAIL_CONFIG, val)?;
|
308 313 | }
|
309 314 | if let Some(ref val) = self.additional_model_request_fields {
|
310 315 | ser.write_document(&CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS, val)?;
|
311 316 | }
|
312 317 | if let Some(ref val) = self.prompt_variables {
|
313 318 | ser.write_map(
|
314 319 | &CONVERSESTREAMINPUT_MEMBER_PROMPT_VARIABLES,
|
315 320 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
316 321 | for (key, value) in val {
|
317 322 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
318 - | todo!("schema: unsupported map value type");
|
323 + | ser.write_struct(crate::types::PromptVariableValues::SCHEMA, value)?;
|
319 324 | }
|
320 325 | Ok(())
|
321 326 | },
|
322 327 | )?;
|
323 328 | }
|
324 329 | if let Some(ref val) = self.additional_model_response_field_paths {
|
325 330 | ser.write_list(
|
326 331 | &CONVERSESTREAMINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS,
|
327 332 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
328 333 | for item in val {
|
329 334 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
330 335 | }
|
331 336 | Ok(())
|
332 337 | },
|
333 338 | )?;
|
334 339 | }
|
335 340 | if let Some(ref val) = self.request_metadata {
|
336 341 | ser.write_map(
|
337 342 | &CONVERSESTREAMINPUT_MEMBER_REQUEST_METADATA,
|
338 343 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
339 344 | for (key, value) in val {
|
340 345 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
341 346 | ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
|
342 347 | }
|
343 348 | Ok(())
|
344 349 | },
|
345 350 | )?;
|
346 351 | }
|
347 352 | if let Some(ref val) = self.performance_config {
|
348 353 | ser.write_struct(&CONVERSESTREAMINPUT_MEMBER_PERFORMANCE_CONFIG, val)?;
|
349 354 | }
|
350 355 | Ok(())
|
351 356 | }
|
352 357 | }
|
353 358 | impl ConverseStreamInput {
|
354 359 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
355 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
356 - | deserializer: &mut D,
|
360 + | pub fn deserialize(
|
361 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
357 362 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
358 363 | #[allow(unused_variables, unused_mut)]
|
359 364 | let mut builder = Self::builder();
|
360 365 | #[allow(
|
361 366 | unused_variables,
|
362 367 | unreachable_code,
|
363 368 | clippy::single_match,
|
364 369 | clippy::match_single_binding,
|
365 370 | clippy::diverging_sub_expression
|
366 371 | )]
|
367 - | deserializer.read_struct(&CONVERSESTREAMINPUT_SCHEMA, (), |_, member, deser| {
|
372 + | deserializer.read_struct(&CONVERSESTREAMINPUT_SCHEMA, &mut |member, deser| {
|
368 373 | match member.member_index() {
|
369 374 | Some(0) => {
|
370 375 | builder.model_id = Some(deser.read_string(member)?);
|
371 376 | }
|
372 377 | Some(1) => {
|
373 378 | builder.messages = Some({
|
374 - | let container = if let Some(cap) = deser.container_size() {
|
375 - | Vec::with_capacity(cap)
|
376 - | } else {
|
377 - | Vec::new()
|
378 - | };
|
379 - | deser.read_list(member, container, |mut list, deser| {
|
380 - | list.push(crate::types::Message::deserialize(deser)?);
|
381 - | Ok(list)
|
382 - | })?
|
379 + | let mut container = Vec::new();
|
380 + | deser.read_list(member, &mut |deser| {
|
381 + | container.push(crate::types::Message::deserialize(deser)?);
|
382 + | Ok(())
|
383 + | })?;
|
384 + | container
|
383 385 | });
|
384 386 | }
|
385 387 | Some(2) => {
|
386 388 | builder.system = Some({
|
387 - | let container = if let Some(cap) = deser.container_size() {
|
388 - | Vec::with_capacity(cap)
|
389 - | } else {
|
390 - | Vec::new()
|
391 - | };
|
392 - | deser.read_list(member, container, |mut list, deser| {
|
393 - | list.push(todo!("deserialize nested aggregate"));
|
394 - | Ok(list)
|
395 - | })?
|
389 + | let mut container = Vec::new();
|
390 + | deser.read_list(member, &mut |deser| {
|
391 + | container.push(crate::types::SystemContentBlock::deserialize(deser)?);
|
392 + | Ok(())
|
393 + | })?;
|
394 + | container
|
396 395 | });
|
397 396 | }
|
398 397 | Some(3) => {
|
399 398 | builder.inference_config = Some(crate::types::InferenceConfiguration::deserialize(deser)?);
|
400 399 | }
|
401 400 | Some(4) => {
|
402 401 | builder.tool_config = Some(crate::types::ToolConfiguration::deserialize(deser)?);
|
403 402 | }
|
404 403 | Some(5) => {
|
405 404 | builder.guardrail_config = Some(crate::types::GuardrailStreamConfiguration::deserialize(deser)?);
|
406 405 | }
|
407 406 | Some(6) => {
|
408 407 | builder.additional_model_request_fields = Some(deser.read_document(member)?);
|
409 408 | }
|
410 409 | Some(7) => {
|
411 410 | builder.prompt_variables = Some({
|
412 - | let container = if let Some(cap) = deser.container_size() {
|
413 - | std::collections::HashMap::with_capacity(cap)
|
414 - | } else {
|
415 - | std::collections::HashMap::new()
|
416 - | };
|
417 - | deser.read_map(member, container, |mut map, key, deser| {
|
418 - | map.insert(key, todo!("deserialize nested aggregate"));
|
419 - | Ok(map)
|
420 - | })?
|
411 + | let mut container = std::collections::HashMap::new();
|
412 + | deser.read_map(member, &mut |key, deser| {
|
413 + | container.insert(key, crate::types::PromptVariableValues::deserialize(deser)?);
|
414 + | Ok(())
|
415 + | })?;
|
416 + | container
|
421 417 | });
|
422 418 | }
|
423 419 | Some(8) => {
|
424 - | builder.additional_model_response_field_paths = Some({
|
425 - | let container = if let Some(cap) = deser.container_size() {
|
426 - | Vec::with_capacity(cap)
|
427 - | } else {
|
428 - | Vec::new()
|
429 - | };
|
430 - | deser.read_list(member, container, |mut list, deser| {
|
431 - | list.push(deser.read_string(member)?);
|
432 - | Ok(list)
|
433 - | })?
|
434 - | });
|
420 + | builder.additional_model_response_field_paths = Some(deser.read_string_list(member)?);
|
435 421 | }
|
436 422 | Some(9) => {
|
437 - | builder.request_metadata = Some({
|
438 - | let container = if let Some(cap) = deser.container_size() {
|
439 - | std::collections::HashMap::with_capacity(cap)
|
440 - | } else {
|
441 - | std::collections::HashMap::new()
|
442 - | };
|
443 - | deser.read_map(member, container, |mut map, key, deser| {
|
444 - | map.insert(key, deser.read_string(member)?);
|
445 - | Ok(map)
|
446 - | })?
|
447 - | });
|
423 + | builder.request_metadata = Some(deser.read_string_string_map(member)?);
|
448 424 | }
|
449 425 | Some(10) => {
|
450 426 | builder.performance_config = Some(crate::types::PerformanceConfiguration::deserialize(deser)?);
|
451 427 | }
|
452 428 | _ => {}
|
453 429 | }
|
454 430 | Ok(())
|
455 431 | })?;
|
432 + | builder.model_id = builder.model_id.or(Some(String::new()));
|
456 433 | builder
|
457 434 | .build()
|
458 435 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
459 436 | }
|
460 437 | }
|
438 + | impl ConverseStreamInput {
|
439 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
440 + | pub fn deserialize_with_response(
|
441 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
442 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
443 + | _status: u16,
|
444 + | _body: &[u8],
|
445 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
446 + | Self::deserialize(deserializer)
|
447 + | }
|
448 + | }
|
461 449 | impl ConverseStreamInput {
|
462 450 | /// Creates a new builder-style object to manufacture [`ConverseStreamInput`](crate::operation::converse_stream::ConverseStreamInput).
|
463 451 | pub fn builder() -> crate::operation::converse_stream::builders::ConverseStreamInputBuilder {
|
464 452 | crate::operation::converse_stream::builders::ConverseStreamInputBuilder::default()
|
465 453 | }
|
466 454 | }
|
467 455 |
|
468 456 | /// A builder for [`ConverseStreamInput`](crate::operation::converse_stream::ConverseStreamInput).
|
469 457 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
|
470 458 | #[non_exhaustive]
|