NodeInfoContextElement

Represents a coroutine context element that holds metadata specific to a particular node participating in the execution context of an AI agent strategy.

This class implements CoroutineContext.Element, enabling it to store and provide access to node-specific context information, such as the name of the node, within coroutine scopes.

Constructors

Link copied to clipboard
constructor(nodeName: String)

Types

Link copied to clipboard

A companion object that serves as the key for the NodeInfoContextElement in a CoroutineContext. This key enables the retrieval of a NodeInfoContextElement instance stored within a coroutine's context.

Properties

Link copied to clipboard
open override val key: CoroutineContext.Key<*>
Link copied to clipboard

The name of the node associated with this context element.

Functions

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard

Retrieves the AgentRunInfoContextElement from the current coroutine context, if present.

Link copied to clipboard

Retrieves the NodeInfoContextElement from the current coroutine context, if present.

Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext