Class KernelHooks.UnmodifiableKernelHooks
- java.lang.Object
-
- com.microsoft.semantickernel.hooks.KernelHooks
-
- com.microsoft.semantickernel.hooks.KernelHooks.UnmodifiableKernelHooks
-
- Enclosing class:
- KernelHooks
public static class KernelHooks.UnmodifiableKernelHooks extends KernelHooks
A wrapper for KernelHooks that disables mutating methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microsoft.semantickernel.hooks.KernelHooks
KernelHooks.UnmodifiableKernelHooks
-
-
Method Summary
-
Methods inherited from class com.microsoft.semantickernel.hooks.KernelHooks
addPreToolCallHook, executeHooks, isEmpty, unmodifiableClone
-
-
-
-
Method Detail
-
addFunctionInvokingHook
public String addFunctionInvokingHook(Function<FunctionInvokingEvent<?>,FunctionInvokingEvent<?>> function)
Description copied from class:KernelHooksAdd aKernelHook.FunctionInvokingHookto the collection of hooks.- Overrides:
addFunctionInvokingHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addFunctionInvokedHook
public String addFunctionInvokedHook(Function<FunctionInvokedEvent<?>,FunctionInvokedEvent<?>> function)
Description copied from class:KernelHooksAdd aKernelHook.FunctionInvokedHookto the collection of hooks.- Overrides:
addFunctionInvokedHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addPreChatCompletionHook
public String addPreChatCompletionHook(Function<PreChatCompletionEvent,PreChatCompletionEvent> function)
Description copied from class:KernelHooksAdd aKernelHook.PreChatCompletionHookto the collection of hooks.- Overrides:
addPreChatCompletionHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addPostChatCompletionHook
public String addPostChatCompletionHook(Function<PostChatCompletionEvent,PostChatCompletionEvent> function)
Description copied from class:KernelHooksAdd aPostChatCompletionEventto the collection of hooks.- Overrides:
addPostChatCompletionHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addPromptRenderedHook
public String addPromptRenderedHook(Function<PromptRenderedEvent,PromptRenderedEvent> function)
Description copied from class:KernelHooksAdd aKernelHook.PromptRenderedHookto the collection of hooks.- Overrides:
addPromptRenderedHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addPromptRenderingHook
public String addPromptRenderingHook(Function<PromptRenderingEvent,PromptRenderingEvent> function)
Description copied from class:KernelHooksAdd aKernelHook.PromptRenderingHookto the collection of hooks.- Overrides:
addPromptRenderingHookin classKernelHooks- Parameters:
function- the function to add- Returns:
- the key of the hook in the collection
-
addHook
public String addHook(KernelHook<?> hook)
Description copied from class:KernelHooksAdd aKernelHookto the collection of hooks.- Overrides:
addHookin classKernelHooks- Parameters:
hook- the hook to add- Returns:
- the key of the hook in the collection
-
addHook
public String addHook(String hookName, KernelHook<?> hook)
Description copied from class:KernelHooksAdd aKernelHookto the collection of hooks.- Overrides:
addHookin classKernelHooks- Parameters:
hookName- the key of the hook in the collectionhook- the hook to add- Returns:
- the key of the hook in the collection
-
addHooks
public KernelHooks addHooks(@Nullable KernelHooks kernelHooks)
Description copied from class:KernelHooksAppends the given hooks to this collection.- Overrides:
addHooksin classKernelHooks- Parameters:
kernelHooks- the hooks to append- Returns:
- this instance of the
KernelHooksclass
-
removeHook
public KernelHook<?> removeHook(String hookName)
Description copied from class:KernelHooksRemove a hook from the collection of hooks.- Overrides:
removeHookin classKernelHooks- Parameters:
hookName- the key of the hook in the collection- Returns:
- the removed hook, or
nullif the hook was not found
-
-