Table of Contents

Class FunctionDefinition

Namespace
Mythosia.AI.Models.Functions
Assembly
Mythosia.AI.Abstractions.dll

Represents a function that can be called by AI

public class FunctionDefinition
Inheritance
FunctionDefinition
Inherited Members

Constructors

FunctionDefinition()

public FunctionDefinition()

Properties

AllowAsync

Allows a supporting model and API to continue working while this function executes. Defaults to false. Unsupported providers use the ordinary blocking tool-call flow without changing this setting.

public bool AllowAsync { get; set; }

Property Value

bool

Description

public string Description { get; set; }

Property Value

string

Handler

Gets or replaces the tool handler. This compatibility view invokes a cancellation-aware handler with CancellationToken.None when called directly. Setting either handler property replaces the same callable; handlers registered here do not receive execution cancellation.

public Func<Dictionary<string, object>, Task<string>>? Handler { get; set; }

Property Value

Func<Dictionary<string, object>, Task<string>>

HandlerWithCancellation

Gets or replaces the tool handler that receives execution cancellation. Pass the token to cancellable operations to stop cooperatively. Setting this also updates Handler.

public Func<Dictionary<string, object>, CancellationToken, Task<string>>? HandlerWithCancellation { get; set; }

Property Value

Func<Dictionary<string, object>, CancellationToken, Task<string>>

Name

public string Name { get; set; }

Property Value

string

Parameters

public FunctionParameters Parameters { get; set; }

Property Value

FunctionParameters