firebase

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextProvider added in v0.3.0

func ContextProvider(ctx context.Context, g *genkit.Genkit, policy AuthPolicy) (core.ContextProvider, error)

ContextProvider creates a Firebase context provider for Genkit actions.

func DefineRetriever added in v0.5.2

func DefineRetriever(ctx context.Context, g *genkit.Genkit, cfg RetrieverOptions) (ai.Retriever, error)

DefineRetriever defines a Retriever with the given configuration.

Types

type AuthClient

type AuthClient interface {
	VerifyIDToken(context.Context, string) (*auth.Token, error)
}

AuthClient is a client for the Firebase Auth service.

type AuthContext added in v0.3.0

type AuthContext = *auth.Token

AuthContext is the context of an authenticated request.

type AuthPolicy added in v0.3.0

type AuthPolicy = func(context.Context, AuthContext, json.RawMessage) error

AuthPolicy is a function that validates an incoming request.

type Firebase added in v0.5.2

type Firebase struct {
	ProjectId string          // Firebase project ID.
	App       *firebasev4.App // Firebase app instance.
	// contains filtered or unexported fields
}

Firebase FireStore passes configuration options to the plugin.

func (*Firebase) Init added in v0.5.2

func (f *Firebase) Init(ctx context.Context, g *genkit.Genkit) error

Init initializes the Firebase plugin.

func (*Firebase) Name added in v0.5.2

func (f *Firebase) Name() string

Name returns the name of the plugin.

type RetrieverOptions added in v0.3.0

type RetrieverOptions struct {
	Name            string                    // Name of the retriever
	Label           string                    // Label for the retriever
	Collection      string                    // Firestore collection name
	Embedder        ai.Embedder               // Embedder instance for generating embeddings
	VectorField     string                    // Field name for storing vectors
	MetadataFields  []string                  // List of metadata fields to retrieve
	ContentField    string                    // Field name for storing content
	Limit           int                       // Limit on the number of results
	DistanceMeasure firestore.DistanceMeasure // Distance measure for vector similarity
}

RetrieverOptions struct for retriever configuration

type VectorType added in v0.3.0

type VectorType int