agentops
agentops copied to clipboard
Issue #45 Emit events on exit
๐ฅ Pull Request
๐ Description
- Added self.record(event) before we try to get the return value of a function that is decorated
- Modified the worker add_event function such that it updates events if they have the same ID, such that if there is a return value of a decorated function, it is updated to the event, but that if the function terminates, the event is already present
๐ Related Issue (if applicable) Issue #45 Emit Events on Exit
๐งช Testing Installed local version of modified agentops package and ran it against some decorated functions. Terminate execution with ctrl + c and saw that the failed event was included in dashboard.
@stateofkate Change on SDK side theoretically works, but we'll need to update:
- Server side does not support event upserts. So, it technically would not work.
- Unit tests. They're failing because it's expecting the post count == 2, but you made 3. The 3rd is supposed to update the one of the tests, but we're tracking the raw count. To fix this, we'll have to update the unit test
What your viewing is probably due to the way we flush events. On the dashboard, it looks correct, but database-wise, it is not.
Deferring to @siyangqiu about how we'd proceed with this