aws-sdk-bedrockagentruntime 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-bedrockagentruntime/client.rb +240 -179
- data/lib/aws-sdk-bedrockagentruntime/client_api.rb +61 -51
- data/lib/aws-sdk-bedrockagentruntime/event_streams.rb +24 -24
- data/lib/aws-sdk-bedrockagentruntime/types.rb +859 -374
- data/lib/aws-sdk-bedrockagentruntime.rb +1 -1
- data/sig/client.rbs +24 -19
- data/sig/types.rbs +62 -51
- metadata +2 -2
@@ -399,30 +399,71 @@ module Aws::BedrockAgentRuntime
|
|
399
399
|
|
400
400
|
# @!group API Operations
|
401
401
|
|
402
|
-
#
|
403
|
-
# provided in the request body.
|
402
|
+
# Sends a prompt for the agent to process and respond to.
|
404
403
|
#
|
405
|
-
#
|
406
|
-
# Session state passed by customer. Base64 encoded json string
|
407
|
-
# representation of SessionState.
|
404
|
+
# <note markdown="1"> The CLI doesn't support `InvokeAgent`.
|
408
405
|
#
|
409
|
-
#
|
410
|
-
# Identifier for Agent
|
406
|
+
# </note>
|
411
407
|
#
|
412
|
-
#
|
413
|
-
#
|
408
|
+
# * To continue the same conversation with an agent, use the same
|
409
|
+
# `sessionId` value in the request.
|
414
410
|
#
|
415
|
-
#
|
416
|
-
#
|
411
|
+
# * To activate trace enablement, turn `enableTrace` to `true`. Trace
|
412
|
+
# enablement helps you follow the agent's reasoning process that led
|
413
|
+
# it to the information it processed, the actions it took, and the
|
414
|
+
# final result it yielded. For more information, see [Trace
|
415
|
+
# enablement][1].
|
416
|
+
#
|
417
|
+
# * End a conversation by setting `endSession` to `true`.
|
418
|
+
#
|
419
|
+
# * Include attributes for the session or prompt in the `sessionState`
|
420
|
+
# object.
|
421
|
+
#
|
422
|
+
# The response is returned in the `bytes` field of the `chunk` object.
|
423
|
+
#
|
424
|
+
# * The `attribution` object contains citations for parts of the
|
425
|
+
# response.
|
426
|
+
#
|
427
|
+
# * If you set `enableTrace` to `true` in the request, you can trace the
|
428
|
+
# agent's steps and reasoning process that led it to the response.
|
429
|
+
#
|
430
|
+
# * Errors are also surfaced in the response.
|
417
431
|
#
|
418
|
-
#
|
419
|
-
#
|
432
|
+
#
|
433
|
+
#
|
434
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events
|
435
|
+
#
|
436
|
+
# @option params [required, String] :agent_alias_id
|
437
|
+
# The alias of the agent to use.
|
438
|
+
#
|
439
|
+
# @option params [required, String] :agent_id
|
440
|
+
# The unique identifier of the agent to use.
|
420
441
|
#
|
421
442
|
# @option params [Boolean] :enable_trace
|
422
|
-
#
|
443
|
+
# Specifies whether to turn on the trace or not to track the agent's
|
444
|
+
# reasoning process. For more information, see [Trace enablement][1].
|
445
|
+
#
|
446
|
+
#
|
447
|
+
#
|
448
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events
|
449
|
+
#
|
450
|
+
# @option params [Boolean] :end_session
|
451
|
+
# Specifies whether to end the session with the agent or not.
|
423
452
|
#
|
424
453
|
# @option params [required, String] :input_text
|
425
|
-
#
|
454
|
+
# The prompt text to send the agent.
|
455
|
+
#
|
456
|
+
# @option params [required, String] :session_id
|
457
|
+
# The unique identifier of the session. Use the same value across
|
458
|
+
# requests to continue the same conversation.
|
459
|
+
#
|
460
|
+
# @option params [Types::SessionState] :session_state
|
461
|
+
# Contains parameters that specify various attributes of the session.
|
462
|
+
# For more information, see [Control session context][1].
|
463
|
+
#
|
464
|
+
#
|
465
|
+
#
|
466
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html
|
426
467
|
#
|
427
468
|
# @return [Types::InvokeAgentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
428
469
|
#
|
@@ -473,18 +514,24 @@ module Aws::BedrockAgentRuntime
|
|
473
514
|
# Example for registering callbacks with specific events
|
474
515
|
#
|
475
516
|
# handler = Aws::BedrockAgentRuntime::EventStreams::ResponseStream.new
|
517
|
+
# handler.on_access_denied_exception_event do |event|
|
518
|
+
# event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
|
519
|
+
# end
|
520
|
+
# handler.on_bad_gateway_exception_event do |event|
|
521
|
+
# event # => Aws::BedrockAgentRuntime::Types::badGatewayException
|
522
|
+
# end
|
476
523
|
# handler.on_chunk_event do |event|
|
477
524
|
# event # => Aws::BedrockAgentRuntime::Types::chunk
|
478
525
|
# end
|
479
|
-
# handler.
|
480
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
526
|
+
# handler.on_conflict_exception_event do |event|
|
527
|
+
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
528
|
+
# end
|
529
|
+
# handler.on_dependency_failed_exception_event do |event|
|
530
|
+
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
481
531
|
# end
|
482
532
|
# handler.on_internal_server_exception_event do |event|
|
483
533
|
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
|
484
534
|
# end
|
485
|
-
# handler.on_validation_exception_event do |event|
|
486
|
-
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
487
|
-
# end
|
488
535
|
# handler.on_resource_not_found_exception_event do |event|
|
489
536
|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
|
490
537
|
# end
|
@@ -494,17 +541,11 @@ module Aws::BedrockAgentRuntime
|
|
494
541
|
# handler.on_throttling_exception_event do |event|
|
495
542
|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
|
496
543
|
# end
|
497
|
-
# handler.
|
498
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
499
|
-
# end
|
500
|
-
# handler.on_conflict_exception_event do |event|
|
501
|
-
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
502
|
-
# end
|
503
|
-
# handler.on_dependency_failed_exception_event do |event|
|
504
|
-
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
544
|
+
# handler.on_trace_event do |event|
|
545
|
+
# event # => Aws::BedrockAgentRuntime::Types::trace
|
505
546
|
# end
|
506
|
-
# handler.
|
507
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
547
|
+
# handler.on_validation_exception_event do |event|
|
548
|
+
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
508
549
|
# end
|
509
550
|
#
|
510
551
|
# client.invoke_agent( # params input #, event_stream_handler: handler)
|
@@ -513,18 +554,24 @@ module Aws::BedrockAgentRuntime
|
|
513
554
|
# Example for registering callbacks with specific events
|
514
555
|
#
|
515
556
|
# handler = Proc.new do |stream|
|
557
|
+
# stream.on_access_denied_exception_event do |event|
|
558
|
+
# event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
|
559
|
+
# end
|
560
|
+
# stream.on_bad_gateway_exception_event do |event|
|
561
|
+
# event # => Aws::BedrockAgentRuntime::Types::badGatewayException
|
562
|
+
# end
|
516
563
|
# stream.on_chunk_event do |event|
|
517
564
|
# event # => Aws::BedrockAgentRuntime::Types::chunk
|
518
565
|
# end
|
519
|
-
# stream.
|
520
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
566
|
+
# stream.on_conflict_exception_event do |event|
|
567
|
+
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
568
|
+
# end
|
569
|
+
# stream.on_dependency_failed_exception_event do |event|
|
570
|
+
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
521
571
|
# end
|
522
572
|
# stream.on_internal_server_exception_event do |event|
|
523
573
|
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
|
524
574
|
# end
|
525
|
-
# stream.on_validation_exception_event do |event|
|
526
|
-
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
527
|
-
# end
|
528
575
|
# stream.on_resource_not_found_exception_event do |event|
|
529
576
|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
|
530
577
|
# end
|
@@ -534,17 +581,11 @@ module Aws::BedrockAgentRuntime
|
|
534
581
|
# stream.on_throttling_exception_event do |event|
|
535
582
|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
|
536
583
|
# end
|
537
|
-
# stream.
|
538
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
539
|
-
# end
|
540
|
-
# stream.on_conflict_exception_event do |event|
|
541
|
-
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
542
|
-
# end
|
543
|
-
# stream.on_dependency_failed_exception_event do |event|
|
544
|
-
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
584
|
+
# stream.on_trace_event do |event|
|
585
|
+
# event # => Aws::BedrockAgentRuntime::Types::trace
|
545
586
|
# end
|
546
|
-
# stream.
|
547
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
587
|
+
# stream.on_validation_exception_event do |event|
|
588
|
+
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
548
589
|
# end
|
549
590
|
# end
|
550
591
|
#
|
@@ -553,18 +594,24 @@ module Aws::BedrockAgentRuntime
|
|
553
594
|
# Usage pattern c): hybird pattern of a) and b)
|
554
595
|
#
|
555
596
|
# handler = Aws::BedrockAgentRuntime::EventStreams::ResponseStream.new
|
597
|
+
# handler.on_access_denied_exception_event do |event|
|
598
|
+
# event # => Aws::BedrockAgentRuntime::Types::accessDeniedException
|
599
|
+
# end
|
600
|
+
# handler.on_bad_gateway_exception_event do |event|
|
601
|
+
# event # => Aws::BedrockAgentRuntime::Types::badGatewayException
|
602
|
+
# end
|
556
603
|
# handler.on_chunk_event do |event|
|
557
604
|
# event # => Aws::BedrockAgentRuntime::Types::chunk
|
558
605
|
# end
|
559
|
-
# handler.
|
560
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
606
|
+
# handler.on_conflict_exception_event do |event|
|
607
|
+
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
608
|
+
# end
|
609
|
+
# handler.on_dependency_failed_exception_event do |event|
|
610
|
+
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
561
611
|
# end
|
562
612
|
# handler.on_internal_server_exception_event do |event|
|
563
613
|
# event # => Aws::BedrockAgentRuntime::Types::internalServerException
|
564
614
|
# end
|
565
|
-
# handler.on_validation_exception_event do |event|
|
566
|
-
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
567
|
-
# end
|
568
615
|
# handler.on_resource_not_found_exception_event do |event|
|
569
616
|
# event # => Aws::BedrockAgentRuntime::Types::resourceNotFoundException
|
570
617
|
# end
|
@@ -574,17 +621,11 @@ module Aws::BedrockAgentRuntime
|
|
574
621
|
# handler.on_throttling_exception_event do |event|
|
575
622
|
# event # => Aws::BedrockAgentRuntime::Types::throttlingException
|
576
623
|
# end
|
577
|
-
# handler.
|
578
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
579
|
-
# end
|
580
|
-
# handler.on_conflict_exception_event do |event|
|
581
|
-
# event # => Aws::BedrockAgentRuntime::Types::conflictException
|
582
|
-
# end
|
583
|
-
# handler.on_dependency_failed_exception_event do |event|
|
584
|
-
# event # => Aws::BedrockAgentRuntime::Types::dependencyFailedException
|
624
|
+
# handler.on_trace_event do |event|
|
625
|
+
# event # => Aws::BedrockAgentRuntime::Types::trace
|
585
626
|
# end
|
586
|
-
# handler.
|
587
|
-
# event # => Aws::BedrockAgentRuntime::Types::
|
627
|
+
# handler.on_validation_exception_event do |event|
|
628
|
+
# event # => Aws::BedrockAgentRuntime::Types::validationException
|
588
629
|
# end
|
589
630
|
#
|
590
631
|
# client.invoke_agent( # params input #, event_stream_handler: handler) do |stream|
|
@@ -607,64 +648,72 @@ module Aws::BedrockAgentRuntime
|
|
607
648
|
# @example Request syntax with placeholder values
|
608
649
|
#
|
609
650
|
# resp = client.invoke_agent({
|
651
|
+
# agent_alias_id: "AgentAliasId", # required
|
652
|
+
# agent_id: "AgentId", # required
|
653
|
+
# enable_trace: false,
|
654
|
+
# end_session: false,
|
655
|
+
# input_text: "InputText", # required
|
656
|
+
# session_id: "SessionId", # required
|
610
657
|
# session_state: {
|
611
|
-
#
|
658
|
+
# prompt_session_attributes: {
|
612
659
|
# "String" => "String",
|
613
660
|
# },
|
614
|
-
#
|
661
|
+
# session_attributes: {
|
615
662
|
# "String" => "String",
|
616
663
|
# },
|
617
664
|
# },
|
618
|
-
# agent_id: "AgentId", # required
|
619
|
-
# agent_alias_id: "AgentAliasId", # required
|
620
|
-
# session_id: "SessionId", # required
|
621
|
-
# end_session: false,
|
622
|
-
# enable_trace: false,
|
623
|
-
# input_text: "InputText", # required
|
624
665
|
# })
|
625
666
|
#
|
626
667
|
# @example Response structure
|
627
668
|
#
|
628
669
|
# All events are available at resp.completion:
|
629
670
|
# resp.completion #=> Enumerator
|
630
|
-
# resp.completion.event_types #=> [:
|
671
|
+
# resp.completion.event_types #=> [:access_denied_exception, :bad_gateway_exception, :chunk, :conflict_exception, :dependency_failed_exception, :internal_server_exception, :resource_not_found_exception, :service_quota_exceeded_exception, :throttling_exception, :trace, :validation_exception]
|
672
|
+
#
|
673
|
+
# For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
|
674
|
+
# event.message #=> String
|
675
|
+
#
|
676
|
+
# For :bad_gateway_exception event available at #on_bad_gateway_exception_event callback and response eventstream enumerator:
|
677
|
+
# event.message #=> String
|
678
|
+
# event.resource_name #=> String
|
631
679
|
#
|
632
680
|
# For :chunk event available at #on_chunk_event callback and response eventstream enumerator:
|
633
|
-
# event.bytes #=> String
|
634
681
|
# event.attribution.citations #=> Array
|
635
|
-
# event.attribution.citations[0].generated_response_part.text_response_part.text #=> String
|
636
|
-
# event.attribution.citations[0].generated_response_part.text_response_part.span.start #=> Integer
|
637
682
|
# event.attribution.citations[0].generated_response_part.text_response_part.span.end #=> Integer
|
683
|
+
# event.attribution.citations[0].generated_response_part.text_response_part.span.start #=> Integer
|
684
|
+
# event.attribution.citations[0].generated_response_part.text_response_part.text #=> String
|
638
685
|
# event.attribution.citations[0].retrieved_references #=> Array
|
639
686
|
# event.attribution.citations[0].retrieved_references[0].content.text #=> String
|
640
|
-
# event.attribution.citations[0].retrieved_references[0].location.type #=> String, one of "S3"
|
641
687
|
# event.attribution.citations[0].retrieved_references[0].location.s3_location.uri #=> String
|
688
|
+
# event.attribution.citations[0].retrieved_references[0].location.type #=> String, one of "S3"
|
689
|
+
# event.bytes #=> String
|
690
|
+
#
|
691
|
+
# For :conflict_exception event available at #on_conflict_exception_event callback and response eventstream enumerator:
|
692
|
+
# event.message #=> String
|
693
|
+
#
|
694
|
+
# For :dependency_failed_exception event available at #on_dependency_failed_exception_event callback and response eventstream enumerator:
|
695
|
+
# event.message #=> String
|
696
|
+
# event.resource_name #=> String
|
697
|
+
#
|
698
|
+
# For :internal_server_exception event available at #on_internal_server_exception_event callback and response eventstream enumerator:
|
699
|
+
# event.message #=> String
|
700
|
+
#
|
701
|
+
# For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator:
|
702
|
+
# event.message #=> String
|
703
|
+
#
|
704
|
+
# For :service_quota_exceeded_exception event available at #on_service_quota_exceeded_exception_event callback and response eventstream enumerator:
|
705
|
+
# event.message #=> String
|
706
|
+
#
|
707
|
+
# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
|
708
|
+
# event.message #=> String
|
642
709
|
#
|
643
710
|
# For :trace event available at #on_trace_event callback and response eventstream enumerator:
|
644
|
-
# event.agent_id #=> String
|
645
711
|
# event.agent_alias_id #=> String
|
712
|
+
# event.agent_id #=> String
|
646
713
|
# event.session_id #=> String
|
647
|
-
# event.trace.
|
648
|
-
# event.trace.
|
649
|
-
# event.trace.pre_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
|
650
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.temperature #=> Float
|
651
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_p #=> Float
|
652
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_k #=> Integer
|
653
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
|
654
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
|
655
|
-
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
|
656
|
-
# event.trace.pre_processing_trace.model_invocation_input.override_lambda #=> String
|
657
|
-
# event.trace.pre_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
658
|
-
# event.trace.pre_processing_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
659
|
-
# event.trace.pre_processing_trace.model_invocation_output.trace_id #=> String
|
660
|
-
# event.trace.pre_processing_trace.model_invocation_output.parsed_response.rationale #=> String
|
661
|
-
# event.trace.pre_processing_trace.model_invocation_output.parsed_response.is_valid #=> Boolean
|
662
|
-
# event.trace.orchestration_trace.rationale.trace_id #=> String
|
663
|
-
# event.trace.orchestration_trace.rationale.text #=> String
|
664
|
-
# event.trace.orchestration_trace.invocation_input.trace_id #=> String
|
665
|
-
# event.trace.orchestration_trace.invocation_input.invocation_type #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH"
|
714
|
+
# event.trace.failure_trace.failure_reason #=> String
|
715
|
+
# event.trace.failure_trace.trace_id #=> String
|
666
716
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.action_group_name #=> String
|
667
|
-
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.verb #=> String
|
668
717
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.api_path #=> String
|
669
718
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters #=> Array
|
670
719
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.parameters[0].name #=> String
|
@@ -675,76 +724,68 @@ module Aws::BedrockAgentRuntime
|
|
675
724
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].name #=> String
|
676
725
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].type #=> String
|
677
726
|
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.request_body.content["String"][0].value #=> String
|
678
|
-
# event.trace.orchestration_trace.invocation_input.
|
727
|
+
# event.trace.orchestration_trace.invocation_input.action_group_invocation_input.verb #=> String
|
728
|
+
# event.trace.orchestration_trace.invocation_input.invocation_type #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH"
|
679
729
|
# event.trace.orchestration_trace.invocation_input.knowledge_base_lookup_input.knowledge_base_id #=> String
|
680
|
-
# event.trace.orchestration_trace.
|
681
|
-
# event.trace.orchestration_trace.
|
682
|
-
# event.trace.orchestration_trace.observation.action_group_invocation_output.text #=> String
|
683
|
-
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references #=> Array
|
684
|
-
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].content.text #=> String
|
685
|
-
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.type #=> String, one of "S3"
|
686
|
-
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.s3_location.uri #=> String
|
687
|
-
# event.trace.orchestration_trace.observation.final_response.text #=> String
|
688
|
-
# event.trace.orchestration_trace.observation.reprompt_response.text #=> String
|
689
|
-
# event.trace.orchestration_trace.observation.reprompt_response.source #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "PARSER"
|
690
|
-
# event.trace.orchestration_trace.model_invocation_input.trace_id #=> String
|
691
|
-
# event.trace.orchestration_trace.model_invocation_input.text #=> String
|
692
|
-
# event.trace.orchestration_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
|
693
|
-
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.temperature #=> Float
|
694
|
-
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_p #=> Float
|
695
|
-
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_k #=> Integer
|
730
|
+
# event.trace.orchestration_trace.invocation_input.knowledge_base_lookup_input.text #=> String
|
731
|
+
# event.trace.orchestration_trace.invocation_input.trace_id #=> String
|
696
732
|
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
|
697
733
|
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
|
698
734
|
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
|
735
|
+
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.temperature #=> Float
|
736
|
+
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_k #=> Integer
|
737
|
+
# event.trace.orchestration_trace.model_invocation_input.inference_configuration.top_p #=> Float
|
699
738
|
# event.trace.orchestration_trace.model_invocation_input.override_lambda #=> String
|
700
|
-
# event.trace.orchestration_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
701
739
|
# event.trace.orchestration_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
702
|
-
# event.trace.
|
703
|
-
# event.trace.
|
704
|
-
# event.trace.
|
705
|
-
# event.trace.
|
706
|
-
# event.trace.
|
707
|
-
# event.trace.
|
740
|
+
# event.trace.orchestration_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
741
|
+
# event.trace.orchestration_trace.model_invocation_input.text #=> String
|
742
|
+
# event.trace.orchestration_trace.model_invocation_input.trace_id #=> String
|
743
|
+
# event.trace.orchestration_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
|
744
|
+
# event.trace.orchestration_trace.observation.action_group_invocation_output.text #=> String
|
745
|
+
# event.trace.orchestration_trace.observation.final_response.text #=> String
|
746
|
+
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references #=> Array
|
747
|
+
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].content.text #=> String
|
748
|
+
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.s3_location.uri #=> String
|
749
|
+
# event.trace.orchestration_trace.observation.knowledge_base_lookup_output.retrieved_references[0].location.type #=> String, one of "S3"
|
750
|
+
# event.trace.orchestration_trace.observation.reprompt_response.source #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "PARSER"
|
751
|
+
# event.trace.orchestration_trace.observation.reprompt_response.text #=> String
|
752
|
+
# event.trace.orchestration_trace.observation.trace_id #=> String
|
753
|
+
# event.trace.orchestration_trace.observation.type #=> String, one of "ACTION_GROUP", "KNOWLEDGE_BASE", "FINISH", "ASK_USER", "REPROMPT"
|
754
|
+
# event.trace.orchestration_trace.rationale.text #=> String
|
755
|
+
# event.trace.orchestration_trace.rationale.trace_id #=> String
|
708
756
|
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
|
709
757
|
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
|
710
758
|
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
|
759
|
+
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.temperature #=> Float
|
760
|
+
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.top_k #=> Integer
|
761
|
+
# event.trace.post_processing_trace.model_invocation_input.inference_configuration.top_p #=> Float
|
711
762
|
# event.trace.post_processing_trace.model_invocation_input.override_lambda #=> String
|
712
|
-
# event.trace.post_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
713
763
|
# event.trace.post_processing_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
714
|
-
# event.trace.post_processing_trace.
|
764
|
+
# event.trace.post_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
765
|
+
# event.trace.post_processing_trace.model_invocation_input.text #=> String
|
766
|
+
# event.trace.post_processing_trace.model_invocation_input.trace_id #=> String
|
767
|
+
# event.trace.post_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
|
715
768
|
# event.trace.post_processing_trace.model_invocation_output.parsed_response.text #=> String
|
716
|
-
# event.trace.
|
717
|
-
# event.trace.
|
718
|
-
#
|
719
|
-
#
|
720
|
-
# event.
|
769
|
+
# event.trace.post_processing_trace.model_invocation_output.trace_id #=> String
|
770
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.maximum_length #=> Integer
|
771
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences #=> Array
|
772
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.stop_sequences[0] #=> String
|
773
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.temperature #=> Float
|
774
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_k #=> Integer
|
775
|
+
# event.trace.pre_processing_trace.model_invocation_input.inference_configuration.top_p #=> Float
|
776
|
+
# event.trace.pre_processing_trace.model_invocation_input.override_lambda #=> String
|
777
|
+
# event.trace.pre_processing_trace.model_invocation_input.parser_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
778
|
+
# event.trace.pre_processing_trace.model_invocation_input.prompt_creation_mode #=> String, one of "DEFAULT", "OVERRIDDEN"
|
779
|
+
# event.trace.pre_processing_trace.model_invocation_input.text #=> String
|
780
|
+
# event.trace.pre_processing_trace.model_invocation_input.trace_id #=> String
|
781
|
+
# event.trace.pre_processing_trace.model_invocation_input.type #=> String, one of "PRE_PROCESSING", "ORCHESTRATION", "KNOWLEDGE_BASE_RESPONSE_GENERATION", "POST_PROCESSING"
|
782
|
+
# event.trace.pre_processing_trace.model_invocation_output.parsed_response.is_valid #=> Boolean
|
783
|
+
# event.trace.pre_processing_trace.model_invocation_output.parsed_response.rationale #=> String
|
784
|
+
# event.trace.pre_processing_trace.model_invocation_output.trace_id #=> String
|
721
785
|
#
|
722
786
|
# For :validation_exception event available at #on_validation_exception_event callback and response eventstream enumerator:
|
723
787
|
# event.message #=> String
|
724
788
|
#
|
725
|
-
# For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator:
|
726
|
-
# event.message #=> String
|
727
|
-
#
|
728
|
-
# For :service_quota_exceeded_exception event available at #on_service_quota_exceeded_exception_event callback and response eventstream enumerator:
|
729
|
-
# event.message #=> String
|
730
|
-
#
|
731
|
-
# For :throttling_exception event available at #on_throttling_exception_event callback and response eventstream enumerator:
|
732
|
-
# event.message #=> String
|
733
|
-
#
|
734
|
-
# For :access_denied_exception event available at #on_access_denied_exception_event callback and response eventstream enumerator:
|
735
|
-
# event.message #=> String
|
736
|
-
#
|
737
|
-
# For :conflict_exception event available at #on_conflict_exception_event callback and response eventstream enumerator:
|
738
|
-
# event.message #=> String
|
739
|
-
#
|
740
|
-
# For :dependency_failed_exception event available at #on_dependency_failed_exception_event callback and response eventstream enumerator:
|
741
|
-
# event.message #=> String
|
742
|
-
# event.resource_name #=> String
|
743
|
-
#
|
744
|
-
# For :bad_gateway_exception event available at #on_bad_gateway_exception_event callback and response eventstream enumerator:
|
745
|
-
# event.message #=> String
|
746
|
-
# event.resource_name #=> String
|
747
|
-
#
|
748
789
|
# resp.content_type #=> String
|
749
790
|
# resp.session_id #=> String
|
750
791
|
#
|
@@ -775,24 +816,31 @@ module Aws::BedrockAgentRuntime
|
|
775
816
|
req.send_request(options, &block)
|
776
817
|
end
|
777
818
|
|
778
|
-
#
|
819
|
+
# Queries a knowledge base and retrieves information from it.
|
779
820
|
#
|
780
821
|
# @option params [required, String] :knowledge_base_id
|
781
|
-
#
|
822
|
+
# The unique identifier of the knowledge base to query.
|
782
823
|
#
|
783
|
-
# @option params [
|
784
|
-
#
|
824
|
+
# @option params [String] :next_token
|
825
|
+
# If there are more results than can fit in the response, the response
|
826
|
+
# returns a `nextToken`. Use this token in the `nextToken` field of
|
827
|
+
# another request to retrieve the next batch of results.
|
785
828
|
#
|
786
829
|
# @option params [Types::KnowledgeBaseRetrievalConfiguration] :retrieval_configuration
|
787
|
-
#
|
830
|
+
# Contains configurations for the knowledge base query and retrieval
|
831
|
+
# process. For more information, see [Query configurations][1].
|
832
|
+
#
|
788
833
|
#
|
789
|
-
#
|
790
|
-
#
|
834
|
+
#
|
835
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
|
836
|
+
#
|
837
|
+
# @option params [required, Types::KnowledgeBaseQuery] :retrieval_query
|
838
|
+
# Contains the query to send the knowledge base.
|
791
839
|
#
|
792
840
|
# @return [Types::RetrieveResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
793
841
|
#
|
794
|
-
# * {Types::RetrieveResponse#retrieval_results #retrieval_results} => Array<Types::KnowledgeBaseRetrievalResult>
|
795
842
|
# * {Types::RetrieveResponse#next_token #next_token} => String
|
843
|
+
# * {Types::RetrieveResponse#retrieval_results #retrieval_results} => Array<Types::KnowledgeBaseRetrievalResult>
|
796
844
|
#
|
797
845
|
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
798
846
|
#
|
@@ -800,26 +848,26 @@ module Aws::BedrockAgentRuntime
|
|
800
848
|
#
|
801
849
|
# resp = client.retrieve({
|
802
850
|
# knowledge_base_id: "KnowledgeBaseId", # required
|
803
|
-
#
|
804
|
-
# text: "KnowledgeBaseQueryTextString", # required
|
805
|
-
# },
|
851
|
+
# next_token: "NextToken",
|
806
852
|
# retrieval_configuration: {
|
807
853
|
# vector_search_configuration: { # required
|
808
854
|
# number_of_results: 1,
|
809
855
|
# override_search_type: "HYBRID", # accepts HYBRID, SEMANTIC
|
810
856
|
# },
|
811
857
|
# },
|
812
|
-
#
|
858
|
+
# retrieval_query: { # required
|
859
|
+
# text: "KnowledgeBaseQueryTextString", # required
|
860
|
+
# },
|
813
861
|
# })
|
814
862
|
#
|
815
863
|
# @example Response structure
|
816
864
|
#
|
865
|
+
# resp.next_token #=> String
|
817
866
|
# resp.retrieval_results #=> Array
|
818
867
|
# resp.retrieval_results[0].content.text #=> String
|
819
|
-
# resp.retrieval_results[0].location.type #=> String, one of "S3"
|
820
868
|
# resp.retrieval_results[0].location.s3_location.uri #=> String
|
869
|
+
# resp.retrieval_results[0].location.type #=> String, one of "S3"
|
821
870
|
# resp.retrieval_results[0].score #=> Float
|
822
|
-
# resp.next_token #=> String
|
823
871
|
#
|
824
872
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Retrieve AWS API Documentation
|
825
873
|
#
|
@@ -830,36 +878,47 @@ module Aws::BedrockAgentRuntime
|
|
830
878
|
req.send_request(options)
|
831
879
|
end
|
832
880
|
|
833
|
-
#
|
834
|
-
#
|
835
|
-
#
|
836
|
-
# Identifier of the session.
|
881
|
+
# Queries a knowledge base and generates responses based on the
|
882
|
+
# retrieved results. The response cites up to five sources but only
|
883
|
+
# selects the ones that are relevant to the query.
|
837
884
|
#
|
838
885
|
# @option params [required, Types::RetrieveAndGenerateInput] :input
|
839
|
-
#
|
886
|
+
# Contains the query to be made to the knowledge base.
|
840
887
|
#
|
841
888
|
# @option params [Types::RetrieveAndGenerateConfiguration] :retrieve_and_generate_configuration
|
842
|
-
#
|
889
|
+
# Contains configurations for the knowledge base query and retrieval
|
890
|
+
# process. For more information, see [Query configurations][1].
|
891
|
+
#
|
892
|
+
#
|
893
|
+
#
|
894
|
+
# [1]: https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
|
843
895
|
#
|
844
896
|
# @option params [Types::RetrieveAndGenerateSessionConfiguration] :session_configuration
|
845
|
-
#
|
897
|
+
# Contains details about the session with the knowledge base.
|
898
|
+
#
|
899
|
+
# @option params [String] :session_id
|
900
|
+
# The unique identifier of the session. Reuse the same value to continue
|
901
|
+
# the same session with the knowledge base.
|
846
902
|
#
|
847
903
|
# @return [Types::RetrieveAndGenerateResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
848
904
|
#
|
849
|
-
# * {Types::RetrieveAndGenerateResponse#session_id #session_id} => String
|
850
|
-
# * {Types::RetrieveAndGenerateResponse#output #output} => Types::RetrieveAndGenerateOutput
|
851
905
|
# * {Types::RetrieveAndGenerateResponse#citations #citations} => Array<Types::Citation>
|
906
|
+
# * {Types::RetrieveAndGenerateResponse#output #output} => Types::RetrieveAndGenerateOutput
|
907
|
+
# * {Types::RetrieveAndGenerateResponse#session_id #session_id} => String
|
852
908
|
#
|
853
909
|
# @example Request syntax with placeholder values
|
854
910
|
#
|
855
911
|
# resp = client.retrieve_and_generate({
|
856
|
-
# session_id: "SessionId",
|
857
912
|
# input: { # required
|
858
913
|
# text: "RetrieveAndGenerateInputTextString", # required
|
859
914
|
# },
|
860
915
|
# retrieve_and_generate_configuration: {
|
861
|
-
# type: "KNOWLEDGE_BASE", # required, accepts KNOWLEDGE_BASE
|
862
916
|
# knowledge_base_configuration: {
|
917
|
+
# generation_configuration: {
|
918
|
+
# prompt_template: {
|
919
|
+
# text_prompt_template: "TextPromptTemplate",
|
920
|
+
# },
|
921
|
+
# },
|
863
922
|
# knowledge_base_id: "KnowledgeBaseId", # required
|
864
923
|
# model_arn: "BedrockModelArn", # required
|
865
924
|
# retrieval_configuration: {
|
@@ -869,24 +928,26 @@ module Aws::BedrockAgentRuntime
|
|
869
928
|
# },
|
870
929
|
# },
|
871
930
|
# },
|
931
|
+
# type: "KNOWLEDGE_BASE", # required, accepts KNOWLEDGE_BASE
|
872
932
|
# },
|
873
933
|
# session_configuration: {
|
874
934
|
# kms_key_arn: "KmsKeyArn", # required
|
875
935
|
# },
|
936
|
+
# session_id: "SessionId",
|
876
937
|
# })
|
877
938
|
#
|
878
939
|
# @example Response structure
|
879
940
|
#
|
880
|
-
# resp.session_id #=> String
|
881
|
-
# resp.output.text #=> String
|
882
941
|
# resp.citations #=> Array
|
883
|
-
# resp.citations[0].generated_response_part.text_response_part.text #=> String
|
884
|
-
# resp.citations[0].generated_response_part.text_response_part.span.start #=> Integer
|
885
942
|
# resp.citations[0].generated_response_part.text_response_part.span.end #=> Integer
|
943
|
+
# resp.citations[0].generated_response_part.text_response_part.span.start #=> Integer
|
944
|
+
# resp.citations[0].generated_response_part.text_response_part.text #=> String
|
886
945
|
# resp.citations[0].retrieved_references #=> Array
|
887
946
|
# resp.citations[0].retrieved_references[0].content.text #=> String
|
888
|
-
# resp.citations[0].retrieved_references[0].location.type #=> String, one of "S3"
|
889
947
|
# resp.citations[0].retrieved_references[0].location.s3_location.uri #=> String
|
948
|
+
# resp.citations[0].retrieved_references[0].location.type #=> String, one of "S3"
|
949
|
+
# resp.output.text #=> String
|
950
|
+
# resp.session_id #=> String
|
890
951
|
#
|
891
952
|
# @see http://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerate AWS API Documentation
|
892
953
|
#
|
@@ -910,7 +971,7 @@ module Aws::BedrockAgentRuntime
|
|
910
971
|
params: params,
|
911
972
|
config: config)
|
912
973
|
context[:gem_name] = 'aws-sdk-bedrockagentruntime'
|
913
|
-
context[:gem_version] = '1.
|
974
|
+
context[:gem_version] = '1.4.0'
|
914
975
|
Seahorse::Client::Request.new(handlers, context)
|
915
976
|
end
|
916
977
|
|