-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
355 lines (306 loc) · 10.3 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
variable "name" {
description = "Name for the agent."
type = string
}
variable "alias_name" {
description = "Name for the agent alias."
type = string
}
variable "alias_description" {
description = "Description for the agent alias."
type = string
default = null
}
variable "agent_model_id" {
description = "Model identifier for agent."
type = string
default = "anthropic.claude-v2"
}
variable "agent_instructions" {
description = "Model identifier for agent."
type = string
}
variable "knowledgebase_name" {
description = "Name for the knowledgebase."
type = string
}
variable "knowledgebase_description" {
description = "Description for the knowledgebase."
type = string
}
variable "knowledgebase_model_id" {
description = "Model identifier for Knowledgebase."
type = string
default = "amazon.titan-embed-text-v1"
}
variable "knowledgebase_data_deletion_policy" {
description = "Data deletion policy for a data source. Valid values: `RETAIN`, `DELETE`"
type = string
default = "RETAIN"
}
variable "s3_configuration" {
description = "ARN of S3 bucket with data"
type = object({
bucket_arn = string
bucket_owner_account_id = optional(string)
inclusion_prefixes = optional(set(string))
})
validation {
condition = var.s3_configuration.inclusion_prefixes == null ? true : length(var.s3_configuration.inclusion_prefixes) == 1
error_message = "For now s3 data source support only one prefix."
}
}
variable "vector_ingestion_configuration" {
type = object({
chunking_configuration = object({
chunking_strategy = string
fixed_size_chunking_configuration = optional(object({
max_tokens = number
overlap_percentage = optional(number)
}))
hierarchical_chunking_configuration = optional(object({
overlap_tokens = number
level_1 = object({ max_tokens = number })
level_2 = object({ max_tokens = number })
}))
semantic_chunking_configuration = optional(object({
breakpoint_percentile_threshold = number
buffer_size = number
max_token = number
}))
})
custom_transformation_configuration = optional(object({
intermediate_storage = string
transformation_function = string
}))
})
default = {
chunking_configuration = {
chunking_strategy = "FIXED_SIZE"
fixed_size_chunking_configuration = {
max_tokens = 300
overlap_percentage = 20
}
hierarchical_chunking_configuration = null
semantic_chunking_configuration = null
}
}
}
variable "oss_collection_name" {
description = "Name of OpenSearch Serverless Collection."
type = string
}
variable "oss_additional_roles_arns" {
description = "Additional ARNs of roles to access OpenSearch"
type = list(string)
default = []
}
# KNOWLEDGE_BASE_RESPONSE_GENERATION Configuration
variable "knowledge_base_response_generation_prompt_template" {
description = "Prompt template for pre-processing."
type = string
default = <<EOF
You are a helpful assistant. Answer the following question using the context provided:
Question: {question}
Context: {context}
Your response should be thoughtful, detailed, and relevant to the provided context.
EOF
}
variable "knowledge_base_response_generation_parser_mode" {
description = "Parser mode for pre-processing."
type = string
default = "DEFAULT"
}
variable "knowledge_base_response_generation_prompt_creation_mode" {
description = "Prompt creation mode for pre-processing."
type = string
default = "OVERRIDDEN"
}
variable "knowledge_base_response_generation_prompt_state" {
description = "Prompt state for pre-processing."
type = string
default = "ENABLED"
}
variable "knowledge_base_response_generation_max_length" {
description = "Maximum number of tokens to allow in the generated response."
type = number
default = 512
}
variable "knowledge_base_response_generation_stop_sequences" {
description = "List of stop sequences that will stop generation."
type = list(string)
default = ["END"]
}
variable "knowledge_base_response_generation_temperature" {
description = "Likelihood of the model selecting higher-probability options while generating a response."
type = number
default = 0.7
}
variable "knowledge_base_response_generation_top_k" {
description = "Number of top most-likely candidates from which the model chooses the next token."
type = number
default = 50
}
variable "knowledge_base_response_generation_top_p" {
description = "Top percentage of the probability distribution of next tokens, from which the model chooses the next token."
type = number
default = 0.9
}
# PRE_PROCESSING Configuration
variable "pre_processing_prompt_template" {
description = "Prompt template for pre-processing."
type = string
default = <<EOF
You are preparing the input. Extract relevant context and pre-process the following question:
Question: {question}
Context: {context}
Pre-processing should focus on extracting the core information.
EOF
}
variable "pre_processing_parser_mode" {
description = "Parser mode for pre-processing."
type = string
default = "DEFAULT" # Change to OVERRIDDEN if necessary
}
variable "pre_processing_prompt_creation_mode" {
description = "Prompt creation mode for pre-processing."
type = string
default = "OVERRIDDEN"
}
variable "pre_processing_prompt_state" {
description = "Prompt state for pre-processing."
type = string
default = "ENABLED"
}
variable "pre_processing_max_length" {
description = "Maximum number of tokens to allow in the generated response."
type = number
default = 512
}
variable "pre_processing_stop_sequences" {
description = "List of stop sequences that will stop generation."
type = list(string)
default = ["END"]
}
variable "pre_processing_temperature" {
description = "Likelihood of the model selecting higher-probability options while generating a response."
type = number
default = 0.7
}
variable "pre_processing_top_k" {
description = "Number of top most-likely candidates from which the model chooses the next token."
type = number
default = 50
}
variable "pre_processing_top_p" {
description = "Top percentage of the probability distribution of next tokens, from which the model chooses the next token."
type = number
default = 0.9
}
# ORCHESTRATION Configuration
variable "orchestration_prompt_template" {
description = "Prompt template for orchestration."
type = string
default = <<EOF
You are orchestrating the flow of the agent. Based on the question and context, determine the next steps in the process:
Question: {question}
Context: {context}
Plan the next steps to follow the best strategy.
EOF
}
variable "orchestration_parser_mode" {
description = "Parser mode for orchestration."
type = string
default = "DEFAULT"
}
variable "orchestration_prompt_creation_mode" {
description = "Prompt creation mode for orchestration."
type = string
default = "OVERRIDDEN"
}
variable "orchestration_prompt_state" {
description = "Prompt state for orchestration."
type = string
default = "ENABLED"
}
variable "orchestration_max_length" {
description = "Maximum number of tokens to allow in the generated response."
type = number
default = 512
}
variable "orchestration_stop_sequences" {
description = "List of stop sequences that will stop generation."
type = list(string)
default = ["END"]
}
variable "orchestration_temperature" {
description = "Likelihood of the model selecting higher-probability options while generating a response."
type = number
default = 0.7
}
variable "orchestration_top_k" {
description = "Number of top most-likely candidates from which the model chooses the next token."
type = number
default = 50
}
variable "orchestration_top_p" {
description = "Top percentage of the probability distribution of next tokens, from which the model chooses the next token."
type = number
default = 0.9
}
# POST_PROCESSING Configuration
variable "post_processing_prompt_template" {
description = "Prompt template for post-processing."
type = string
default = <<EOF
You are performing post-processing. Review the agent's output and refine the response for clarity and relevance:
Response: {response}
Context: {context}
Ensure the output is polished and aligns with the context.
EOF
}
variable "post_processing_parser_mode" {
description = "Parser mode for post-processing."
type = string
default = "DEFAULT"
}
variable "post_processing_prompt_creation_mode" {
description = "Prompt creation mode for post-processing."
type = string
default = "OVERRIDDEN"
}
variable "post_processing_prompt_state" {
description = "Prompt state for post-processing."
type = string
default = "DISABLED"
}
variable "post_processing_max_length" {
description = "Maximum number of tokens to allow in the generated response."
type = number
default = 512
}
variable "post_processing_stop_sequences" {
description = "List of stop sequences that will stop generation."
type = list(string)
default = ["END"]
}
variable "post_processing_temperature" {
description = "Likelihood of the model selecting higher-probability options while generating a response."
type = number
default = 0.7
}
variable "post_processing_top_k" {
description = "Number of top most-likely candidates from which the model chooses the next token."
type = number
default = 50
}
variable "post_processing_top_p" {
description = "Top percentage of the probability distribution of next tokens, from which the model chooses the next token."
type = number
default = 0.9
}
variable "tags" {
description = "A map of tags to assign to the customization job and custom model."
type = map(string)
default = {}
}