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
runtimeIntentRuntimeThe intent runtime.
namesstring[]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
runtimeIntentRuntimeThe intent runtime.
loggerILoggerLogger for exceptions the tools answer with
success: false(logged atWarning).namesstring[]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
runtimeIntentRuntimeThe 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
runtimeIntentRuntimeThe intent runtime.
loggerILoggerLogger for exceptions the tools answer with
success: false(logged atWarning).
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
invokerIIntentInvokerThe intent runner.
namesstring[]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
invokerIIntentInvokerThe intent runner.
loggerILoggerLogger for exceptions the tools answer with
success: false(logged atWarning).namesstring[]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
invokerIIntentInvokerThe 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
invokerIIntentInvokerThe intent runner.
loggerILoggerLogger for exceptions the tools answer with
success: false(logged atWarning).
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.