-
Notifications
You must be signed in to change notification settings - Fork 961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a Callable to include a Genkit Action annotation #8039
Conversation
Note: to get this code to work, I had to add a couple of extra configs to my tsconfig.json:
I really really don't like the last one because it's just ignoring a valid compiler error in Genkit, but the other ones should possibly be added to our template configs? |
// Why can't auth context be removed? This is map was added to correct a bug where a regex | ||
// allowed any non-auth type to be converted to any auth type, but we should follow up for why | ||
// a functon can't opt into reducing PII. | ||
export const CONVERTABLE_EVENTS: Partial<Record<Event, Event>> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this called "covertable" when we use this mapping to check whether event is not convertable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it holds the list of events that are convertable. Not convertable means not in the map
* Fixing init dataconnect on some empty schema cases * Ensure schema.gql, not just dir, and add test * Update src/init/features/dataconnect/index.ts Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com> --------- Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com>
7e38511
to
b235fc4
Compare
In preparation for Genkit 1.0, we are going to have a
onCallGenkit
function declaration infirebase-functions/https
. This will be a "subclass" of callable functions.To represent this, "Genkit callables" are represented in memory as a callableTriggered with a new "genkitAction" property. Actual Cloud Functions will be created with the label deployed-callable: true still, but will also include a 'genkit-action' label as well, which will eventually be used to annotate the Firebase Console.
To allow users to migrate from
@genkit-ai/firebase/functions:onFlow
tofirebase-functions/https:onCallGenkit
we need to relax the restrictions around converting function types in function updates. This change allows an HTTPS function to become a Callable function. I also noticed a bug where you could convert between any type of non-auth-context Firestore function to any type of auth-context Firestore function and fixed it.Since the
firebase-functions
code is not yet written, I tested the CLI code with the following genkit 0.9-style code: