# CallableAgentReference

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.callableagentreference/
> Summary: CallableAgentReference: One agent another agent may call, and the version of it that runs.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

One agent another agent may call, and the version of it that runs.

```csharp
public sealed record CallableAgentReference : IEquatable<CallableAgentReference>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.callableagentreference/">CallableAgentReference</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;CallableAgentReference&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Examples

Calls `researcher` as it was at version 3 and `editor` as it is now:

```csharp
new AgentDefinition
{
    Name = "writer",
    Model = new ModelBinding { Provider = "openai", Model = "gpt-5" },
    CallableAgents = [new CallableAgentReference { Name = "researcher", Version = 3 }, "editor"],
};
```

## Remarks

Without a [CallableAgentReference.Version](/api/tracon.callableagentreference/#Tracon_CallableAgentReference_Version) the callee runs its **current** version: an edit of the callee
reaches the caller at the next call. With one, the callee runs that stored version, and for an agent kept in the
database its description (the text the model reads to decide when to call it) is read from that version too.
A callee from a custom agent source keeps its current description; the source decides whether it has the
version. A caller pinned to a version of its own (a workflow step, an approval resumption) runs the callee
versions its *own* definition names, not the ones the callee has now.

Only an agent kept in the database has versions. A pin on an agent defined in code is refused when the
definition is saved and when it is compiled.

A name converts to a reference without a version, so a list of names stays a list of names:
`CallableAgents = ["researcher"]`.

## Constructors

### <a id="Tracon_CallableAgentReference__ctor"></a> CallableAgentReference\(\)

```csharp
public CallableAgentReference()
```

## Properties

### <a id="Tracon_CallableAgentReference_Name"></a> Name

Gets the name of the agent to call.

```csharp
public required string Name { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_CallableAgentReference_Version"></a> Version

Gets the version of the agent to run. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) runs its current version.

```csharp
public int? Version { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)?

## Methods

### <a id="Tracon_CallableAgentReference_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_CallableAgentReference_Equals_Tracon_CallableAgentReference_"></a> Equals\(CallableAgentReference?\)

```csharp
public bool Equals(CallableAgentReference? other)
```

#### Parameters

`other` [CallableAgentReference](/api/tracon.callableagentreference/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_CallableAgentReference_FromName_System_String_"></a> FromName\(string\)

Makes a reference to the current version of the agent with the given name.

```csharp
public static CallableAgentReference FromName(string name)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The agent name.

#### Returns

 [CallableAgentReference](/api/tracon.callableagentreference/)

A reference with no version.

### <a id="Tracon_CallableAgentReference_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_CallableAgentReference_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_CallableAgentReference_op_Equality_Tracon_CallableAgentReference_Tracon_CallableAgentReference_"></a> operator ==\(CallableAgentReference?, CallableAgentReference?\)

```csharp
public static bool operator ==(CallableAgentReference? left, CallableAgentReference? right)
```

#### Parameters

`left` [CallableAgentReference](/api/tracon.callableagentreference/)?

`right` [CallableAgentReference](/api/tracon.callableagentreference/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_CallableAgentReference_op_Implicit_System_String__Tracon_CallableAgentReference"></a> implicit operator CallableAgentReference\(string\)

Makes a reference to the current version of the agent with the given name.

```csharp
public static implicit operator CallableAgentReference(string name)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The agent name.

#### Returns

 [CallableAgentReference](/api/tracon.callableagentreference/)

A reference with no version.

#### Remarks

Same as [CallableAgentReference.FromName](/api/tracon.callableagentreference/#Tracon_CallableAgentReference_FromName_System_String_).

### <a id="Tracon_CallableAgentReference_op_Inequality_Tracon_CallableAgentReference_Tracon_CallableAgentReference_"></a> operator \!=\(CallableAgentReference?, CallableAgentReference?\)

```csharp
public static bool operator !=(CallableAgentReference? left, CallableAgentReference? right)
```

#### Parameters

`left` [CallableAgentReference](/api/tracon.callableagentreference/)?

`right` [CallableAgentReference](/api/tracon.callableagentreference/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
