-
Notifications
You must be signed in to change notification settings - Fork 136
Tinygo + WASI Support #318
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
Comments
This is a good call out. It's not a priority to support these platforms at the moment, but it certainly would be nice. This package depends heavily on I think it's realistic to remove SliceOf and ConvertibleTo from the custom encoders/decoders. Rather than a full library, are there specific OpenAI-Go SDK utilities we could make Tinygo-friendly that would be helpful? |
I don't think it's quite a big lift. Here's an example of chat completion in Golang that can compile to Wasm, which uses This bytecodealliance/go-modules#305 should provide the niceties needed to support HTTP transport and related bits for Golang. The couple bits missing are httptrace and httputil which are related to tinygo-org/tinygo#4822, and some of the reflect related stuff. |
Thanks, that's helpful knowledge. Our focus will initially be on other features before the GA launch. However, I can split the At that point, if you're willing to share a PR that solves any remaining issues, I'd gladly review and incorporate it. How does that sound as a short term goal? I'll update the thread when that's ready. |
Sounds great! I'd be delighted to help with the effort. |
Just following up after a little bit of experimentation, I'll have a branch up by this afternoon that you can begin to play with |
I've modified the code generator on the It only contains the autogenerated code without any of the handwritten helper functions, so many of the examples may need some extra work to compile. Feel free to compare with the |
I will be a bit delayed on this as I'm about to leave for KubeCon London, and have a couple talks to prep. Please don't infer that my brief silence implies I've lost interest. Just ran out of time in the last day to do any significant work on this topic. |
I was attempting to use this library in a Go project that is targeting WASI preview 2 and using Tinygo to compile to that target. Due to some unimplemented portions of reflect and httputil packages in Tinygo (AssignableTo, ConvertibleTo, SliceOf, DumpRequestOut, DumpResponse), I'm unable to compile code that depends on this library.
I believe the httputil usage could be fixed with a build tag to omit the functionality. However, the reflect dependencies are in the encoder / decoder and would likely take more significant changes.
Is there a desire to be able to use this library from a Go application targeting WASI + Wasm?
The text was updated successfully, but these errors were encountered: