valentinegb / openai

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

Gpt4 support? #41

Closed Captain-Of-Coit closed 1 year ago

Captain-Of-Coit commented 1 year ago

Problem

Gpt4 is available in limited beta. I have access, but seems this crate doesn't support it yet. I went around the source to figure out how to add support for it, but I'm unable to figure it out. The enums seems to not actually be defined here?

Solution

Support for Gpt4 :)

Alternatives

No response

valentinegb commented 1 year ago

Hey there! In the main branch, the ModelID enumerator generates itself based off of the models available to you, using the api key you set as an environment variable. If you have access to the model, it should appear as ModelID::Gpt4. If for some reason it doesn't appear when it should, you can always use ModelID::Custom("gpt-4").

valentinegb commented 1 year ago

(ModelID::Gpt4 likely isn't in the documentation yet because GPT-4 wasn't available last time the documentation was compiled, and I myself only got access to GPT-4 a few minutes ago!)