-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
GenAI: allow configuring additional send trigger after_significant_updates as well as event_end #16919
Conversation
✅ Deploy Preview for frigate-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
the user, manually via the UI |
That check was to prevent a genai description from overwriting a user's entered description if they manually entered something before the end of a long-running event. |
Makes sense. Would you want some additional metadata stored on events to reflect whether a user-input description had been added, and if so to avoid any GenAI calls? |
Not sure we need to be that specific. I think if a user has entered a manual description, GenAI should just not overwrite it. A user can delete their own description and regenerate if they want GenAI for it. |
The problem as it stands is that my new "early" GenAI request will populate the description on the event, so the guard upon event finalization for an already-populated description will always fail and it won't run. Unless I rework this to not update the Event entity for an early description generation and embed for semantic search, and instead only publish to MQTT, given most of the use case for this is going to be Home Assistant notifications. |
I think a quick note in the docs would be fine to indicate that if a user has GenAI enabled and they are entering manual descriptions, that their own description may be overwritten depending on their triggers. |
OK, keeping this in draft a while longer. Trying to load the event via Any suggestions on preferred approach - assuming I'm not reading this wrong... |
need to at a minimum check the |
OK, this works. But I need to test it more extensively to see how much fine-tuning it needs. Essentially, I was expecting 2-3 "significant updates" would be enough to send some nice early images from the event. However the timing of when the event is actually saved varies, so the value I've configured might be exceeded by that logic elsewhere in object processing. It should be fine to merge, a bit of time with it is required to see if it would need to be more fundamentally refactored to not have to wait for an "actual" event. |
As an aside, my testing has been hampered by the debug logging still not working, even in my devcontainer:
...nada |
Have you rebuilt the dev container? I believe Josh was unable to reproduce on dev and I've never had an issue personally |
Doesn't work for me in either production or devcontainer. I stop the dev container, Now I've got my dev server back online I'll try and have a dig around. Shouldn't be a problem for this PR though as it's an existing issue. |
Raised #16933 to track the debug logging issue, otherwise this PR can be merged when you're happy with it. |
Co-authored-by: Josh Hawkins <[email protected]>
4662dac
to
0e66b8b
Compare
Co-authored-by: Josh Hawkins <[email protected]>
I think once the remaining references to |
Co-authored-by: Josh Hawkins <[email protected]>
Thank you both for your support and efforts in reviewing this. Testing it out for an hour on my street-facing camera, with Might be a bit more refinement required based on the variability of when the updates are sent, but will observe for a few weeks first. I know there is some continuing debate over the use cases for GenAI, I do see it as offering a huge amount of potential for Frigate to get smarter and smarter, and hopefully this is a small step towards that! |
Proposed change
Based on discussion on #16528, a partial implementation to add configuration that allows users to add an extra trigger point on GenAI when a certain number of images have been accumulated. This is disabled by default.
Removed the check for a blank description in the existing end of event code, to ensure the finalized event description is still updated (I'm not sure why this check was necessary; what would have already added a description?).
Draft until my devcontainer starts working again; I will do docs updates too.
Type of change
Additional information
Checklist
ruff format frigate
)