mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
add xml comments for AgentType.cs
This commit is contained in:
committed by
Jack Gerrits
parent
4e7162e808
commit
f8325e5907
@@ -3,13 +3,39 @@
|
||||
|
||||
namespace Microsoft.AutoGen.Contracts.Python;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the type of an agent as a string.
|
||||
/// This is a strongly-typed wrapper around a string, ensuring type safety when working with agent types.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This struct is immutable and provides implicit conversion to and from <see cref="string"/>.
|
||||
/// </remarks>
|
||||
public struct AgentType
|
||||
{
|
||||
/// <summary>
|
||||
/// The string representation of this agent type.
|
||||
/// </summary>
|
||||
public required string Name;
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly converts a <see cref="Type"/> to an <see cref="AgentType"/>.
|
||||
/// </summary>
|
||||
/// <param name="type">The .NET <see cref="Type"/> to convert.</param>
|
||||
/// <returns>An <see cref="AgentType"/> instance with the name of the provided type.</returns>
|
||||
public static explicit operator AgentType(Type type) => new AgentType { Name = type.Name };
|
||||
|
||||
/// <summary>
|
||||
/// Implicitly converts a <see cref="string"/> to an <see cref="AgentType"/>.
|
||||
/// </summary>
|
||||
/// <param name="type">The string representation of the agent type.</param>
|
||||
/// <returns>An <see cref="AgentType"/> instance with the given name.</returns>
|
||||
public static implicit operator AgentType(string type) => new AgentType { Name = type };
|
||||
|
||||
/// <summary>
|
||||
/// Implicitly converts an <see cref="AgentType"/> to a <see cref="string"/>.
|
||||
/// </summary>
|
||||
/// <param name="type">The <see cref="AgentType"/> instance.</param>
|
||||
/// <returns>The string representation of the agent type.</returns>
|
||||
public static implicit operator string(AgentType type) => type.Name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user