associateAgentCollaborator method
Makes an agent a collaborator for another agent.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter agentDescriptor :
The alias of the collaborator agent.
Parameter agentId :
The agent's ID.
Parameter agentVersion :
An agent version.
Parameter collaborationInstruction :
Instruction for the collaborator.
Parameter collaboratorName :
A name for the collaborator.
Parameter clientToken :
A client token.
Parameter relayConversationHistory :
A relay conversation history for the collaborator.
Implementation
Future<AssociateAgentCollaboratorResponse> associateAgentCollaborator({
required AgentDescriptor agentDescriptor,
required String agentId,
required String agentVersion,
required String collaborationInstruction,
required String collaboratorName,
String? clientToken,
RelayConversationHistory? relayConversationHistory,
}) async {
final $payload = <String, dynamic>{
'agentDescriptor': agentDescriptor,
'collaborationInstruction': collaborationInstruction,
'collaboratorName': collaboratorName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (relayConversationHistory != null)
'relayConversationHistory': relayConversationHistory.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/agentcollaborators/',
exceptionFnMap: _exceptionFns,
);
return AssociateAgentCollaboratorResponse.fromJson(response);
}