-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: improve types from summary response #16
Comments
Hello @pierrebiver , thank you so much for this suggestion! I am not exactly sure I understand your suggestion above about data type export. Thank you so much, Looking forward to hearing from you! Julien |
Oh I didn’t know async mode would yield a different type, this is also a bit dangerous then, as I might plan to switch to async mode at some point. Would that make sense to return a different NLPClient based on whether async mode is enabled or not ? Regarding the type, I meant doing something like this:
In this case, I would be able to import the DataType I need and type my result. Does that makes sense ? |
But I think having different types for the NLPClient based on whether the async mode is enabled or not would solve your problem and would probably be the best option. Otherwise switching to async mode would break my code without TS complaining about anything |
Thank you Pierre for these valuable comments. |
Hello,
I really like NL cloud and wanted to give you a quick feedback in regards to the typing issues I'm facing. I'm using the summarization function, and the return type is hard to use and a bit confusing:
TS is confused when I get the response back as it does not know if data contains an url or a summary_text. I'm not sure which case we get an url or a string, but would be nice to know in advance, otherwise a quick fix could look like this:
and simply export the data type so we can type it when we get back the response ourself, right now I'm simply using
// @ts-ignore
which I would like to avoid.The text was updated successfully, but these errors were encountered: