目录

结构体 AgentId

命名空间
Microsoft.AutoGen.Contracts
程序集
Microsoft.AutoGen.Contracts.dll
public struct AgentId
继承的成员

构造函数

AgentId(AgentType, string)

AgentType 初始化 AgentId 结构体的新实例。

public AgentId(AgentType type, string key)

参数

type AgentType

代理类型。

key string

代理实例标识符。

AgentId(string, string)

初始化 AgentId 结构体的新实例。

public AgentId(string type, string key)

参数

type string

代理类型。

key string

代理实例标识符。

AgentId((string Type, string Key))

从元组初始化 AgentId 结构体的新实例。

public AgentId((string Type, string Key) kvPair)

参数

kvPair (string Type, string Key)

包含代理类型和键的元组。

字段

Key

代理实例标识符。 字符串只能由字母数字字符 (a-z) 和 (0-9) 或下划线 (_) 组成。

public string Key

字段值

string

Type

将代理与特定工厂函数关联的标识符。 字符串只能由字母数字字符 (a-z) 和 (0-9) 或下划线 (_) 组成。

public string Type

字段值

string

方法

Equals(object?)

确定指定对象是否等于当前的 AgentId

public override bool Equals(object? obj)

参数

obj object

要与当前实例进行比较的对象。

返回值

bool

如果指定对象等于当前的 AgentId,则为 true;否则,为 false

FromStr(string)

将 "type/key" 格式的字符串转换为 AgentId

public static AgentId FromStr(string maybeAgentId)

参数

maybeAgentId string

代理 ID 字符串。

返回值

AgentId

AgentId 的一个实例。

GetHashCode()

返回此 AgentId 的哈希代码。

public override int GetHashCode()

返回值

int

当前实例的哈希代码。

ToString()

返回 AgentId 的字符串表示形式。

public override string ToString()

返回值

string

“type/key”格式的字符串。

运算符

operator ==(AgentId, AgentId)

public static bool operator ==(AgentId left, AgentId right)

参数

left AgentId
right AgentId

返回值

bool

explicit operator AgentId(string)

将字符串显式转换为 AgentId

public static explicit operator AgentId(string id)

参数

id string

代理 ID 的字符串表示形式。

返回值

AgentId

AgentId 的一个实例。

operator !=(AgentId, AgentId)

public static bool operator !=(AgentId left, AgentId right)

参数

left AgentId
right AgentId

返回值

bool