Interface Plugin

All Known Subinterfaces:
DynamicPlugin, ServerPlugin
All Known Implementing Classes:
AnthropicPlugin, AwsBedrockPlugin, AzureFoundryPlugin, CoherePlugin, CompatOAIPlugin, DeepSeekPlugin, EvaluatorsPlugin, FirebasePlugin, GoogleGenAIPlugin, GroqPlugin, JettyPlugin, LocalVecPlugin, MCPPlugin, MistralPlugin, OllamaPlugin, OpenAIPlugin, PineconePlugin, PostgresPlugin, SpringPlugin, WeaviatePlugin, XAIPlugin

public interface Plugin
Plugin is the interface implemented by types that extend Genkit's functionality. Plugins are typically used to integrate external services like model providers, vector databases, or monitoring tools.

Plugins are registered and initialized via the Genkit builder during initialization.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the unique identifier for the plugin.
    List<Action<?,?,?>>
    Initializes the plugin.
    default List<Action<?,?,?>>
    init(Registry registry)
    Initializes the plugin with access to the registry.
  • Method Details

    • getName

      String getName()
      Returns the unique identifier for the plugin. This name is used for registration and lookup.
      Returns:
      the plugin name
    • init

      List<Action<?,?,?>> init()
      Initializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.
      Returns:
      list of actions provided by this plugin
    • init

      default List<Action<?,?,?>> init(Registry registry)
      Initializes the plugin with access to the registry. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.

      Override this method instead of init() when your plugin needs to resolve dependencies from the registry (e.g., embedders, models).

      Parameters:
      registry - the Genkit registry for resolving dependencies
      Returns:
      list of actions provided by this plugin