B-Arts DocumentationIndice generale

BAIFunction

Identità

  • Namespace: B.BAI

  • Tipo: class

Espone al modello un delegate .NET. Lo schema dei parametri viene prodotto automaticamente da BReflection.CreateParametersJsonSchema.

Costruttore

  • BAIFunction(string name, string description, Delegate method).

Proprietà

Proprietà Tipo Accesso
Name string get/set
Description string get/set
Method Delegate get/private set
ParametersSchema Dictionary<string, object> get, calcolata

Metodi

  • Task<object?> InvokeAsync(string ArgumentsJson) — deserializza gli argomenti e invoca il delegate, supportando anche Task e Task<T>.

Uso consigliato

Normalmente registrare la funzione tramite BAIConnection.AddFunction; costruire direttamente BAIFunction solo quando serve gestire esplicitamente la raccolta.