pub struct HttpModelConfig {
pub base_url: String,
pub endpoint_path: String,
pub api_root_path: Option<String>,
pub provider_endpoint_path: Option<String>,
pub auth: Option<AuthConfig>,
pub headers: BTreeMap<String, String>,
pub extra_body: Map<String, Value>,
pub timeout_ms: Option<u64>,
pub retry_policy: RetryPolicy,
pub max_tokens_parameter: MaxTokensParameter,
pub metadata: Map<String, Value>,
}Expand description
Provider HTTP configuration shared by protocol clients.
Fields§
§base_url: StringProvider or gateway base URL.
endpoint_path: StringProvider-specific endpoint path.
api_root_path: Option<String>Provider API root path inserted when a configured base URL has no path.
provider_endpoint_path: Option<String>Provider endpoint path relative to the API root.
auth: Option<AuthConfig>Authentication config.
headers: BTreeMap<String, String>Headers applied to all requests.
extra_body: Map<String, Value>Extra JSON body merged into every provider request.
timeout_ms: Option<u64>Default timeout in milliseconds.
retry_policy: RetryPolicyRetry policy for transient failures.
max_tokens_parameter: MaxTokensParameterProvider or gateway max-token parameter mapping.
metadata: Map<String, Value>Adapter-level metadata copied into every request.
Implementations§
Source§impl HttpModelConfig
impl HttpModelConfig
Sourcepub fn new(
base_url: impl Into<String>,
endpoint_path: impl Into<String>,
) -> Self
pub fn new( base_url: impl Into<String>, endpoint_path: impl Into<String>, ) -> Self
Create HTTP config from base URL and endpoint path.
Sourcepub fn provider_endpoint(
base_url: impl Into<String>,
api_root_path: impl Into<String>,
endpoint_path: impl Into<String>,
) -> Self
pub fn provider_endpoint( base_url: impl Into<String>, api_root_path: impl Into<String>, endpoint_path: impl Into<String>, ) -> Self
Create HTTP config for a provider endpoint with a known API root path.
When base_url already includes a path, it is treated as a gateway mount point and the
resolved endpoint is appended directly. When base_url has no path, api_root_path is
inserted before the provider endpoint path.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Replace the base URL while preserving provider endpoint root semantics.
Sourcepub fn set_base_url(&mut self, base_url: impl Into<String>)
pub fn set_base_url(&mut self, base_url: impl Into<String>)
Replace the base URL while preserving provider endpoint root semantics.
Sourcepub fn with_endpoint_path(self, endpoint_path: impl Into<String>) -> Self
pub fn with_endpoint_path(self, endpoint_path: impl Into<String>) -> Self
Replace the endpoint path with an explicit caller-provided path.
Sourcepub fn set_endpoint_path(&mut self, endpoint_path: impl Into<String>)
pub fn set_endpoint_path(&mut self, endpoint_path: impl Into<String>)
Replace the endpoint path with an explicit caller-provided path.
Sourcepub fn endpoint_url(&self) -> String
pub fn endpoint_url(&self) -> String
Resolve the absolute endpoint URL.
Trait Implementations§
Source§impl Clone for HttpModelConfig
impl Clone for HttpModelConfig
Source§fn clone(&self) -> HttpModelConfig
fn clone(&self) -> HttpModelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more