Table of Contents

Interface IPluginContext

Namespace
JD.AI.Plugins.SDK
Assembly
JD.AI.Plugins.SDK.dll

Context provided to plugins during initialization.

public interface IPluginContext

Properties

Configuration

Plugin-specific configuration values.

IReadOnlyDictionary<string, string> Configuration { get; }

Property Value

IReadOnlyDictionary<string, string>

Kernel

The SK kernel to register functions with.

Kernel Kernel { get; }

Property Value

Kernel

Methods

GetService<T>()

Gets a service from the host DI container.

T? GetService<T>() where T : class

Returns

T

Type Parameters

T

Log(PluginLogLevel, string)

Logs a message from the plugin.

void Log(PluginLogLevel level, string message)

Parameters

level PluginLogLevel
message string

OnEvent(string, Func<object?, Task>)

Registers a hook for a gateway event.

void OnEvent(string eventType, Func<object?, Task> handler)

Parameters

eventType string
handler Func<object, Task>