pub trait OpenaiEnvironment:
Send
+ Sync
+ 'static {
// Required methods
fn api_key(&self) -> &Secret;
fn organization_id(&self) -> Option<&str>;
fn project_id(&self) -> Option<&str>;
fn base_url(&self) -> &Url;
fn realtime_base_url(&self) -> &Url;
fn diagnostics_config(&self) -> Option<&DiagnosticsConfig>;
fn headers(&self) -> Result<HeaderMap>;
fn join_base_url(&self, path: &str) -> Result<Url>;
fn join_realtime_base_url(&self, path: &str) -> Result<Url>;
}Expand description
A trait defining the interface for OpenAI environment configuration.
Required Methods§
Sourcefn organization_id(&self) -> Option<&str>
fn organization_id(&self) -> Option<&str>
Returns the organization ID, if available.
Sourcefn project_id(&self) -> Option<&str>
fn project_id(&self) -> Option<&str>
Returns the project ID, if available.
Sourcefn realtime_base_url(&self) -> &Url
fn realtime_base_url(&self) -> &Url
Returns the base URL for the OpenAI Realtime API.
Sourcefn diagnostics_config(&self) -> Option<&DiagnosticsConfig>
fn diagnostics_config(&self) -> Option<&DiagnosticsConfig>
Returns the diagnostics configuration, if available.
Sourcefn headers(&self) -> Result<HeaderMap>
fn headers(&self) -> Result<HeaderMap>
Returns the HTTP headers for the OpenAI API.
§Errors
Returns OpenAIError::InvalidArgument if headers contain invalid values.