Package com.google.genkit.plugins.openai
Class OpenAIEmbedder
java.lang.Object
com.google.genkit.ai.Embedder
com.google.genkit.plugins.openai.OpenAIEmbedder
- All Implemented Interfaces:
Action<EmbedRequest,,EmbedResponse, Void> Registerable
OpenAI embedder implementation for Genkit.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.genkit.ai.Embedder
Embedder.Builder -
Constructor Summary
ConstructorsConstructorDescriptionOpenAIEmbedder(String modelName, OpenAIPluginOptions options) Creates a new OpenAIEmbedder. -
Method Summary
Modifier and TypeMethodDescriptionrun(ActionContext context, EmbedRequest request) Runs the action with the given input.Methods inherited from class com.google.genkit.ai.Embedder
builder, getDesc, getInfo, getInputSchema, getMetadata, getName, getOutputSchema, getType, register, run, runJson, runJsonWithTelemetry
-
Constructor Details
-
OpenAIEmbedder
Creates a new OpenAIEmbedder.- Parameters:
modelName- the model nameoptions- the plugin options
-
-
Method Details
-
run
Description copied from interface:ActionRuns the action with the given input.- Specified by:
runin interfaceAction<EmbedRequest,EmbedResponse, Void> - Overrides:
runin classEmbedder- Parameters:
context- the action contextrequest- the input to the action- Returns:
- the output of the action
-