genkit
genkit copied to clipboard
Feature request: session updateState should patch the state instead of replace
Description
Currently there's inconsistent behavior when using updateState(). When updating a single property, it appears to replace the entire state object rather than patching it:
console.log(session.state)
// { userName: 'God', colour: 'Green' }
async (input) => {
ai.currentSession().updateState({
colour: input.colour,
});
return `colour updated to ${input.colour}`;
}
console.log(session.state)
// { colour: 'Green' } // userName was cleared
The current workaround is to manually spread the existing state:
async (input) => {
ai.currentSession().updateState({
...ai.currentSession().state,
userName: input.userName,
});
}
It should be changed to patch
Firebase is restricting my incoming messages on my device. I want this to stop asap. I have disabled my accounts from firebase. Why is this feature yet working. Please stop!!! I want all notification and messages capabilities on device. I don't need nor do I want any account protection