There are some inconsistencies in there, for example :
* `getStep` is typed as returning a `Step` , but in fact it returns a plain object of shape `StepFields`
* `getThread` is typed as returning `any`, returns a `ThreadFields` object
* there are probably more inconsistencies
The fact that these methods don't return actionable instances (with the `.send` method, etc…) is a bit of a missed opportunity. In scenarios where you want to work on an already created entity, you have to do [that little dance](https://github.com/Chainlit/literal-cookbook/blob/main/typescript/speech-to-emoji/with-literal/src/app/api/emojify/route.ts#L28-L33) which is annoying.
# Dod
* types are fixed
* entities are instantiated as their respective class
* this is non-breaking for existing project which might already do the little dance. Basically just check that re-instantiating an instance is okay.
ENG-1585 TS SDK : getXXX methods should return instances
There are some inconsistencies in there, for example : * `getStep` is typed as returning a `Step` , but in fact it returns a plain object of shape `StepFields` * `getThread` is typed as returning `any`, returns a `ThreadFields` object * there are probably more inconsistencies The fact that these methods don't return actionable instances (with the `.send` method, etc…) is a bit of a missed opportunity. In scenarios where you want to work on an already created entity, you have to do [that little dance](https://github.com/Chainlit/literal-cookbook/blob/main/typescript/speech-to-emoji/with-literal/src/app/api/emojify/route.ts#L28-L33) which is annoying. # Dod * types are fixed * entities are instantiated as their respective class * this is non-breaking for existing project which might already do the little dance. Basically just check that re-instantiating an instance is okay.