-
Notifications
You must be signed in to change notification settings - Fork 137
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
Adapt Python SDK to Typescript (E2B-30) #7
Conversation
I would prefer it. This way you would depend on the python package. If any change happens in the spec, you will have to change adjust python code and after that you can adjust js code.
I added some code suggestions to copy the python behavior.
Something like this line. When we change the spec, you will just need to run the command to regenerate the code and maybe do some small adjustments. But it should make it much more maintainable.
I checked |
That's correct, it was from their github issues I found the resolution with the separated build. You're right though, it's too complicated. I wasn't able to get the |
Well that's a shame, I was going in the wrong direction the whole time...
Code suggestions?
Okay, I'll take a look and see what I can come up with. |
Can we separate these comments out into individual issues so that we can isolate them and clarify the requirements a little easier? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't submit the suggestions 🙈
Sure, let's get this done. I'll create an issue for generating the types and endpoints. This works and that's the most important thing! 🎉 |
So just address the suggestions, rebase on master and let's get it out 💪🏻 |
Pretty sure I rebased properly here, I also:
PS: It should be noted that eslint and prettier conflict. I've been pushing after prettier, but if you run eslint without prettier it will cause changes in all of the files. We may consider putting the eslint check and the prettier fix into a singular command, or tweaking the eslint to match prettier. |
Just last few nit picks and we'll merge it 🎉 |
Alright @jakubno I think we're 💯 |
Co-authored-by: Jakub Novák <[email protected]>
Co-authored-by: Jakub Novák <[email protected]>
Co-authored-by: Jakub Novák <[email protected]>
Co-authored-by: Jakub Novák <[email protected]>
…unction (for eslint)
Thanks @jzanecook for your contribution! |
Thanks!
No, I have not. Should I?
I made the agent use static methods, but ran into issues when both were static, I referenced this article https://stackoverflow.com/a/64733963 and did it that way.
Done.
I didn't use a script to generate it, I guess that's part of the OpenAPI generators?
This was with the pydantic2ts package and should be removed.
Fixed, I added this compiler option.
I had been using the installed prettier, not the package prettier, fixed now.
Whoopsies.
This was a lot more effort than I was expecting lol, but at the end what I had to do was build CJS and ESM separately, reference the build script. I also ran into issues with the typings going into
dist/src
and erroring, so I added a little extra to the build script to make that go away.Added the examples to the linting process in tsconfig, also removed them from the build.