Documentation
Table of Contents

Method AsAIFunctions

Namespace
IntentSharp.Extensions.AI
Assembly
IntentSharp.Extensions.AI.dll

AsAIFunctions(IntentRuntime, params string[])

One tool per named intent, in the order given. Every name must exist; two names may not map to the same tool name.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IntentRuntime runtime, params string[] names)

Parameters

runtime IntentRuntime

The intent runtime.

names string[]

The intent names.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two names map to the same tool name (compared case-insensitively), or a name is null, empty or white space, or makes a tool name longer than MaxToolNameLength characters.

IntentNotFoundException

The runtime's catalog has no intent with one of the names.

AsAIFunctions(IntentRuntime, ILogger?, params string[])

One tool per named intent, in the order given, each logging to logger. Every name must exist; two names may not map to the same tool name.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IntentRuntime runtime, ILogger? logger, params string[] names)

Parameters

runtime IntentRuntime

The intent runtime.

logger ILogger

Logger for exceptions the tools answer with success: false (logged at Warning).

names string[]

The intent names.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two names map to the same tool name (compared case-insensitively), or a name is null, empty or white space, or makes a tool name longer than MaxToolNameLength characters.

IntentNotFoundException

The runtime's catalog has no intent with one of the names.

AsAIFunctions(IntentRuntime)

One tool per enabled intent in the runtime's current catalog snapshot, ordered by intent name.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IntentRuntime runtime)

Parameters

runtime IntentRuntime

The intent runtime.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two enabled intents map to the same tool name (compared case-insensitively), or an intent name makes a tool name longer than MaxToolNameLength characters.

AsAIFunctions(IntentRuntime, ILogger?)

One tool per enabled intent in the runtime's current catalog snapshot, ordered by intent name, each logging to logger.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IntentRuntime runtime, ILogger? logger)

Parameters

runtime IntentRuntime

The intent runtime.

logger ILogger

Logger for exceptions the tools answer with success: false (logged at Warning).

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two enabled intents map to the same tool name (compared case-insensitively), or an intent name makes a tool name longer than MaxToolNameLength characters.

AsAIFunctions(IIntentInvoker, params string[])

One tool per named intent, in the order given. Every name must exist; two names may not map to the same tool name.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IIntentInvoker invoker, params string[] names)

Parameters

invoker IIntentInvoker

The intent runner.

names string[]

The intent names.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two names map to the same tool name (compared case-insensitively), or a name is null, empty or white space, or makes a tool name longer than MaxToolNameLength characters.

AsAIFunctions(IIntentInvoker, ILogger?, params string[])

One tool per named intent, in the order given, each logging to logger. Every name must exist; two names may not map to the same tool name.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IIntentInvoker invoker, ILogger? logger, params string[] names)

Parameters

invoker IIntentInvoker

The intent runner.

logger ILogger

Logger for exceptions the tools answer with success: false (logged at Warning).

names string[]

The intent names.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two names map to the same tool name (compared case-insensitively), or a name is null, empty or white space, or makes a tool name longer than MaxToolNameLength characters.

AsAIFunctions(IIntentInvoker)

One tool per definition that EnabledDefinitions() returns, in that order.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IIntentInvoker invoker)

Parameters

invoker IIntentInvoker

The intent runner.

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two enabled intents map to the same tool name (compared case-insensitively), or an intent name makes a tool name longer than MaxToolNameLength characters.

AsAIFunctions(IIntentInvoker, ILogger?)

One tool per definition that EnabledDefinitions() returns, in that order, each logging to logger.

public static IReadOnlyList<AIFunction> AsAIFunctions(this IIntentInvoker invoker, ILogger? logger)

Parameters

invoker IIntentInvoker

The intent runner.

logger ILogger

Logger for exceptions the tools answer with success: false (logged at Warning).

Returns

IReadOnlyList<AIFunction>

Exceptions

ArgumentException

Two enabled intents map to the same tool name (compared case-insensitively), or an intent name makes a tool name longer than MaxToolNameLength characters.