.NET API
TimeoutAIFunction
Tracon.Core.dllWraps an AI.AIFunction so a call that does not settle within a
fixed duration ends in TraconToolTimeoutException instead
of running unbounded.
public sealed class TimeoutAIFunction : DelegatingAIFunction- Inheritance
- object ← AITool ← AIFunctionDeclaration ← AIFunction ← DelegatingAIFunction ← TimeoutAIFunction
- Inherited Members
- DelegatingAIFunction.ToString(), DelegatingAIFunction.GetService(Type, object?), DelegatingAIFunction.Name, DelegatingAIFunction.Description, DelegatingAIFunction.JsonSchema, DelegatingAIFunction.ReturnJsonSchema, DelegatingAIFunction.JsonSerializerOptions, DelegatingAIFunction.UnderlyingMethod, DelegatingAIFunction.AdditionalProperties, AIFunction.InvokeAsync(AIFunctionArguments?, CancellationToken), AIFunction.AsDeclarationOnly(), AIFunction.UnderlyingMethod, AIFunction.JsonSerializerOptions, AIFunctionDeclaration.JsonSchema, AIFunctionDeclaration.ReturnJsonSchema, AITool.ToString(), AITool.GetService(Type, object?), AITool.GetService<TService>(object?), AITool.Name, AITool.Description, AITool.AdditionalProperties, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Installed by the tool registry, one layer inside the
authorization wrapper and outside the approval wrapper.
The ordering matters: ApprovalRequiredAIFunction never blocks on the
human decision inside a single call — Microsoft Agent Framework returns a
pending request immediately and the decision resumes as a new run — so
wrapping it with a timeout only ever bounds the tool’s own execution, never
an approval wait.
On timeout the call is cancelled and the caller is handed TraconToolTimeoutException. Cancellation is cooperative: a body that reads its token stops there and spends nothing more, while one that never reads it is not forcibly stopped and keeps running in the background until it finishes or faults on its own. That remaining case is not left silent — when such a call does settle, its result and whatever usage it reported are written onto the call’s existing record, which is the only way a charge incurred after the timeout reaches a cost report at all.
Methods
Section titled “Methods”InvokeCoreAsync(AIFunctionArguments, CancellationToken)
Section titled “ InvokeCoreAsync(AIFunctionArguments, CancellationToken)”Invokes the AI.AIFunction and returns its result.
protected override ValueTask<object?> InvokeCoreAsync(AIFunctionArguments arguments, CancellationToken cancellationToken)Parameters
Section titled “Parameters”arguments AIFunctionArguments
The arguments to pass to the function’s invocation.
cancellationToken CancellationToken
The CancellationToken to monitor for cancellation requests.
Returns
Section titled “Returns”The result of the function’s execution.