|
1 | 1 | {
|
2 | 2 | "name": "Query Assist Agent",
|
3 |
| - "description": "Create a Query Assist Agent using Bedrock and Sagemaker models", |
| 3 | + "description": "Create a Query Assist Agent using Claude on BedRock", |
4 | 4 | "use_case": "REGISTER_AGENT",
|
5 | 5 | "version": {
|
6 | 6 | "template": "1.0.0",
|
7 |
| - "compatibility": [ |
8 |
| - "2.12.0", |
9 |
| - "3.0.0" |
10 |
| - ] |
| 7 | + "compatibility": ["2.13.0", "3.0.0"] |
11 | 8 | },
|
12 | 9 | "workflows": {
|
13 | 10 | "provision": {
|
| 11 | + "user_params": {}, |
14 | 12 | "nodes": [
|
15 | 13 | {
|
16 |
| - "id": "create_openai_connector", |
| 14 | + "id": "create_claude_connector", |
17 | 15 | "type": "create_connector",
|
| 16 | + "previous_node_inputs": {}, |
18 | 17 | "user_inputs": {
|
19 |
| - "name": "OpenAI Chat Connector", |
20 |
| - "description": "The connector to public OpenAI model service for GPT 3.5", |
21 | 18 | "version": "1",
|
22 |
| - "protocol": "http", |
23 |
| - "parameters": { |
24 |
| - "endpoint": "api.openai.com", |
25 |
| - "model": "gpt-3.5-turbo" |
26 |
| - }, |
27 |
| - "credential": { |
28 |
| - "openAI_key": "PUT_YOUR_API_KEY_HERE" |
29 |
| - }, |
| 19 | + "name": "Claude instant runtime Connector", |
| 20 | + "protocol": "aws_sigv4", |
| 21 | + "description": "The connector to BedRock service for Claude model", |
30 | 22 | "actions": [
|
31 | 23 | {
|
32 |
| - "action_type": "predict", |
| 24 | + "headers": { |
| 25 | + "x-amz-content-sha256": "required", |
| 26 | + "content-type": "application/json" |
| 27 | + }, |
33 | 28 | "method": "POST",
|
34 |
| - "url": "https://${parameters.endpoint}/v1/chat/completions" |
| 29 | + "request_body": "{\"prompt\":\"${parameters.prompt}\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }", |
| 30 | + "action_type": "predict", |
| 31 | + "url": "https://bedrock-runtime.us-west-2.amazonaws.com/model/anthropic.claude-instant-v1/invoke" |
35 | 32 | }
|
36 |
| - ] |
| 33 | + ], |
| 34 | + "credential": { |
| 35 | + "access_key": "<YOUR_ACCESS_KEY>", |
| 36 | + "secret_key": "<YOUR_SECRET_KEY>", |
| 37 | + "session_token": "<YOUR_SESSION_TOKEN>" |
| 38 | + }, |
| 39 | + "parameters": { |
| 40 | + "region": "us-west-2", |
| 41 | + "endpoint": "bedrock-runtime.us-west-2.amazonaws.com", |
| 42 | + "content_type": "application/json", |
| 43 | + "auth": "Sig_V4", |
| 44 | + "max_tokens_to_sample": "8000", |
| 45 | + "service_name": "bedrock", |
| 46 | + "temperature": "0.0001", |
| 47 | + "response_filter": "$.completion", |
| 48 | + "anthropic_version": "bedrock-2023-05-31" |
| 49 | + } |
37 | 50 | }
|
38 | 51 | },
|
39 | 52 | {
|
40 |
| - "id": "register_openai_model", |
| 53 | + "id": "register_claude_model", |
41 | 54 | "type": "register_remote_model",
|
42 | 55 | "previous_node_inputs": {
|
43 |
| - "create_openai_connector": "connector_id" |
| 56 | + "create_claude_connector": "connector_id" |
44 | 57 | },
|
45 | 58 | "user_inputs": {
|
46 |
| - "name": "openAI-gpt-3.5-turbo", |
47 |
| - "deploy": true |
| 59 | + "description": "Claude model", |
| 60 | + "deploy": true, |
| 61 | + "name": "claude-instant", |
| 62 | + "guardrails": { |
| 63 | + "type": "local_regex", |
| 64 | + "input_guardrail": { |
| 65 | + "stop_words": [ |
| 66 | + { |
| 67 | + "index_name": "words0", |
| 68 | + "source_fields": ["title"] |
| 69 | + } |
| 70 | + ], |
| 71 | + "regex": ["regex1", "regex2"] |
| 72 | + }, |
| 73 | + "output_guardrail": { |
| 74 | + "stop_words": [ |
| 75 | + { |
| 76 | + "index_name": "words0", |
| 77 | + "source_fields": ["title"] |
| 78 | + } |
| 79 | + ], |
| 80 | + "regex": ["regex1", "regex2"] |
| 81 | + } |
| 82 | + } |
48 | 83 | }
|
49 | 84 | },
|
50 | 85 | {
|
51 | 86 | "id": "TransferQuestionToPPLAndExecuteTool",
|
52 | 87 | "type": "create_tool",
|
53 | 88 | "previous_node_inputs": {
|
54 |
| - "register_openai_model": "model_id" |
| 89 | + "register_claude_model": "model_id" |
55 | 90 | },
|
56 | 91 | "user_inputs": {
|
57 | 92 | "type": "PPLTool",
|
58 | 93 | "name": "TransferQuestionToPPLAndExecuteTool",
|
59 | 94 | "description": "Use this tool to transfer natural language to generate PPL and execute PPL to query inside. Use this tool after you know the index name, otherwise, call IndexRoutingTool first. The input parameters are: {index:IndexName, question:UserQuestion}",
|
60 | 95 | "parameters": {
|
61 | 96 | "response_filter": "$.completion",
|
62 |
| - "execute": false, |
63 |
| - "model_type": "openai" |
| 97 | + "execute": false |
64 | 98 | },
|
65 | 99 | "include_output_in_agent_response": true
|
66 | 100 | }
|
67 | 101 | },
|
68 |
| - { |
69 |
| - "id": "ppl_agent", |
70 |
| - "type": "register_agent", |
71 |
| - "previous_node_inputs": { |
72 |
| - "TransferQuestionToPPLAndExecuteTool": "tools" |
73 |
| - }, |
74 |
| - "user_inputs": { |
75 |
| - "parameters": { |
76 |
| - }, |
77 |
| - "app_type": "query_assist", |
78 |
| - "name": "PPL agent", |
79 |
| - "description": "this is the PPL agent", |
80 |
| - "type": "flow" |
81 |
| - } |
82 |
| - }, |
83 | 102 | {
|
84 | 103 | "id": "summarize_success_tool",
|
85 | 104 | "type": "create_tool",
|
86 | 105 | "previous_node_inputs": {
|
87 |
| - "register_openai_model": "model_id" |
| 106 | + "register_claude_model": "model_id" |
88 | 107 | },
|
89 | 108 | "user_inputs": {
|
90 | 109 | "type": "MLModelTool",
|
|
96 | 115 | }
|
97 | 116 | }
|
98 | 117 | },
|
99 |
| - { |
100 |
| - "id": "response_summary_agent", |
101 |
| - "type": "register_agent", |
102 |
| - "previous_node_inputs": { |
103 |
| - "summarize_success_tool": "tools" |
104 |
| - }, |
105 |
| - "user_inputs": { |
106 |
| - "parameters": { |
107 |
| - }, |
108 |
| - "app_type": "query_assist", |
109 |
| - "name": "Response summary agent", |
110 |
| - "description": "this is the summarize success PPL response agent", |
111 |
| - "type": "flow" |
112 |
| - } |
113 |
| - }, |
114 | 118 | {
|
115 | 119 | "id": "summarize_error_tool",
|
116 | 120 | "type": "create_tool",
|
117 | 121 | "previous_node_inputs": {
|
118 |
| - "register_openai_model": "model_id" |
| 122 | + "register_claude_model": "model_id" |
119 | 123 | },
|
120 | 124 | "user_inputs": {
|
121 | 125 | "type": "MLModelTool",
|
|
132 | 136 | "id": "suggestions_tool",
|
133 | 137 | "type": "create_tool",
|
134 | 138 | "previous_node_inputs": {
|
135 |
| - "register_openai_model": "model_id" |
| 139 | + "register_claude_model": "model_id" |
136 | 140 | },
|
137 | 141 | "user_inputs": {
|
138 | 142 | "type": "MLModelTool",
|
|
146 | 150 | }
|
147 | 151 | },
|
148 | 152 | {
|
149 |
| - "id": "error_summary_agent", |
| 153 | + "id": "ppl_agent", |
150 | 154 | "type": "register_agent",
|
151 | 155 | "previous_node_inputs": {
|
152 |
| - "summarize_error_tool": "tools", |
153 |
| - "suggestions_tool": "tools" |
| 156 | + "TransferQuestionToPPLAndExecuteTool": "tools" |
154 | 157 | },
|
155 | 158 | "user_inputs": {
|
156 |
| - "parameters": { |
157 |
| - }, |
| 159 | + "parameters": {}, |
158 | 160 | "app_type": "query_assist",
|
159 |
| - "name": "Error summary agent", |
160 |
| - "description": "this is the agent for summarizing PPL error and give suggested questions", |
161 |
| - "tools_order": [ |
162 |
| - "summarize_error_tool", |
163 |
| - "suggestions_tool" |
164 |
| - ], |
165 |
| - "type": "flow" |
166 |
| - } |
167 |
| - }, |
168 |
| - { |
169 |
| - "id": "ppl_agent_tool", |
170 |
| - "type": "create_tool", |
171 |
| - "previous_node_inputs": { |
172 |
| - "ppl_agent": "agent_id" |
173 |
| - }, |
174 |
| - "user_inputs": { |
175 |
| - "description": "PPL Agent Tool", |
176 |
| - "include_output_in_agent_response": true, |
177 |
| - "type": "AgentTool", |
178 |
| - "parameters": { |
179 |
| - "max_iteration": "5" |
180 |
| - }, |
181 |
| - "name": "PPLAgentTool" |
182 |
| - } |
183 |
| - }, |
184 |
| - { |
185 |
| - "id": "response_summary_agent_tool", |
186 |
| - "type": "create_tool", |
187 |
| - "previous_node_inputs": { |
188 |
| - "response_summary_agent": "agent_id" |
189 |
| - }, |
190 |
| - "user_inputs": { |
191 |
| - "description": "Response Summary Agent Tool", |
192 |
| - "include_output_in_agent_response": true, |
193 |
| - "type": "AgentTool", |
194 |
| - "parameters": { |
195 |
| - "max_iteration": "5" |
196 |
| - }, |
197 |
| - "name": "ResponseSummaryPPLAgentTool" |
198 |
| - } |
199 |
| - }, |
200 |
| - { |
201 |
| - "id": "error_summary_agent_tool", |
202 |
| - "type": "create_tool", |
203 |
| - "previous_node_inputs": { |
204 |
| - "error_summary_agent": "agent_id" |
205 |
| - }, |
206 |
| - "user_inputs": { |
207 |
| - "description": "Error Summary Agent Tool", |
208 |
| - "include_output_in_agent_response": true, |
209 |
| - "type": "AgentTool", |
210 |
| - "parameters": { |
211 |
| - "max_iteration": "5" |
212 |
| - }, |
213 |
| - "name": "ErrorSummaryAgentTool" |
214 |
| - } |
215 |
| - }, |
216 |
| - { |
217 |
| - "id": "root_agent", |
218 |
| - "type": "register_agent", |
219 |
| - "previous_node_inputs": { |
220 |
| - "ppl_agent_tool": "tools", |
221 |
| - "response_summary_agent_tool": "tools", |
222 |
| - "error_summary_agent_tool": "tools", |
223 |
| - "register_openai_model": "model_id" |
224 |
| - }, |
225 |
| - "user_inputs": { |
226 |
| - "parameters": { |
227 |
| - "prompt": "Answer the question as best you can." |
228 |
| - }, |
229 |
| - "app_type": "chatbot", |
230 |
| - "name": "Root agent", |
231 |
| - "description": "this is the root agent", |
232 |
| - "tools_order": [ |
233 |
| - "ppl_agent_tool", |
234 |
| - "response_summary_agent_tool", |
235 |
| - "error_summary_agent_tool" |
236 |
| - ], |
237 |
| - "memory": { |
238 |
| - "type": "conversation_index" |
239 |
| - }, |
| 161 | + "name": "PPL agent", |
| 162 | + "description": "this is the PPL agent", |
240 | 163 | "type": "flow"
|
241 | 164 | }
|
242 | 165 | }
|
|
0 commit comments