forked from opensearch-project/flow-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmulti-modal-search-with-bedrock-titan-template.json
129 lines (129 loc) · 4.5 KB
/
multi-modal-search-with-bedrock-titan-template.json
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
{
"name": "${{template.name}}",
"description": "${{template.description}}",
"use_case": "MULTIMODAL_SEARCH",
"version": {
"template": "1.0.0",
"compatibility": [
"2.12.0",
"3.0.0"
]
},
"workflows": {
"provision": {
"nodes": [
{
"id": "create_connector",
"type": "create_connector",
"user_inputs": {
"name": "${{create_connector.name}}",
"description": "${{create_connector.description}}",
"version": "1",
"protocol": "aws_sigv4",
"parameters": {
"region": "${{create_connector.region}}",
"service_name": "bedrock",
"input_docs_processed_step_size": "${{create_connector.input_docs_processed_step_size}}"
},
"credential": {
"access_key": "${{create_connector.credential.access_key}}",
"secret_key": "${{create_connector.credential.secret_key}}",
"session_token": "${{create_connector.credential.session_token}}"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "${{create_connector.actions.url}}",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "${{create_connector.actions.request_body}}",
"pre_process_function": "${{create_connector.actions.pre_process_function}}",
"post_process_function": "${{create_connector.actions.post_process_function}}"
}
]
}
},
{
"id": "register_model",
"type": "register_remote_model",
"previous_node_inputs": {
"create_connector": "parameters"
},
"user_inputs": {
"name": "${{register_remote_model.name}}",
"function_name": "remote",
"description": "${{register_remote_model.description}}",
"deploy" : true
}
},
{
"id": "create_ingest_pipeline",
"type": "create_ingest_pipeline",
"previous_node_inputs": {
"register_model": "model_id"
},
"user_inputs": {
"pipeline_id": "${{create_ingest_pipeline.pipeline_id}}",
"configurations": {
"description": "${{create_ingest_pipeline.description}}",
"processors": [
{
"text_image_embedding": {
"model_id": "${{register_model.model_id}}",
"embedding": "${{text_image_embedding.create_ingest_pipeline.embedding}}",
"field_map": {
"text": "${{text_image_embedding.field_map.text}}",
"image": "${{text_image_embedding.field_map.image}}"
}
}
}
]
}
}
},
{
"id": "create_index",
"type": "create_index",
"previous_node_inputs": {
"create_ingest_pipeline": "pipeline_id"
},
"user_inputs": {
"index_name": "${{create_index.name}}",
"configurations": {
"settings": {
"index.knn": true,
"default_pipeline": "${{create_ingest_pipeline.pipeline_id}}",
"number_of_shards": "${{create_index.settings.number_of_shards}}"
},
"mappings": {
"properties": {
"id": {
"type": "text"
},
"${{text_image_embedding.create_ingest_pipeline.embedding}}": {
"type": "knn_vector",
"dimension": "${{text_image_embedding.field_map.output.dimension}}",
"method": {
"engine": "${{create_index.mappings.method.engine}}",
"name": "${{create_index.mappings.method.name}}",
"parameters": {}
}
},
"${{text_image_embedding.field_map.text}}": {
"type": "text"
},
"${{text_image_embedding.field_map.image}}": {
"type": "binary"
}
}
}
}
}
}
]
}
}
}