Skip to main content

LlmConnectionBuilder

Struct LlmConnectionBuilder 

Source
pub struct LlmConnectionBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> LlmConnectionBuilder<S>

Source

pub fn build(self) -> LlmConnection
where S: IsComplete,

Finish building and return the requested object

Source

pub fn id(self, value: String) -> LlmConnectionBuilder<SetId<S>>
where S::Id: IsUnset,

Required.

Source

pub fn provider(self, value: String) -> LlmConnectionBuilder<SetProvider<S>>
where S::Provider: IsUnset,

Required.

Provider name (e.g., ‘openai’, ‘my-gateway’). Must be unique in project, used for upserting.

Source

pub fn adapter(self, value: String) -> LlmConnectionBuilder<SetAdapter<S>>
where S::Adapter: IsUnset,

Required.

The adapter used to interface with the LLM

Source

pub fn display_secret_key( self, value: String, ) -> LlmConnectionBuilder<SetDisplaySecretKey<S>>
where S::DisplaySecretKey: IsUnset,

Required.

Masked version of the secret key for display purposes

Source

pub fn base_url( self, value: Option<String>, ) -> LlmConnectionBuilder<SetBaseUrl<S>>
where S::BaseUrl: IsUnset,

Optional (Some / Option setters). Custom base URL for the LLM API

Source

pub fn maybe_base_url( self, value: Option<Option<String>>, ) -> LlmConnectionBuilder<SetBaseUrl<S>>
where S::BaseUrl: IsUnset,

Optional (Some / Option setters). Custom base URL for the LLM API

Source

pub fn custom_models( self, value: Vec<String>, ) -> LlmConnectionBuilder<SetCustomModels<S>>
where S::CustomModels: IsUnset,

Required.

List of custom model names available for this connection

Source

pub fn with_default_models( self, value: bool, ) -> LlmConnectionBuilder<SetWithDefaultModels<S>>
where S::WithDefaultModels: IsUnset,

Required.

Whether to include default models for this adapter

Source

pub fn extra_header_keys( self, value: Vec<String>, ) -> LlmConnectionBuilder<SetExtraHeaderKeys<S>>
where S::ExtraHeaderKeys: IsUnset,

Required.

Keys of extra headers sent with requests (values excluded for security)

Source

pub fn config( self, value: Option<HashMap<String, Value>>, ) -> LlmConnectionBuilder<SetConfig<S>>
where S::Config: IsUnset,

Optional (Some / Option setters). Adapter-specific configuration. Required for Bedrock ({\"region\":\"us-east-1\"}), optional for VertexAI ({\"location\":\"us-central1\"}), not used by other adapters.

Source

pub fn maybe_config( self, value: Option<Option<HashMap<String, Value>>>, ) -> LlmConnectionBuilder<SetConfig<S>>
where S::Config: IsUnset,

Optional (Some / Option setters). Adapter-specific configuration. Required for Bedrock ({\"region\":\"us-east-1\"}), optional for VertexAI ({\"location\":\"us-central1\"}), not used by other adapters.

Source

pub fn created_at( self, value: DateTime<FixedOffset>, ) -> LlmConnectionBuilder<SetCreatedAt<S>>
where S::CreatedAt: IsUnset,

Required.

Source

pub fn updated_at( self, value: DateTime<FixedOffset>, ) -> LlmConnectionBuilder<SetUpdatedAt<S>>
where S::UpdatedAt: IsUnset,

Required.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more