pub struct LlmAllowList { /* private fields */ }Expand description
Allow only requests to listed LLM providers.
use mlua_batteries::policy::LlmAllowList;
let policy = LlmAllowList::new(["ollama", "openai"]);Implementations§
Source§impl LlmAllowList
impl LlmAllowList
Trait Implementations§
Source§impl Debug for LlmAllowList
impl Debug for LlmAllowList
Source§impl LlmPolicy for LlmAllowList
impl LlmPolicy for LlmAllowList
Source§fn check_request(
&self,
provider: &str,
_model: &str,
_base_url: &str,
) -> Result<(), PolicyError>
fn check_request( &self, provider: &str, _model: &str, _base_url: &str, ) -> Result<(), PolicyError>
Validate an LLM request before it is sent. Read more
Source§fn policy_name(&self) -> &'static str
fn policy_name(&self) -> &'static str
Human-readable name for this policy, used in
Debug output. Read moreAuto Trait Implementations§
impl Freeze for LlmAllowList
impl RefUnwindSafe for LlmAllowList
impl Send for LlmAllowList
impl Sync for LlmAllowList
impl Unpin for LlmAllowList
impl UnsafeUnpin for LlmAllowList
impl UnwindSafe for LlmAllowList
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more