Skip to content

api_base should be read from env, same as api_key does #478

@AntoineRqe

Description

@AntoineRqe

When using this crate, I wanted to specify a openai_api_base and I add to do

 let mut openai_config = OpenAIConfig::default();
    openai_config = openai_config.with_api_base(std::env::var("OPENAI_API_BASE").expect("OPENAI_API_BASE not set"));

Could be interesting to be able to read api_base from env variable in the constructor (same as openai_api_key).

I have the code ready for a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions