plugin library
Core APIs and types for authoring Genkit plugins.
This library exports the primitives necessary for creating custom models,
embedders, tools, middleware, and other Genkit integrations. It is intended
for package authors extending Genkit functions. End-users building Genkit
applications should import package:genkit/genkit.dart instead.
Classes
- $Candidate
- $CustomPart
- $DataPart
- $DocumentData
- $Embedding
- $EmbedRequest
- $EmbedResponse
- $GenerateActionOptions
- $GenerateActionOutputConfig
- $GenerateRequest
- $GenerateResponse
- $GenerateResumeOptions
- $GenerationUsage
- $Media
- $MediaPart
- $Message
- $ModelInfo
- $ModelRequest
- $ModelResponse
- $ModelResponseChunk
- $Operation
- $OutputConfig
- $Part
- $ReasoningPart
- $ResourcePart
- $TextPart
- $ToolDefinition
- $ToolRequest
- $ToolRequestPart
- $ToolResponse
- $ToolResponsePart
-
Action<
Input, Output, Chunk, Init> -
ActionMetadata<
Input, Output, Chunk, Init> -
BidiModel<
CustomOptions> - Candidate
- CustomPart
- DataPart
- DocumentData
-
Embedder<
CustomOptions> -
EmbedderRef<
CustomOptions> - Embedding
- EmbedRequest
- EmbedResponse
- GenerateActionOptions
- GenerateActionOutputConfig
- GenerateActionOutputConfigInstructions
- GenerateMiddleware
- Middleware for the processing of a Generation request.
-
GenerateMiddlewareDef<
CustomOptions> -
GenerateMiddlewareRef<
CustomOptions> - GenerateRequest
- GenerateResponse
-
GenerateResponseChunk<
Output> - A chunk of a response from a generate action.
-
GenerateResponseHelper<
Output> - A response from a generate action.
- GenerateResumeOptions
- GenerationUsage
- GenkitPlugin
- A plugin for Genkit.
- InterruptResponse
- A response to an interrupted tool request.
- Media
- MediaPart
- Message
-
Model<
CustomOptions> - ModelInfo
-
ModelRef<
CustomOptions> - ModelRequest
- ModelResponse
- ModelResponseChunk
- Operation
- OutputConfig
- Part
- ReasoningPart
- ResourcePart
- TextPart
-
Tool<
Input, Output> - ToolDefinition
-
ToolFnArgs<
Input> - Arguments passed to a tool function execution.
- ToolRequest
- ToolRequestPart
- ToolResponse
- ToolResponsePart
Enums
- StatusCodes
- Exception thrown for errors encountered during Genkit flow operations. Common status codes for Genkit operations.
Extension Types
Extensions
Constants
- genkitVersion → const String
Functions
-
defineMiddleware<
CustomOptions> ({required String name, required GenerateMiddleware create([CustomOptions? config]), SchemanticType< CustomOptions> ? configSchema}) → GenerateMiddlewareDef<CustomOptions> -
embedderMetadata(
String name, {SchemanticType? customOptions}) → ActionMetadata -
embedderRef<
CustomOptions> (String name, {SchemanticType< CustomOptions> ? customOptions}) → EmbedderRef<CustomOptions> -
getConfigVar(
String name) → String? -
getPlatformLanguageVersion(
) → String -
middlewareRef<
CustomOptions> ({required String name, CustomOptions? config}) → GenerateMiddlewareRef< CustomOptions> -
modelMetadata(
String name, {ModelInfo? modelInfo, SchemanticType? customOptions}) → ActionMetadata -
modelRef<
CustomOptions> (String name, {SchemanticType< CustomOptions> ? customOptions}) → ModelRef<CustomOptions>
Typedefs
-
ActionFnArg<
Chunk, Input, Init> = ({Map< String, dynamic> ? context, Init? init, Stream<Input> ? inputStream, StreamingCallback<Chunk> sendChunk, bool streamingRequested}) -
ToolFn<
Input, Output> = Future< Output> Function(Input input, ToolFnArgs<Input> context) - A function that implements a tool.
Exceptions / Errors
- GenkitException
- Exception thrown for errors encountered during Genkit flow operations.
- ToolInterruptException
- Exception thrown by a tool to interrupt the generation loop.