Table of Contents

Class AgentAsToolProvider

Namespace
Oscova.Agents.Providers
Assembly
Oscova.Agents.dll

Provides agent-as-tool functions and the subagent lifecycle tools for one parent agent.

public class AgentAsToolProvider : AIContextProvider

Inheritance

AIContextProvider

Inherited Members

AIContextProvider.InvokingAsync(AIContextProvider.InvokingContext, CancellationToken)
AIContextProvider.InvokingCoreAsync(AIContextProvider.InvokingContext, CancellationToken)
AIContextProvider.ProvideAIContextAsync(AIContextProvider.InvokingContext, CancellationToken)
AIContextProvider.InvokedAsync(AIContextProvider.InvokedContext, CancellationToken)
AIContextProvider.InvokedCoreAsync(AIContextProvider.InvokedContext, CancellationToken)
AIContextProvider.StoreAIContextAsync(AIContextProvider.InvokedContext, CancellationToken)
AIContextProvider.GetService(Type, object?)
AIContextProvider.GetService<TService>(object?)
AIContextProvider.ProvideInputMessageFilter
AIContextProvider.StoreInputRequestMessageFilter
AIContextProvider.StoreInputResponseMessageFilter
AIContextProvider.StateKeys

Constructors

AgentAsToolProvider(IEnumerable<string>, AIAgentCollection, Func<DelegatedWorkState?>?, string?, Func<CancellationToken, Task<ChatClientAgent>>?)

Creates the provider. Without a work state, agent calls run synchronously. A self-worker factory enables same-agent subagents for the agent with selfAgentId.

Fields

AgentIdProperty

The agent-as-tool function property holding the called agent's id, so records never need its name.

ContinueToolName

Continues a retained subagent history.

InterruptToolName

Stops a running subagent.

MessageToolName

Sends a message to a running subagent.

StartToolName

Starts a same-agent subagent.

StatusToolName

Reads subagent state and recent output.

Properties

DefaultInstructions

Default guidance for same-agent subagents.

Instructions

Guidance added when same-agent subagents are offered.

Methods

CreateAgentFunction(ChatClientAgent, AgentSession?)

Creates the callable wrapper while letting a harness add governed conversation destinations.

GetConversationsAsync(AIAgent, AgentSession, DelegatedWorkState?, CancellationToken)

Reads the delegated conversations of a parent session, using live progress for running workers.

ProvideAIContextAsync(InvokingContext, CancellationToken)

When overridden in a derived class, provides additional AI context to be merged with the input context for the current invocation.

RequireParent()

Rejects delegation from inside a subagent worker.

RunAgentAsync(ChatClientAgent, IEnumerable<ChatMessage>, AgentSession, AgentRunOptions?, Action<AgentResponseUpdate>?, CancellationToken)

Executes a child while preserving this provider's named session ownership.