tjardoo / openai-client

OpenAI Dive is an unofficial async Rust library that allows you to interact with the OpenAI API.
https://crates.io/crates/openai_dive
MIT License
47 stars 19 forks source link

Fix `post_with_form` not building under WASM #77

Closed philpax closed 3 months ago

philpax commented 3 months ago

The current HEAD fails to build under WASM as Form::boundary() doesn't exist in the WASM version of reqwest, as it seems like the browser will automatically provide this: https://github.com/seanmonstar/reqwest/issues/1958#issuecomment-1698170136

This PR fixes that by only including the boundary on non-WASM. I've also added another GH job that builds under WASM to make it easier to check this kind of thing (there are lots of fun divergences on WASM 😢)

You may want to consider splitting the workflow up so that they can run in parallel at some point; I considered doing this but figured it'd be safer to be conservative in my change.

EDIT: Wow, the CI is pretty quick. Alright, splitting it up's probably not a priority 😅