Table of Contents

Class AIAgentCollection

Namespace
Oscova.Agents.Collections
Assembly
Oscova.Agents.dll

Stores built chat agents by identifier for reuse across agent runs.

public class AIAgentCollection : ICollection<ChatClientAgent>, IEnumerable<ChatClientAgent>, IEnumerable

Inheritance

Implements

Inherited Members

Remarks

Enumeration returns a snapshot so callers can iterate without holding the collection lock.

Properties

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection`1.

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection`1 is read-only.

Methods

Add(ChatClientAgent)

Adds or replaces a cached agent using its framework identifier.

Clear()

Removes all items from the System.Collections.Generic.ICollection`1.

Contains(string)

Determines whether an agent identifier exists in the cache.

Contains(ChatClientAgent)

Determines whether the System.Collections.Generic.ICollection`1 contains a specific value.

CopyTo(ChatClientAgent[], int)

Copies the elements of the System.Collections.Generic.ICollection`1 to an System.Array, starting at a particular System.Array index.

GetEnumerator()

Returns an enumerator that iterates through the collection.

GetOrAdd(ChatClientAgent)

Returns the existing cached agent with the same identifier or stores the supplied one.

Remove(ChatClientAgent)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection`1.

Remove(string)

Removes a cached agent by identifier.

TryGetAgentById(string, out ChatClientAgent?)

Attempts to retrieve a cached agent by identifier.