fabric

package
v0.0.0-...-d7328e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbedderRef

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 (o *OpenAI) DefineEmbedder(id string, opts *ai.EmbedderOptions) ai.Embedder

func (*OpenAI) DefineModel

func (o *OpenAI) DefineModel(id string, opts ai.ModelOptions) ai.Model

func (*OpenAI) Embedder

func (o *OpenAI) Embedder(g *genkit.Genkit, name string) ai.Embedder

func (*OpenAI) Init

func (o *OpenAI) Init(ctx context.Context) []api.Action

Init implements genkit.Plugin.

func (*OpenAI) ListActions

func (o *OpenAI) ListActions(ctx context.Context) []api.ActionDesc

func (*OpenAI) Model

func (o *OpenAI) Model(g *genkit.Genkit, name string) ai.Model

func (*OpenAI) Name

func (o *OpenAI) Name() string

Name implements genkit.Plugin.

func (*OpenAI) ResolveAction

func (o *OpenAI) ResolveAction(atype api.ActionType, name string) api.Action

type TextEmbeddingConfig

type TextEmbeddingConfig struct {
	Dimensions     int                                       `json:"dimensions,omitempty"`
	EncodingFormat openaiGo.EmbeddingNewParamsEncodingFormat `json:"encodingFormat,omitempty"`
}