firebase

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: Apache-2.0 Imports: 14 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL