Allow a Callable to include a Genkit Action annotation#8039
Merged
Conversation
Member
Author
|
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? |
taeold
approved these changes
Dec 9, 2024
| // 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>> = { |
Contributor
There was a problem hiding this comment.
why is this called "covertable" when we use this mapping to check whether event is not convertable?
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for Genkit 1.0, we are going to have a
onCallGenkitfunction 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:onFlowtofirebase-functions/https:onCallGenkitwe 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-functionscode is not yet written, I tested the CLI code with the following genkit 0.9-style code: