-
Notifications
You must be signed in to change notification settings - Fork 227
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
Provide type hints for internal event emits #415
Comments
This is absolutely not a priority for the upcoming release. I opened it so I don't forget to come back to it later. |
So I decided to take a stab at this and went down a hole for a while trying to type the emitter event data and ended up with main...ajbozarth:beeai-framework:event_type which is currently broken. After coming up short on that I wrote up a doc on our API as it is now (including some currently missing emits in runner) and with the new emits that will be added in #416 |
@ajbozarth nice! 🙌 Please open a PR draft and I can add to it |
Summary of todays discussion:
|
Is your feature request related to a problem? Please describe.
Currently the Emitter emits data as an
Any
object, in our internal emits that object is a dict. In TS that object is dynamically typed, something that's impossible in python. As I detailed in #378 (comment) there are many ways around this issue.Describe the solution you'd like
To partially mirror the TS implementation I plan to create a dictionary of Types for each internal emit object that a user can then use to set their expected type for a given emit output.
Describe alternatives you've considered
I am yet unsure how I will code the above and am open to ideas. There a few alternative ideas that can work instead or in parallel to the above: enforcing a dict type or BaseModel type on the emit data instead of Any, create a similar typing object to TS and find a way to leverage it without knowing getting the key fro the same def line.
Additional context
This was originally part of the emitter followup work but was never split out into it's own subtask
The text was updated successfully, but these errors were encountered: