firebase

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 13 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 App

func App(ctx context.Context) (*firebase.App, error)

App returns the cached Firebase app.

func ContextProvider added in v0.3.0

func ContextProvider(ctx context.Context, policy AuthPolicy) (core.ContextProvider, error)

ContextProvider creates a Firebase context provider for Genkit actions.

func DefineFirestoreRetriever added in v0.3.0

func DefineFirestoreRetriever(g *genkit.Genkit, cfg RetrieverOptions) (ai.Retriever, error)

func Init added in v0.3.0

Init initializes the plugin with the provided configuration.

func Retrievers added in v0.3.0

func Retrievers(ctx context.Context) ([]ai.Retriever, error)

Retrievers returns the cached list of retrievers.

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 FirebaseApp

type FirebaseApp interface {
	Auth(ctx context.Context) (*auth.Client, error)
}

FirebaseApp is an interface to represent the Firebase App object

type FirebasePluginConfig added in v0.3.0

type FirebasePluginConfig struct {
	App        *firebase.App      // Pre-initialized Firebase app
	Retrievers []RetrieverOptions // Array of retriever options
}

FirebasePluginConfig is the configuration for the Firebase plugin.

type RetrieverOptions added in v0.3.0

type RetrieverOptions struct {
	Name            string
	Label           string
	Client          *firestore.Client
	Collection      string
	Embedder        ai.Embedder
	VectorField     string
	MetadataFields  []string
	ContentField    string
	Limit           int
	DistanceMeasure firestore.DistanceMeasure
	VectorType      VectorType
}

type VectorType added in v0.3.0

type VectorType int
const (
	Vector64 VectorType = iota
)

Jump to

Keyboard shortcuts

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