Documentation
¶
Index ¶
- type EmbedderRef
- type OpenAI
- func (o *OpenAI) DefineEmbedder(id string, opts *ai.EmbedderOptions) ai.Embedder
- func (o *OpenAI) DefineModel(id string, opts ai.ModelOptions) ai.Model
- func (o *OpenAI) Embedder(g *genkit.Genkit, name string) ai.Embedder
- func (o *OpenAI) Init(ctx context.Context) []core.Action
- func (o *OpenAI) ListActions(ctx context.Context) []core.ActionDesc
- func (o *OpenAI) Model(g *genkit.Genkit, name string) ai.Model
- func (o *OpenAI) Name() string
- func (o *OpenAI) ResolveAction(atype core.ActionType, name string) core.Action
- type TextEmbeddingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbedderRef ¶ added in v0.7.0
type EmbedderRef struct { Name string ConfigSchema TextEmbeddingConfig // Represents the schema, can be used for default config Label string Supports *ai.EmbedderSupports Dimensions int }
EmbedderRef represents the main structure for an embedding model's definition.
type OpenAI ¶
type OpenAI struct { // APIKey is the API key for the OpenAI API. If empty, the values of the environment variable "OPENAI_API_KEY" will be consulted. // Request a key at https://platform.openai.com/api-keys APIKey string // Optional: Opts are additional options for the OpenAI client. // Can include other options like WithOrganization, WithBaseURL, etc. Opts []option.RequestOption // contains filtered or unexported fields }
func (*OpenAI) DefineEmbedder ¶
func (*OpenAI) DefineModel ¶
func (*OpenAI) ListActions ¶ added in v0.6.1
func (o *OpenAI) ListActions(ctx context.Context) []core.ActionDesc
func (*OpenAI) ResolveAction ¶ added in v0.6.1
type TextEmbeddingConfig ¶ added in v0.7.0
type TextEmbeddingConfig struct { Dimensions int `json:"dimensions,omitempty"` EncodingFormat openaiGo.EmbeddingNewParamsEncodingFormat `json:"encodingFormat,omitempty"` }
Click to show internal directories.
Click to hide internal directories.