Commit b7fba77
authored
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 functions1 parent 9bb3cc2 commit b7fba77
File tree
8 files changed
+1361
-99
lines changed- .changeset
- content/docs/03-ai-sdk-core
- examples/ai-functions/src/generate-text/openai
- packages/ai/src
- generate-text
- util
8 files changed
+1361
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments