mirror of
https://github.com/openai/codex.git
synced 2026-04-29 08:56:38 +00:00
This introduces a much-needed "profile" concept where users can specify a collection of options under one name and then pass that via `--profile` to the CLI. This PR introduces the `ConfigProfile` struct and makes it a field of `CargoToml`. It further updates `Config::load_from_base_config_with_overrides()` to respect `ConfigProfile`, overriding default values where appropriate. A detailed unit test is added at the end of `config.rs` to verify this behavior. Details on how to use this feature have also been added to `codex-rs/README.md`.
16 lines
518 B
Rust
16 lines
518 B
Rust
use serde::Deserialize;
|
|
|
|
use crate::protocol::AskForApproval;
|
|
|
|
/// Collection of common configuration options that a user can define as a unit
|
|
/// in `config.toml`.
|
|
#[derive(Debug, Clone, Default, PartialEq, Deserialize)]
|
|
pub struct ConfigProfile {
|
|
pub model: Option<String>,
|
|
/// The key in the `model_providers` map identifying the
|
|
/// [`ModelProviderInfo`] to use.
|
|
pub model_provider: Option<String>,
|
|
pub approval_policy: Option<AskForApproval>,
|
|
pub disable_response_storage: Option<bool>,
|
|
}
|