traverse_agent_context
async
¶
traverse_agent_context(
agent_context_id: AgentContextIdentifier,
node_id: GenericNodeId,
traversal_strategy: TraversalStrategy,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional[str] = None,
) -> TraverseAgentContextResponse
Returns the neighbors of a seed node in an agent context, each with its properties, hop distance, and the edges that connect it to the seed. To get the seed node ID, call SearchAgentContext.
Parameters:
-
max_results(Optional[int], default:None) –Maximum total neighbors to return per page.
-
next_token(Optional[str], default:None) –Opaque continuation token from a prior response. Omit on the first page.
-
agent_context_id(AgentContextIdentifier) –The agent context to traverse, by ID or full Amazon Resource Name (ARN).
-
node_id(GenericNodeId) –The ID of the seed node to start traversal from.
-
traversal_strategy(TraversalStrategy) –Traversal directives: which edge types to follow, direction, and max depth.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ResourceNotFoundException–The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Traverse from a node The following example follows outgoing HAS_COLUMN edges one hop from an AWS Glue table node, and returns two of the table's columns with the edge that connects each one to the table.
>>> await client.traverse_agent_context(agent_context_id='ac-0123456789abcdef0123456789abcdef', node_id='glueTable:arn%3Aaws%3Aglue%3Aus-east-1%3A111122223333%3Atable%2Fsales_analytics%2Forders', max_results=2, traversal_strategy={'edgeTypes': ['AWS::CONTEXT::HAS_COLUMN'], 'direction': 'OUTGOING', 'maxDepth': 1})
Source code in docs_src/capo_context/_services/async_context.py
3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 | |