Skip to content

Commit b7fba77

Browse files
feat(ai): add an event emitter to core functions (#12749)
## Background as a part of the ongoing change to refactor telemetry, the idea is to create an event emitter (that basically emits all the information that is present at that step of the flow) so that listeners (such as OTel) can tap into the information and create spans accordingly ## Summary - add an event emitter + listeners array - simple example to verify events and listeners work ## Manual Verification - verified by running `examples/ai-functions/src/events/listen-to-events.ts` ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work - will need to decouple otel from core functions
1 parent 9bb3cc2 commit b7fba77

File tree

8 files changed

+1361
-99
lines changed

8 files changed

+1361
-99
lines changed

.changeset/forty-cats-sort.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
feat(ai): add event notifiers to core functions

0 commit comments

Comments
 (0)