Skip to content

Commit

Permalink
Add prefix and postfix in requestbody
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws committed Nov 14, 2024
1 parent b32f98b commit 9ce16b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sample-templates/alert-summary-agent-claude-tested.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"content-type": "application/json"
},
"method": "POST",
"request_body": "{\"prompt\":\"${parameters.prompt}\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }",
"request_body": "{\"prompt\":\"\\n\\nHuman: ${parameters.prompt}\\n\\nAssistant:\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }",
"action_type": "predict",
"url": "https://bedrock-runtime.us-west-2.amazonaws.com/model/anthropic.claude-instant-v1/invoke"
}
Expand Down Expand Up @@ -69,7 +69,7 @@
},
"user_inputs": {
"parameters": {
"prompt": "\n\nHuman: You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: ${parameters.context};\n The question is: ${parameters.question}."
"prompt": "You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: ${parameters.context};\n The question is: ${parameters.question}."
},
"name": "MLModelTool",
"type": "MLModelTool"
Expand Down
4 changes: 2 additions & 2 deletions sample-templates/alert-summary-agent-claude-tested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ workflows:
x-amz-content-sha256: required
content-type: application/json
method: POST
request_body: '{"prompt":"${parameters.prompt}", "max_tokens_to_sample":${parameters.max_tokens_to_sample},
request_body: '{"prompt":"\n\nHuman: ${parameters.prompt}\n\nAssistant:", "max_tokens_to_sample":${parameters.max_tokens_to_sample},
"temperature":${parameters.temperature}, "anthropic_version":"${parameters.anthropic_version}"
}'
action_type: predict
Expand Down Expand Up @@ -57,7 +57,7 @@ workflows:
register_claude_model: model_id
user_inputs:
parameters:
prompt: "\n\nHuman: You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: ${parameters.context};\n The question is: ${parameters.question}."
prompt: "You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: ${parameters.context};\n The question is: ${parameters.question}."
name: MLModelTool
type: MLModelTool
- id: create_alert_summary_agent
Expand Down

0 comments on commit 9ce16b3

Please sign in to comment.