client library

Client-side utilities for interacting with Genkit.

Use this library when building clients (e.g., web or mobile apps) that communicate with Genkit actions or flows, or when using Genkit in a purely client-side context (e.g. with Chrome AI).

Classes

$BaseDataPoint
$Candidate
$CustomPart
$DataPart
$DocumentData
$Embedding
$EmbedRequest
$EmbedResponse
$EvalFnResponse
$EvalRequest
$GenerateActionOptions
$GenerateActionOutputConfig
$GenerateRequest
$GenerateResponse
$GenerateResumeOptions
$GenerationUsage
$Media
$MediaPart
$Message
$MiddlewareRef
$ModelInfo
$ModelRequest
$ModelResponse
$ModelResponseChunk
$Operation
$OutputConfig
$Part
$ReasoningPart
$ReflectionCancelActionParams
$ReflectionCancelActionResponse
$ReflectionConfigureParams
$ReflectionEndInputStreamParams
$ReflectionListActionsResponse
$ReflectionListValuesParams
$ReflectionListValuesResponse
$ReflectionRegisterParams
$ReflectionRunActionParams
$ReflectionRunActionStateParams
$ReflectionSendInputStreamChunkParams
$ReflectionStreamChunkParams
$ResourcePart
$Score
$TextPart
$ToolDefinition
$ToolRequest
$ToolRequestPart
$ToolResponse
$ToolResponsePart
ActionStream<Chunk, Response>
A stream of chunks emitted by an action, which also resolves to a final response.
BaseDataPoint
Candidate
CustomPart
DataPart
DocumentData
Embedding
EmbedRequest
EmbedResponse
EvalFnResponse
EvalFnResponseEvaluation
EvalRequest
GenerateActionOptions
GenerateActionOutputConfig
GenerateActionOutputConfigInstructions
GenerateRequest
GenerateResponse
GenerateResumeOptions
GenerationUsage
Media
MediaPart
Message
MiddlewareRef
ModelInfo
ModelRequest
ModelResponse
ModelResponseChunk
Operation
OutputConfig
Part
ReasoningPart
ReflectionCancelActionParams
ReflectionCancelActionResponse
ReflectionConfigureParams
ReflectionEndInputStreamParams
ReflectionListActionsResponse
ReflectionListValuesParams
ReflectionListValuesResponse
ReflectionRegisterParams
ReflectionRunActionParams
ReflectionRunActionStateParams
ReflectionSendInputStreamChunkParams
ReflectionStreamChunkParams
RemoteAction<Input, Output, Chunk, Init>
Represents a remote Genkit action (flow) that can be invoked or streamed.
ResourcePart
Score
ScoreScore
TextPart
ToolDefinition
ToolRequest
ToolRequestPart
ToolResponse
ToolResponsePart

Enums

StatusCodes
Exception thrown for errors encountered during Genkit flow operations. Common status codes for Genkit operations.

Extension Types

EvalStatusEnum
FinishReason
Role

Functions

defineRemoteAction<Input, Output, Chunk, Init>({required String url, Map<String, String>? defaultHeaders, Client? httpClient, Output fromResponse(dynamic jsonData)?, Chunk fromStreamChunk(dynamic jsonData)?, SchemanticType<Input>? inputSchema, SchemanticType<Output>? outputSchema, SchemanticType<Chunk>? streamSchema}) RemoteAction<Input, Output, Chunk, Init>
Defines a remote Genkit action (flow) client.

Exceptions / Errors

GenkitException
Exception thrown for errors encountered during Genkit flow operations.