valentinegb / openai

An unofficial Rust library for the OpenAI API.
https://crates.io/crates/openai/
MIT License
61 stars 18 forks source link

Add feature flags to use native-tls or rustls #49

Closed scottbot95 closed 1 year ago

scottbot95 commented 1 year ago

Also adds an extra test step to the CI workflow to run tests using rustls instead of native-tls

scottbot95 commented 1 year ago

Failing test on missing model text-edit-davinci-001, but it looks like that test has been failing since 7e55233 so I don't think it's related.

valentinegb commented 1 year ago

Yeah you're right about the edit test, that one should be working but for some reason the model "doesn't exist".

Your PR looks good. To make things a little easier for myself, you ran the modified rust.yml workflow and it passed (with the exception of the edit test), right?

scottbot95 commented 1 year ago

Yes I locally added #[ignore] to the edit test and ran the following and got all green.

cargo test
cargo test --no-default-features --features=rustls
scottbot95 commented 1 year ago

FWIW, seems like OpenAI might have pulled the text-edit-davinci-001 model (or perhaps editing entirely since that was the only model that supports editing). The list models API no longer returns text-edit-davinci-001 and trying to use that model through the Playground results in the same "model not found error". Might be worth actually committing the #[ignore] flag to that test for now until OpenAI re-releases the model.

valentinegb commented 1 year ago

There is one other model that supports editing, code-davinci-edit-001, but I'm not sure if that one's been removed too. Ignoring the edit test for now is a good idea, I won't be able to do it today though since I won't be at my computer at all.

scottbot95 commented 1 year ago

Ah interesting code-davinci-edit-001 also doesn't seem to show up on the OpenAI playground or through the List model call. I can submit a quick PR with the #[ignore] if you'd like.

valentinegb commented 1 year ago

Sure! That would be helpful :)