fix: correct return type for dataset item link function call
Problem
Re-submit the changes from #535 since they were reverted (unintentionally?)
TypeScript types appear to be inaccurate for the DatasetItem.link return type. The types indicate only an id: string property returned, but at runtime, there is all data associated with DatasetRunItem.
Changes
Re-submit the changes from #535 since they were reverted (unintentionally?)
update the return type of DatasetItem.link to reflect the DatasetRunItem schema, instead of just an object with an id property, as that's what comes back from the API in production.
Release info Sub-libraries affected
Bump level
- [ ] Major
- [ ] Minor
- [X] Patch
Libraries affected
- [X] All of them
- [ ] langfuse
- [ ] langfuse-node
Changelog notes
- Updated return type for DatasetItem.Link to match DatasetRunItem
[!IMPORTANT] Update return type of
LinkDatasetItemintypes.tsto match actual API response.
- TypeScript Types:
- Update return type of
LinkDatasetItemintypes.tsfromPromise<{ id: string }>toPromise<components['schemas']['DatasetRunItem']>to reflect actual API response.This description was created by
for 4209ee86d57beef9a620f22e29047dcce5ac531c. You can customize this summary. It will automatically update as commits are pushed.
Greptile Summary
Disclaimer: Experimental PR review
Updates the return type of DatasetItem.link function to correctly reflect the full DatasetRunItem schema returned by the API instead of just an ID property.
- Changed return type in
/langfuse-core/src/types.tsfromPromise<{ id: string }>toPromise<components['schemas']['DatasetRunItem']> - Fixes type mismatch between TypeScript definition and actual API response
- Improves type safety for dataset run item handling in the SDK
💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!
@austin-tildei is attempting to deploy a commit to the langfuse Team on Vercel.
A member of the Team first needs to authorize it.
Hey @hassiebp just checking to see if the team can take a look at this one? TIA!
This will be addressed in our latest JS SDK major release: https://github.com/orgs/langfuse/discussions/8403 - thanks again for your contribution!