Table of Contents

Class DelegationRequest

Namespace
LMKit.Agents.Delegation
Assembly
LM-Kit.NET.dll

Represents a request to delegate a task to another agent.

Created when an agent decides to hand off a task to a more specialized agent from its delegates registry. Use the fluent To(string, string) / WithContext(string) / WithReason(string) / From(string) chain to build a request programmatically when driving delegation through DelegationManager.

public sealed class DelegationRequest
Inheritance
DelegationRequest
Inherited Members

Examples

Building a request via the fluent API and dispatching it through a manager:

using LMKit.Agents.Delegation;

var request = DelegationRequest .To("writer", "Draft a 100-word product description.") .WithContext("Audience: developers; tone: technical.") .WithReason("specialized writer agent for marketing copy") .From("supervisor");

var manager = supervisor.CreateDelegationManager(); DelegationResult result = await manager.DelegateAsync(request);

Constructors

DelegationRequest(string, string, string, string, string)

Initializes a new instance of the DelegationRequest class.

Properties

Context

Gets optional context to pass to the delegate agent.

May include conversation history, relevant facts, or other context that helps the delegate understand the broader situation.

Reason

Gets the reason for delegation, if provided.

SourceAgentName

Gets the name of the agent initiating the delegation.

TargetAgentName

Gets the name of the target agent to delegate to.

Task

Gets the task or query to delegate.

Timestamp

Gets the timestamp when this request was created.

Methods

From(string)

Creates a copy with a source agent name.

To(string, string)

Creates a delegation request with a builder pattern.

WithContext(string)

Creates a copy with additional context.

WithReason(string)

Creates a copy with a reason.

Share