pull/1157/merge
Michael Walker 4 weeks ago committed by GitHub
commit 1545aa7d01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -9,6 +9,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.1

@ -102,7 +102,8 @@ TITLE_WORDS = {
"alibabacloud": "AlibabaCloud"
},
"aws": {
"cloudfront": "CloudFront"
"agentcore": "AgentCore",
"cloudfront": "CloudFront",
},
"digitalocean": {
"digitalocean": "DigitalOcean"
@ -241,7 +242,10 @@ ALIASES = {
"ServerMigrationService": "SMS",
},
"ml": {
"AiAgent": "AIAgent",
"DeepLearningContainers": "DLC",
"PolicyEngineAgenticGuardrails": "PEAG",
"Observability": "OBS",
},
"network": {
"CloudFront": "CF",

@ -182,8 +182,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')
@ -540,8 +539,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)
@ -555,23 +553,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):
@ -580,12 +570,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"]]):

@ -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"
@ -134,4 +190,7 @@ class Translate(_ML):
# Aliases
AIAgent = AiAgent
DLC = DeepLearningContainers
PEAG = PolicyEngineAgenticGuardrails
OBS = Observability

@ -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

@ -1100,15 +1100,36 @@ Node classes list of the aws provider.
## aws.ml
<img width="30" src="/img/resources/aws/ml/agentcore.png" alt="AgentCore" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AgentCore**
<img width="30" src="/img/resources/aws/ml/ai-agent.png" alt="AiAgent" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AiAgent**, **AIAgent** (alias)
<img width="30" src="/img/resources/aws/ml/amazon-nova.png" alt="AmazonNova" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AmazonNova**
<img width="30" src="/img/resources/aws/ml/apache-mxnet-on-aws.png" alt="ApacheMxnetOnAWS" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.ApacheMxnetOnAWS**
<img width="30" src="/img/resources/aws/ml/augmented-ai.png" alt="AugmentedAi" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AugmentedAi**
<img width="30" src="/img/resources/aws/ml/aws-app-studio.png" alt="AWSAppStudio" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AWSAppStudio**
<img width="30" src="/img/resources/aws/ml/aws-neuron.png" alt="AWSNeuron" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.AWSNeuron**
<img width="30" src="/img/resources/aws/ml/bedrock.png" alt="Bedrock" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Bedrock**
<img width="30" src="/img/resources/aws/ml/browser-tool.png" alt="BrowserTool" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.BrowserTool**
<img width="30" src="/img/resources/aws/ml/code-interpreter.png" alt="CodeInterpreter" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.CodeInterpreter**
<img width="30" src="/img/resources/aws/ml/comprehend.png" alt="Comprehend" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Comprehend**
@ -1130,12 +1151,21 @@ Node classes list of the aws provider.
<img width="30" src="/img/resources/aws/ml/elastic-inference.png" alt="ElasticInference" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.ElasticInference**
<img width="30" src="/img/resources/aws/ml/evaluations.png" alt="Evaluations" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Evaluations**
<img width="30" src="/img/resources/aws/ml/forecast.png" alt="Forecast" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Forecast**
<img width="30" src="/img/resources/aws/ml/fraud-detector.png" alt="FraudDetector" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.FraudDetector**
<img width="30" src="/img/resources/aws/ml/gateway.png" alt="Gateway" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Gateway**
<img width="30" src="/img/resources/aws/ml/identity.png" alt="Identity" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Identity**
<img width="30" src="/img/resources/aws/ml/kendra.png" alt="Kendra" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Kendra**
@ -1145,9 +1175,18 @@ Node classes list of the aws provider.
<img width="30" src="/img/resources/aws/ml/machine-learning.png" alt="MachineLearning" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.MachineLearning**
<img width="30" src="/img/resources/aws/ml/memory.png" alt="Memory" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Memory**
<img width="30" src="/img/resources/aws/ml/observability.png" alt="Observability" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Observability**, **OBS** (alias)
<img width="30" src="/img/resources/aws/ml/personalize.png" alt="Personalize" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Personalize**
<img width="30" src="/img/resources/aws/ml/policy-engine-agentic-guardrails.png" alt="PolicyEngineAgenticGuardrails" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.PolicyEngineAgenticGuardrails**, **PEAG** (alias)
<img width="30" src="/img/resources/aws/ml/polly.png" alt="Polly" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Polly**
@ -1163,6 +1202,9 @@ Node classes list of the aws provider.
<img width="30" src="/img/resources/aws/ml/rekognition.png" alt="Rekognition" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Rekognition**
<img width="30" src="/img/resources/aws/ml/runtime.png" alt="Runtime" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.Runtime**
<img width="30" src="/img/resources/aws/ml/sagemaker-ground-truth.png" alt="SagemakerGroundTruth" style="float: left; padding-right: 5px;" >
**diagrams.aws.ml.SagemakerGroundTruth**

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@ -0,0 +1,93 @@
import os
import unittest
from diagrams import Diagram, setcluster, setdiagram
from diagrams.aws.ml import (
DLC,
OBS,
PEAG,
AgentCore,
AiAgent,
AIAgent,
AmazonNova,
AWSAppStudio,
AWSNeuron,
BrowserTool,
CodeInterpreter,
Evaluations,
Gateway,
Identity,
Memory,
Observability,
PolicyEngineAgenticGuardrails,
Runtime,
)
class AgentcoreIconsTest(unittest.TestCase):
def setUp(self):
self.name = "test_agentcore_icons"
def tearDown(self):
setdiagram(None)
setcluster(None)
try:
os.remove(self.name + ".png")
except FileNotFoundError:
pass
def test_agentcore_diagram(self):
with Diagram(name=self.name, show=False, filename=self.name):
agentcore = AgentCore("Agentcore")
ai_agent = AiAgent("AI Agent")
runtime = Runtime("Runtime")
gateway = Gateway("Gateway")
identity = Identity("Identity")
policy_engine = PolicyEngineAgenticGuardrails("Policy Engine")
code_interpreter = CodeInterpreter("Code Interpreter")
browser_tool = BrowserTool("Browser Tool")
memory = Memory("Memory")
observability = Observability("Observability")
evaluations = Evaluations("Evaluations")
agentcore >> ai_agent >> runtime
ai_agent >> [code_interpreter, browser_tool, memory]
gateway >> identity >> policy_engine
[runtime, code_interpreter, browser_tool] >> observability
observability >> evaluations
self.assertTrue(os.path.exists(self.name + ".png"))
class NovaIconsTest(unittest.TestCase):
def setUp(self):
self.name = "test_nova_icons"
def tearDown(self):
setdiagram(None)
setcluster(None)
try:
os.remove(self.name + ".png")
except FileNotFoundError:
pass
def test_nova_diagram(self):
with Diagram(name=self.name, show=False, filename=self.name):
nova = AmazonNova("Amazon Nova")
app_studio = AWSAppStudio("AWS App Studio")
neuron = AWSNeuron("AWS Neuron")
nova >> app_studio >> neuron
self.assertTrue(os.path.exists(self.name + ".png"))
class AliasesTest(unittest.TestCase):
def test_aliases_exist(self):
self.assertIs(AIAgent, AiAgent)
self.assertIs(PEAG, PolicyEngineAgenticGuardrails)
self.assertIs(OBS, Observability)
if __name__ == "__main__":
unittest.main()

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save