firebase / genkit

An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to integrate, test, and deploy sophisticated AI features to Firebase or Google Cloud.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[JS] Simplify Genkit libraries and imports

chrisraygill opened this issue · comments

Is your feature request related to a problem? Please describe.

Currently, imports for our default sample look intimidating due to Genkit capabilities being spread across multiple libraries. The below code is from the default sample generated by 'genkit init' when selecting the Firebase and Google AI option.

import {generate} from "@genkit-ai/ai";
import {configureGenkit} from "@genkit-ai/core";
import {firebaseAuth} from "@genkit-ai/firebase/auth";
import {onFlow} from "@genkit-ai/firebase/functions";
import * as z from "zod";
import {firebase} from "@genkit-ai/firebase";
import {googleAI, gemini15Flash} from "@genkit-ai/googleai";

Describe the solution you'd like

I would like to consolidate these imports to reduce the number of lines and make the experience feel simpler and cleaner. I suggest:

  1. Combining @genkit-ai/ai and @genkit-ai/core packages
  2. Simplifying imports from @genkit-ai/firebase - do firebaseAuth, onFlow, and firebase need to be imported separately?

If the changes are made, the import should look something like this:

import {configureGenkit, generate} from "@genkit-ai/core";
import {firebase, firebaseAuth, onFlow} from "@genkit-ai/firebase";
import * as z from "zod";
import {googleAI, gemini15Flash} from "@genkit-ai/googleai";

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.