Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NameCache ¶
type NameCache struct {
// contains filtered or unexported fields
}
NameCache provides a cache for agent name validation results. It uses a worker to process validation requests from a queue.
func NewNameCache ¶
func NewNameCache(chatCompletion chat.ChatCompletion) *NameCache
NewNameCache creates a new name cache with the given chat completion instance.
func NewNameCacheWithConcurrency ¶
func NewNameCacheWithConcurrency(chatCompletion chat.ChatCompletion, concurrencyLimit int) *NameCache
NewNameCacheWithConcurrency creates a new name cache with the given chat completion instance and a specified concurrency limit for validation workers.
func (*NameCache) EnqueueForValidation ¶
EnqueueForValidation adds a name to the validation queue.
func (*NameCache) IsValid ¶
IsValid checks if a name is valid according to the cache. If the name is not in the cache, it enqueues it for validation and returns false (considering it invalid until proven otherwise).
func (*NameCache) IsValidWithWait ¶
IsValidWithWait checks if a name is valid according to the cache. If the name is not in the cache, it enqueues it for validation and waits for the validation to complete or until the context is done.
func (*NameCache) Run ¶
Run starts the main validation worker in a goroutine. It returns after spawning so that you can manage it externally via context cancellation or wait-group.
func (*NameCache) SetValidity ¶
SetValidity manually sets the validity of a name in the cache.