diff --git a/config.py b/config.py index 06aa05bb..c4f00f0d 100644 --- a/config.py +++ b/config.py @@ -76,7 +76,7 @@ TMPL_APIDOC = "apidoc.tmpl" TMPL_MODULE = "module.tmpl" UPPER_WORDS = { - "aws": ("aws", "api", "ebs", "ec2", "efs", "emr", "rds", "ml", "mq", "nat", "vpc", "waf", "sdk"), + "aws": ("aws", "api", "ebs", "ec2", "efs", "emr", "rds", "ml", "mq", "nat", "vpc", "waf", "sdk", "aiagent", "agentcore"), "azure": ("ad", "b2c", "ai", "api", "cdn", "ddos", "dns", "fxt", "hana", "hd", "id", "sap", "sql", "vm", "vpn", "vpc"), "gcp": ("gcp", "ai", "api", "cdn", "dns", "gke", "gpu", "iap", "ml", "nat", "os", "sdk", "sql", "tpu", "vpn"), "firebase": ("ab", "fcm", "ml"), @@ -242,6 +242,8 @@ ALIASES = { }, "ml": { "DeepLearningContainers": "DLC", + "PolicyEngineAgenticGuardrails": "PEAG", + "Observability": "OBS", }, "network": { "CloudFront": "CF", diff --git a/diagrams/__init__.py b/diagrams/__init__.py index 66c3458f..027aa877 100644 --- a/diagrams/__init__.py +++ b/diagrams/__init__.py @@ -139,8 +139,7 @@ class Diagram: if isinstance(outformat, list): for one_format in outformat: if not self._validate_outformat(one_format): - raise ValueError( - f'"{one_format}" is not a valid output format') + raise ValueError(f'"{one_format}" is not a valid output format') else: if not self._validate_outformat(outformat): raise ValueError(f'"{outformat}" is not a valid output format') @@ -492,8 +491,7 @@ class Edge: """Implement Self - Node or Edge and Self - [Nodes]""" return self.connect(other) - def __rsub__(self, other: Union[List["Node"], - List["Edge"]]) -> List["Edge"]: + def __rsub__(self, other: Union[List["Node"], List["Edge"]]) -> List["Edge"]: """Called for [Nodes] or [Edges] - Self because list don't have __sub__ operators.""" return self.append(other) @@ -507,23 +505,15 @@ class Edge: self.reverse = True return self.connect(other) - def __rrshift__(self, - other: Union[List["Node"], - List["Edge"]]) -> List["Edge"]: + def __rrshift__(self, other: Union[List["Node"], List["Edge"]]) -> List["Edge"]: """Called for [Nodes] or [Edges] >> Self because list of Edges don't have __rshift__ operators.""" return self.append(other, forward=True) - def __rlshift__(self, - other: Union[List["Node"], - List["Edge"]]) -> List["Edge"]: + def __rlshift__(self, other: Union[List["Node"], List["Edge"]]) -> List["Edge"]: """Called for [Nodes] or [Edges] << Self because list of Edges don't have __lshift__ operators.""" return self.append(other, reverse=True) - def append(self, - other: Union[List["Node"], - List["Edge"]], - forward=None, - reverse=None) -> List["Edge"]: + def append(self, other: Union[List["Node"], List["Edge"]], forward=None, reverse=None) -> List["Edge"]: result = [] for o in other: if isinstance(o, Edge): @@ -532,12 +522,7 @@ class Edge: self._attrs = o.attrs.copy() result.append(o) else: - result.append( - Edge( - o, - forward=forward, - reverse=reverse, - **self._attrs)) + result.append(Edge(o, forward=forward, reverse=reverse, **self._attrs)) return result def connect(self, other: Union["Node", "Edge", List["Node"]]): diff --git a/diagrams/aws/ml.py b/diagrams/aws/ml.py index 6d2cce6b..e04e4d3d 100644 --- a/diagrams/aws/ml.py +++ b/diagrams/aws/ml.py @@ -8,6 +8,18 @@ class _ML(_AWS): _icon_dir = "resources/aws/ml" +class AGENTCORE(_ML): + _icon = "agentcore.png" + + +class AiAgent(_ML): + _icon = "ai-agent.png" + + +class AmazonNova(_ML): + _icon = "amazon-nova.png" + + class ApacheMxnetOnAWS(_ML): _icon = "apache-mxnet-on-aws.png" @@ -16,10 +28,26 @@ class AugmentedAi(_ML): _icon = "augmented-ai.png" +class AWSAppStudio(_ML): + _icon = "aws-app-studio.png" + + +class AWSNeuron(_ML): + _icon = "aws-neuron.png" + + class Bedrock(_ML): _icon = "bedrock.png" +class BrowserTool(_ML): + _icon = "browser-tool.png" + + +class CodeInterpreter(_ML): + _icon = "code-interpreter.png" + + class Comprehend(_ML): _icon = "comprehend.png" @@ -48,6 +76,10 @@ class ElasticInference(_ML): _icon = "elastic-inference.png" +class Evaluations(_ML): + _icon = "evaluations.png" + + class Forecast(_ML): _icon = "forecast.png" @@ -56,6 +88,14 @@ class FraudDetector(_ML): _icon = "fraud-detector.png" +class Gateway(_ML): + _icon = "gateway.png" + + +class Identity(_ML): + _icon = "identity.png" + + class Kendra(_ML): _icon = "kendra.png" @@ -68,10 +108,22 @@ class MachineLearning(_ML): _icon = "machine-learning.png" +class Memory(_ML): + _icon = "memory.png" + + +class Observability(_ML): + _icon = "observability.png" + + class Personalize(_ML): _icon = "personalize.png" +class PolicyEngineAgenticGuardrails(_ML): + _icon = "policy-engine-agentic-guardrails.png" + + class Polly(_ML): _icon = "polly.png" @@ -92,6 +144,10 @@ class Rekognition(_ML): _icon = "rekognition.png" +class Runtime(_ML): + _icon = "runtime.png" + + class SagemakerGroundTruth(_ML): _icon = "sagemaker-ground-truth.png" @@ -135,3 +191,5 @@ class Translate(_ML): # Aliases DLC = DeepLearningContainers +PEAG = PolicyEngineAgenticGuardrails +OBS = Observability diff --git a/diagrams/cli.py b/diagrams/cli.py index c75eb3d9..7346300e 100644 --- a/diagrams/cli.py +++ b/diagrams/cli.py @@ -24,7 +24,7 @@ def run() -> int: args = parser.parse_args() for path in args.paths: - with open(path, encoding='utf-8') as f: + with open(path, encoding="utf-8") as f: exec(f.read()) return 0 diff --git a/docs/nodes/aws.md b/docs/nodes/aws.md index ad51cbc2..53efdc82 100644 --- a/docs/nodes/aws.md +++ b/docs/nodes/aws.md @@ -1094,15 +1094,36 @@ Node classes list of the aws provider. ## aws.ml +AGENTCORE +**diagrams.aws.ml.AGENTCORE** + +AiAgent +**diagrams.aws.ml.AiAgent** + +AmazonNova +**diagrams.aws.ml.AmazonNova** + ApacheMxnetOnAWS **diagrams.aws.ml.ApacheMxnetOnAWS** AugmentedAi **diagrams.aws.ml.AugmentedAi** +AWSAppStudio +**diagrams.aws.ml.AWSAppStudio** + +AWSNeuron +**diagrams.aws.ml.AWSNeuron** + Bedrock **diagrams.aws.ml.Bedrock** +BrowserTool +**diagrams.aws.ml.BrowserTool** + +CodeInterpreter +**diagrams.aws.ml.CodeInterpreter** + Comprehend **diagrams.aws.ml.Comprehend** @@ -1124,12 +1145,21 @@ Node classes list of the aws provider. ElasticInference **diagrams.aws.ml.ElasticInference** +Evaluations +**diagrams.aws.ml.Evaluations** + Forecast **diagrams.aws.ml.Forecast** FraudDetector **diagrams.aws.ml.FraudDetector** +Gateway +**diagrams.aws.ml.Gateway** + +Identity +**diagrams.aws.ml.Identity** + Kendra **diagrams.aws.ml.Kendra** @@ -1139,9 +1169,18 @@ Node classes list of the aws provider. MachineLearning **diagrams.aws.ml.MachineLearning** +Memory +**diagrams.aws.ml.Memory** + +Observability +**diagrams.aws.ml.Observability**, **OBS** (alias) + Personalize **diagrams.aws.ml.Personalize** +PolicyEngineAgenticGuardrails +**diagrams.aws.ml.PolicyEngineAgenticGuardrails**, **PEAG** (alias) + Polly **diagrams.aws.ml.Polly** @@ -1157,6 +1196,9 @@ Node classes list of the aws provider. Rekognition **diagrams.aws.ml.Rekognition** +Runtime +**diagrams.aws.ml.Runtime** + SagemakerGroundTruth **diagrams.aws.ml.SagemakerGroundTruth** diff --git a/resources/aws/ml/agentcore.png b/resources/aws/ml/agentcore.png new file mode 100644 index 00000000..debeadd2 Binary files /dev/null and b/resources/aws/ml/agentcore.png differ diff --git a/resources/aws/ml/ai-agent.png b/resources/aws/ml/ai-agent.png new file mode 100644 index 00000000..f13894a9 Binary files /dev/null and b/resources/aws/ml/ai-agent.png differ diff --git a/resources/aws/ml/amazon-codewhisperer.png b/resources/aws/ml/amazon-codewhisperer.png new file mode 100644 index 00000000..31ba06a9 Binary files /dev/null and b/resources/aws/ml/amazon-codewhisperer.png differ diff --git a/resources/aws/ml/amazon-nova.png b/resources/aws/ml/amazon-nova.png new file mode 100644 index 00000000..bfbfc28d Binary files /dev/null and b/resources/aws/ml/amazon-nova.png differ diff --git a/resources/aws/ml/aws-app-studio.png b/resources/aws/ml/aws-app-studio.png new file mode 100644 index 00000000..c8ffedd8 Binary files /dev/null and b/resources/aws/ml/aws-app-studio.png differ diff --git a/resources/aws/ml/aws-neuron.png b/resources/aws/ml/aws-neuron.png new file mode 100644 index 00000000..4984baf4 Binary files /dev/null and b/resources/aws/ml/aws-neuron.png differ diff --git a/resources/aws/ml/browser-tool.png b/resources/aws/ml/browser-tool.png new file mode 100644 index 00000000..bc41ba93 Binary files /dev/null and b/resources/aws/ml/browser-tool.png differ diff --git a/resources/aws/ml/code-interpreter.png b/resources/aws/ml/code-interpreter.png new file mode 100644 index 00000000..b51d0033 Binary files /dev/null and b/resources/aws/ml/code-interpreter.png differ diff --git a/resources/aws/ml/evaluations.png b/resources/aws/ml/evaluations.png new file mode 100644 index 00000000..15dcb02e Binary files /dev/null and b/resources/aws/ml/evaluations.png differ diff --git a/resources/aws/ml/gateway.png b/resources/aws/ml/gateway.png new file mode 100644 index 00000000..099b2d14 Binary files /dev/null and b/resources/aws/ml/gateway.png differ diff --git a/resources/aws/ml/identity.png b/resources/aws/ml/identity.png new file mode 100644 index 00000000..d6eeccd7 Binary files /dev/null and b/resources/aws/ml/identity.png differ diff --git a/resources/aws/ml/memory.png b/resources/aws/ml/memory.png new file mode 100644 index 00000000..e864cfb1 Binary files /dev/null and b/resources/aws/ml/memory.png differ diff --git a/resources/aws/ml/observability.png b/resources/aws/ml/observability.png new file mode 100644 index 00000000..8588ea29 Binary files /dev/null and b/resources/aws/ml/observability.png differ diff --git a/resources/aws/ml/policy-engine-agentic-guardrails.png b/resources/aws/ml/policy-engine-agentic-guardrails.png new file mode 100644 index 00000000..4239e826 Binary files /dev/null and b/resources/aws/ml/policy-engine-agentic-guardrails.png differ diff --git a/resources/aws/ml/runtime.png b/resources/aws/ml/runtime.png new file mode 100644 index 00000000..e7daf27e Binary files /dev/null and b/resources/aws/ml/runtime.png differ diff --git a/test_agentcore_icons.py b/test_agentcore_icons.py new file mode 100644 index 00000000..dff6fd8b --- /dev/null +++ b/test_agentcore_icons.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +""" +Test script for AWS Agentcore Bedrock icons +Validates that all 11 new Agentcore icons can be imported and used correctly. +""" + +from diagrams import Diagram +from diagrams.aws.ml import ( + Agentcore, + AiAgent, + Runtime, + Gateway, + Identity, + CodeInterpreter, + Observability, + BrowserTool, + Memory, + Evaluations, + PolicyEngineAgenticGuardrails +) + +def test_agentcore_icons(): + """Test all Agentcore icons in a sample diagram""" + + with Diagram("AWS Agentcore Bedrock Icons Test", show=False, filename="agentcore_test"): + # Core Agentcore components + agentcore = Agentcore("Agentcore") + ai_agent = AiAgent("AI Agent") + runtime = Runtime("Runtime") + gateway = Gateway("Gateway") + + # Identity and security + identity = Identity("Identity") + policy_engine = PolicyEngineAgenticGuardrails("Policy Engine") + + # Tools and capabilities + code_interpreter = CodeInterpreter("Code Interpreter") + browser_tool = BrowserTool("Browser Tool") + memory = Memory("Memory") + + # Monitoring and evaluation + observability = Observability("Observability") + evaluations = Evaluations("Evaluations") + + # Create a flow showing the relationships + agentcore >> ai_agent >> runtime + ai_agent >> [code_interpreter, browser_tool, memory] + gateway >> identity >> policy_engine + [runtime, code_interpreter, browser_tool] >> observability + observability >> evaluations + + print("✅ Test diagram created successfully!") + print("📁 Generated file: agentcore_test.png") + print("🔍 Please verify the icons render correctly in the diagram") + +if __name__ == "__main__": + test_agentcore_icons() diff --git a/test_nova_icons.py b/test_nova_icons.py new file mode 100644 index 00000000..94a39a4c --- /dev/null +++ b/test_nova_icons.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +""" +Test script for new AWS AI/ML service icons +Tests Amazon Nova, AWS App Studio, Amazon CodeWhisperer, and AWS Neuron +""" + +from diagrams import Diagram +from diagrams.aws.ml import AmazonNova, AWSAppStudio, AWSNeuron + +def test_nova_icons(): + """Test the new Nova and AI service icons""" + + with Diagram("New AWS AI/ML Services", show=False, filename="nova_test"): + # Create instances of the new services + nova = AmazonNova("Amazon Nova") + app_studio = AWSAppStudio("AWS App Studio") + neuron = AWSNeuron("AWS Neuron") + + # Create a simple flow + nova >> app_studio >> neuron + + print("✅ Test diagram created successfully!") + print("📁 Generated file: nova_test.png") + print("🔍 Please verify the icons render correctly in the diagram") + +if __name__ == "__main__": + test_nova_icons()