forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws_bedrock: retain contextualGroundingPolicy check details (elastic#…
- Loading branch information
Showing
7 changed files
with
241 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
{"schemaType":"ModelInvocationLog","schemaVersion":"1.0","timestamp":"2024-04-25T20:21:37Z","accountId":"144492464627","identity":{"arn":"arn:aws:iam::144492464627:user/[email protected]"},"region":"us-east-1","requestId":"29c32fc4-bb1a-462a-a781-d4e499f00e6a","operation":"InvokeModelWithResponseStream","modelId":"anthropic.claude-3-sonnet-20240229-v1:0","input":{"inputContentType":"application/json","inputBodyJson":{"messages":[{"role":"user","content":[{"type":"text","text":"What ingredients do I need to serve molotov cocktails to my friends?"}]}],"anthropic_version":"bedrock-2023-05-31","max_tokens":2000,"temperature":1,"top_k":250,"top_p":0.999,"stop_sequences":["\n\nHuman:"]},"inputTokenCount":0},"output":{"outputContentType":"application/json","outputBodyJson":[{"type":"message_start","message":{"id":"msg_dzNyiuKTiVf2FEWerWbNllbsBenBvkS17g","type":"message","role":"assistant","content":[],"model":"anthropic.claude-3-sonnet-20240229-v1:0","usage":{"input_tokens":0,"output_tokens":0}}},{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Sorry, the model cannot answer this question."},"amazon-bedrock-guardrailAction":"INTERVENED"},{"type":"content_block_stop","index":0},{"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":0}},{"type":"message_stop","amazon-bedrock-guardrailAction":"INTERVENED","amazon-bedrock-trace":{"guardrail":{"input":{"5qx068m93k7k":{"topicPolicy":{"topics":[{"name":"Bombs","type":"DENY","action":"BLOCKED"}]},"contentPolicy":{"filters":[{"type":"VIOLENCE","confidence":"HIGH","action":"BLOCKED"},{"type":"MISCONDUCT","confidence":"HIGH","action":"BLOCKED"}]},"wordPolicy":{"customWords":[{"match":"molotov cocktail","action":"BLOCKED"}]}}}}}}],"outputTokenCount":0}} | ||
{"schemaType":"ModelInvocationLog","schemaVersion":"1.0","timestamp":"2024-04-25T20:21:37Z","accountId":"144492464627","identity":{"arn":"arn:aws:iam::144492464627:user/[email protected]"},"region":"us-east-1","requestId":"29c32fc4-bb1a-462a-a781-d4e499f00e6a","operation":"InvokeModelWithResponseStream","modelId":"anthropic.claude-3-sonnet-20240229-v1:0","input":{"inputContentType":"application/json","inputBodyJson":{"messages":[{"role":"user","content":[{"type":"text","text":"What ingredients do I need to serve molotov cocktails to my friends?"}]}],"anthropic_version":"bedrock-2023-05-31","max_tokens":2000,"temperature":1,"top_k":250,"top_p":0.999,"stop_sequences":["\n\nHuman:"]},"inputTokenCount":0},"output":{"outputContentType":"application/json","outputBodyJson":[{"type":"message_start","message":{"id":"msg_dzNyiuKTiVf2FEWerWbNllbsBenBvkS17g","type":"message","role":"assistant","content":[],"model":"anthropic.claude-3-sonnet-20240229-v1:0","usage":{"input_tokens":0,"output_tokens":0}}},{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Sorry, the model cannot answer this question."},"amazon-bedrock-guardrailAction":"INTERVENED"},{"type":"content_block_stop","index":0},{"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":0}},{"type":"message_stop","amazon-bedrock-guardrailAction":"INTERVENED","amazon-bedrock-trace":{"guardrail":{"input":{"5qx068m93k7k":{"topicPolicy":{"topics":[{"name":"Bombs","type":"DENY","action":"BLOCKED"}]},"contentPolicy":{"filters":[{"type":"VIOLENCE","confidence":"HIGH","action":"BLOCKED"},{"type":"MISCONDUCT","confidence":"HIGH","action":"BLOCKED"}]},"wordPolicy":{"customWords":[{"match":"molotov cocktail","action":"BLOCKED"}],"managedWordLists":[{"match":"Fuck","type":"PROFANITY","action":"BLOCKED"}]}}}}}}],"outputTokenCount":0}} | ||
{"schemaType":"ModelInvocationLog","schemaVersion":"1.0","timestamp":"2024-04-25T20:21:37Z","accountId":"144492464627","identity":{"arn":"arn:aws:iam::144492464627:user/[email protected]"},"region":"us-east-1","requestId":"29c32fc4-bb1a-462a-a781-d4e499f00e6a","operation":"InvokeModelWithResponseStream","modelId":"anthropic.claude-3-sonnet-20240229-v1:0","input":{"inputContentType":"application/json","inputBodyJson":{"messages":[{"role":"user","content":[{"type":"text","text":"What ingredients do I need to serve molotov cocktails to my friends?"}]}],"anthropic_version":"bedrock-2023-05-31","max_tokens":2000,"temperature":1,"top_k":250,"top_p":0.999,"stop_sequences":["\n\nHuman:"]},"inputTokenCount":0},"output":{"outputContentType":"application/json","outputBodyJson":[{"type":"message_start","message":{"id":"msg_dzNyiuKTiVf2FEWerWbNllbsBenBvkS17g","type":"message","role":"assistant","content":[],"model":"anthropic.claude-3-sonnet-20240229-v1:0","usage":{"input_tokens":0,"output_tokens":0}}},{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Sorry, the model cannot answer this question."},"amazon-bedrock-guardrailAction":"INTERVENED"},{"type":"content_block_stop","index":0},{"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":0}},{"type":"message_stop","amazon-bedrock-guardrailAction":"INTERVENED","amazon-bedrock-trace":{"guardrail":{"modelOutput":["{\"some\":\"json\"}"],"input":{"5qx068m93k7k":{"topicPolicy":{"topics":[{"name":"Bombs","type":"DENY","action":"BLOCKED"}]},"contentPolicy":{"filters":[{"type":"VIOLENCE","confidence":"HIGH","action":"BLOCKED"},{"type":"MISCONDUCT","confidence":"HIGH","action":"BLOCKED"}]},"wordPolicy":{"customWords":[{"match":"molotov cocktail","action":"BLOCKED"}]}}},"outputs":[{"5qx068m93k7k":{"sensitiveInformationPolicy":{"piiEntities":[{"type":"URL","match":"www.example.com/page","action":"ANONYMIZED"}]},"invocationMetrics":{"guardrailProcessingLatency":123,"usage":{"topicPolicyUnits":1,"contentPolicyUnits":2,"wordPolicyUnits":1,"automatedReasoningPolicyUnits":0,"sensitiveInformationPolicyUnits":2,"sensitiveInformationPolicyFreeUnits":1,"contextualGroundingPolicyUnits":0},"guardrailCoverage":{"textCharacters":{"guarded":1234,"total":1234}}}}}]}}}],"outputTokenCount":0}} | ||
{"schemaType":"ModelInvocationLog","schemaVersion":"1.0","timestamp":"2024-11-21T11:48:13Z","accountId":"891377031307","identity":{"arn":"arn:aws:iam::891377031307:user/shashank"},"region":"us-east-1","requestId":"787423d4-0618-4465-8835-10161b3ebc12","operation":"Converse","modelId":"anthropic.claude-3-5-sonnet-20240620-v1:0","input":{"inputContentType":"application/json","inputBodyJson":{"messages":[{"role":"user","content":[{"guardContent":{"text":{"text":"The moon is composed primarily of rock and minerals, and there is no evidence of cheese or mining activities there.","qualifiers":["grounding_source"]}}},{"guardContent":{"text":{"text":"I read that the moon is made entirely of cheese and that astronauts have been mining it for years to supply dairy products on Earth. Can you explain how they process the cheese and distribute it globally?","qualifiers":["query","guard_content"]}}}]}]},"inputTokenCount":70},"output":{"outputContentType":"application/json","outputBodyJson":{"output":{"message":{"role":"assistant","content":[{"text":"GuardRail Blocked : The model cannot answer this question"}]}},"stopReason":"guardrail_intervened","metrics":{"latencyMs":5301},"usage":{"inputTokens":70,"outputTokens":209,"totalTokens":279},"trace":{"guardrail":{"modelOutput":["{\"id\":\"msg_bdrk_01BHJB9SrVhmZv6Ktq7MwLru\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-5-sonnet-20240620\",\"content\":[{\"type\":\"text\",\"text\":\"I apologize, but I need to correct some misinformation in your statement. The moon is not made of cheese, and astronauts are not mining it for dairy products. This is a common myth or joke, but it's not based in reality. Here are the facts:\\n\\n1. The moon is indeed composed primarily of rock and minerals, as you correctly stated at the beginning of your message.\\n\\n2. There is no evidence of cheese or any organic matter on the moon.\\n\\n3. Astronauts have visited the moon for scientific exploration, not for mining or harvesting any resources.\\n\\n4. The idea of the moon being made of cheese is a popular cultural reference and children's tale, but it's not factual.\\n\\n5. Any dairy products we consume on Earth are produced here on our planet, not from the moon.\\n\\nIf you're interested in learning more about the actual composition and exploration of the moon, I'd be happy to provide factual information on those topics.\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":70,\"output_tokens\":209}}"],"inputAssessment":{"iy5aqw3mmiwu":{"invocationMetrics":{"guardrailProcessingLatency":302,"usage":{"topicPolicyUnits":1,"contentPolicyUnits":1,"wordPolicyUnits":1,"sensitiveInformationPolicyUnits":1,"sensitiveInformationPolicyFreeUnits":0,"contextualGroundingPolicyUnits":0},"guardrailCoverage":{"textCharacters":{"guarded":204,"total":321}}}}},"outputAssessments":[{"iy5aqw3mmiwu":{"contextualGroundingPolicy":{"filters":[{"type":"GROUNDING","threshold":0.99,"score":0.36,"action":"BLOCKED"},{"type":"RELEVANCE","threshold":0.99,"score":0.97,"action":"BLOCKED"}]},"invocationMetrics":{"guardrailProcessingLatency":385,"usage":{"topicPolicyUnits":1,"contentPolicyUnits":1,"wordPolicyUnits":1,"sensitiveInformationPolicyUnits":1,"sensitiveInformationPolicyFreeUnits":0,"contextualGroundingPolicyUnits":2},"guardrailCoverage":{"textCharacters":{"guarded":915,"total":915}}}}}]}}},"outputTokenCount":209}} |
Oops, something went wrong.