pub enum AiBinding {
Bedrock(BedrockAiBinding),
Vertex(VertexAiBinding),
Foundry(FoundryAiBinding),
External(ExternalAiBinding),
}Expand description
Represents an AI Gateway binding for managed inference across cloud providers.
The managed variants (Bedrock/Vertex/Foundry) carry only identifiers and
endpoints; authentication uses the workload’s ambient cloud identity. The
External (BYO-key) variant deliberately carries a vault-resolved API key.
Variants§
Bedrock(BedrockAiBinding)
AWS Bedrock AI binding
Vertex(VertexAiBinding)
GCP Vertex AI binding
Foundry(FoundryAiBinding)
Azure AI Foundry binding
External(ExternalAiBinding)
External provider binding (generic endpoint-based). The tag must stay
unique across every resource type’s binding enum — a bare “external”
collides with the external Postgres binding in the shared
ALIEN_*_BINDING namespace.
Implementations§
Source§impl AiBinding
impl AiBinding
Sourcepub const LOCAL_API_KEY_ENV: &'static str = "OPENAI_API_KEY"
pub const LOCAL_API_KEY_ENV: &'static str = "OPENAI_API_KEY"
The env var a developer sets to bring their own provider key on the Local platform. Shared by the Local controller (provision-time check) and the local bindings resolver (runtime-only re-resolution), so the two never drift.
Sourcepub const LOCAL_DEFAULT_PROVIDER: &'static str = "openai"
pub const LOCAL_DEFAULT_PROVIDER: &'static str = "openai"
The BYO-key provider assumed on the Local platform.
Sourcepub const LOCAL_BEDROCK_REGION_ENV: &'static str = "ALIEN_AI_LOCAL_BEDROCK_REGION"
pub const LOCAL_BEDROCK_REGION_ENV: &'static str = "ALIEN_AI_LOCAL_BEDROCK_REGION"
When set on the alien dev process, local AI runs on Bedrock in this region with the
developer’s own AWS credentials (the default chain’s, with the developer’s full identity;
not refreshed, so restart alien dev after an SSO session expires) instead of a
bring-your-own provider key.
Sourcepub const LOCAL_BEDROCK_PROVIDER: &'static str = "bedrock"
pub const LOCAL_BEDROCK_PROVIDER: &'static str = "bedrock"
The provider name the local controller reports when it serves Bedrock.
Sourcepub fn local_bedrock_region() -> Result<Option<String>, String>
pub fn local_bedrock_region() -> Result<Option<String>, String>
The region named by Self::LOCAL_BEDROCK_REGION_ENV, validated; None when unset.
pub fn bedrock(region: impl Into<String>) -> Self
pub fn vertex(project: impl Into<String>, location: impl Into<String>) -> Self
pub fn foundry(endpoint: impl Into<String>, account: impl Into<String>) -> Self
pub fn external( provider: impl Into<String>, api_key: impl Into<BindingValue<String>>, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AiBinding
impl<'de> Deserialize<'de> for AiBinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AiBinding
impl StructuralPartialEq for AiBinding
Auto Trait Implementations§
impl Forget for AiBinding
impl Freeze for AiBinding
impl Move for AiBinding
impl RefUnwindSafe for AiBinding
impl Send for AiBinding
impl Sync for AiBinding
impl Unpin for AiBinding
impl UnsafeUnpin for AiBinding
impl UnwindSafe for AiBinding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.