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

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
JackTT - Gopher 🇻🇳