aws-sdk-qbusiness 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,19 @@ module Aws::QBusiness
38
38
  end
39
39
  end
40
40
 
41
+ class Chat
42
+ def self.build(context)
43
+ unless context.config.regional_endpoint
44
+ endpoint = context.config.endpoint.to_s
45
+ end
46
+ Aws::QBusiness::EndpointParameters.new(
47
+ region: context.config.region,
48
+ use_fips: context.config.use_fips_endpoint,
49
+ endpoint: endpoint,
50
+ )
51
+ end
52
+ end
53
+
41
54
  class ChatSync
42
55
  def self.build(context)
43
56
  unless context.config.regional_endpoint
@@ -186,11 +186,6 @@ module Aws::QBusiness
186
186
  super(context, message, data)
187
187
  end
188
188
 
189
- # @return [String]
190
- def fields
191
- @data[:fields]
192
- end
193
-
194
189
  # @return [String]
195
190
  def message
196
191
  @message || @data[:message]
@@ -200,6 +195,11 @@ module Aws::QBusiness
200
195
  def reason
201
196
  @data[:reason]
202
197
  end
198
+
199
+ # @return [String]
200
+ def fields
201
+ @data[:fields]
202
+ end
203
203
  end
204
204
 
205
205
  end
@@ -0,0 +1,170 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::QBusiness
11
+ module EventStreams
12
+ class ChatInputStream
13
+
14
+ def initialize
15
+ @event_emitter = Aws::EventEmitter.new
16
+ end
17
+
18
+ # @option params [String] :chat_mode
19
+ # The chat modes available to an Amazon Q Business end user.
20
+ #
21
+ # * `RETRIEVAL_MODE` - The default chat mode for an Amazon Q Business
22
+ # application. When this mode is enabled, Amazon Q Business generates
23
+ # responses only from data sources connected to an Amazon Q Business
24
+ # application.
25
+ #
26
+ # * `CREATOR_MODE` - By selecting this mode, users can choose to
27
+ # generate responses only from the LLM knowledge, without consulting
28
+ # connected data sources, for a chat request.
29
+ #
30
+ # * `PLUGIN_MODE` - By selecting this mode, users can choose to use
31
+ # plugins in chat.
32
+ #
33
+ # For more information, see [Admin controls and guardrails][1],
34
+ # [Plugins][2], and [Conversation settings][3].
35
+ #
36
+ #
37
+ #
38
+ # [1]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html
39
+ # [2]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html
40
+ # [3]: https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope
41
+ #
42
+ # @option params [Types::ChatModeConfiguration] :chat_mode_configuration
43
+ # Configuration information for Amazon Q Business conversation modes.
44
+ #
45
+ # For more information, see [Admin controls and guardrails][1] and
46
+ # [Conversation settings][2].
47
+ #
48
+ #
49
+ #
50
+ # [1]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html
51
+ # [2]: https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope
52
+ #
53
+ # @option params [Types::AttributeFilter] :attribute_filter
54
+ # Enables filtering of responses based on document attributes or
55
+ # metadata fields.
56
+ #
57
+ def signal_configuration_event_event(params = {})
58
+ @event_emitter.emit(:configuration_event, params)
59
+ end
60
+
61
+ # @option params [String] :user_message
62
+ # A user message in a text message input event.
63
+ #
64
+ def signal_text_event_event(params = {})
65
+ @event_emitter.emit(:text_event, params)
66
+ end
67
+
68
+ # @option params [Types::AttachmentInput] :attachment
69
+ # A file directly uploaded into a web experience chat.
70
+ #
71
+ def signal_attachment_event_event(params = {})
72
+ @event_emitter.emit(:attachment_event, params)
73
+ end
74
+
75
+ # @option params [String] :plugin_id
76
+ # The identifier of the plugin for which the action is being requested.
77
+ #
78
+ # @option params [Hash<String,Types::ActionExecutionPayloadField>] :payload
79
+ # A mapping of field names to the field values in input that an end user
80
+ # provides to Amazon Q Business requests to perform their plugin action.
81
+ #
82
+ # @option params [String] :payload_field_name_separator
83
+ # A string used to retain information about the hierarchical contexts
84
+ # within a action execution event payload.
85
+ #
86
+ def signal_action_execution_event_event(params = {})
87
+ @event_emitter.emit(:action_execution_event, params)
88
+ end
89
+
90
+ # This event has no members
91
+ def signal_end_of_input_event_event(params = {})
92
+ @event_emitter.emit(:end_of_input_event, params)
93
+ end
94
+
95
+ # @option params [Hash<String,String>] :response_map
96
+ # The mapping of key-value pairs in an authentication challenge
97
+ # response.
98
+ #
99
+ def signal_auth_challenge_response_event_event(params = {})
100
+ @event_emitter.emit(:auth_challenge_response_event, params)
101
+ end
102
+
103
+ def signal_end_stream
104
+ @event_emitter.emit(:end_stream, {})
105
+ end
106
+
107
+ # @api private
108
+ # @return Aws::EventEmitter
109
+ attr_reader :event_emitter
110
+
111
+ end
112
+
113
+ class ChatOutputStream
114
+
115
+ def initialize
116
+ @event_emitter = Aws::EventEmitter.new
117
+ end
118
+
119
+ def on_text_event_event(&block)
120
+ @event_emitter.on(:text_event, block) if block_given?
121
+ end
122
+
123
+ def on_metadata_event_event(&block)
124
+ @event_emitter.on(:metadata_event, block) if block_given?
125
+ end
126
+
127
+ def on_action_review_event_event(&block)
128
+ @event_emitter.on(:action_review_event, block) if block_given?
129
+ end
130
+
131
+ def on_failed_attachment_event_event(&block)
132
+ @event_emitter.on(:failed_attachment_event, block) if block_given?
133
+ end
134
+
135
+ def on_auth_challenge_request_event_event(&block)
136
+ @event_emitter.on(:auth_challenge_request_event, block) if block_given?
137
+ end
138
+
139
+ def on_error_event(&block)
140
+ @event_emitter.on(:error, block) if block_given?
141
+ end
142
+
143
+ def on_initial_response_event(&block)
144
+ @event_emitter.on(:initial_response, block) if block_given?
145
+ end
146
+
147
+ def on_unknown_event(&block)
148
+ @event_emitter.on(:unknown_event, block) if block_given?
149
+ end
150
+
151
+ def on_event(&block)
152
+ on_text_event_event(&block)
153
+ on_metadata_event_event(&block)
154
+ on_action_review_event_event(&block)
155
+ on_failed_attachment_event_event(&block)
156
+ on_auth_challenge_request_event_event(&block)
157
+ on_error_event(&block)
158
+ on_initial_response_event(&block)
159
+ on_unknown_event(&block)
160
+ end
161
+
162
+ # @api private
163
+ # @return Aws::EventEmitter
164
+ attr_reader :event_emitter
165
+
166
+ end
167
+
168
+ end
169
+ end
170
+
@@ -62,6 +62,8 @@ module Aws::QBusiness
62
62
  Aws::QBusiness::Endpoints::BatchDeleteDocument.build(context)
63
63
  when :batch_put_document
64
64
  Aws::QBusiness::Endpoints::BatchPutDocument.build(context)
65
+ when :chat
66
+ Aws::QBusiness::Endpoints::Chat.build(context)
65
67
  when :chat_sync
66
68
  Aws::QBusiness::Endpoints::ChatSync.build(context)
67
69
  when :create_application