pub struct UniversalLLMClient { /* private fields */ }Implementations§
Source§impl UniversalLLMClient
impl UniversalLLMClient
pub fn new( provider_model: &str, api_key: Option<String>, ) -> Result<Self, String>
Sourcepub fn new_with_config(llm_config: LLMConfig) -> Result<Self, String>
pub fn new_with_config(llm_config: LLMConfig) -> Result<Self, String>
Create a new UniversalLLMClient with comprehensive LLMConfig
§Examples
use ceylon_next::llm::LLMConfig;
use ceylon_next::llm::UniversalLLMClient;
let config = LLMConfig::new("openai::gpt-4")
.with_api_key("your-api-key")
.with_temperature(0.7)
.with_max_tokens(2048);
let client = UniversalLLMClient::new_with_config(config).unwrap();Trait Implementations§
Source§impl Clone for UniversalLLMClient
impl Clone for UniversalLLMClient
Source§impl LLMClient for UniversalLLMClient
impl LLMClient for UniversalLLMClient
Source§fn complete<'life0, 'life1, 'life2, 'async_trait, T, C>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
) -> Pin<Box<dyn Future<Output = Result<T, String>> + Send + 'async_trait>>where
T: LLMResponseTrait<C> + Default + Send + 'async_trait,
C: for<'de> Deserialize<'de> + Default + Send + Serialize + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait, T, C>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
) -> Pin<Box<dyn Future<Output = Result<T, String>> + Send + 'async_trait>>where
T: LLMResponseTrait<C> + Default + Send + 'async_trait,
C: for<'de> Deserialize<'de> + Default + Send + Serialize + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send messages to LLM and get a response
Auto Trait Implementations§
impl Freeze for UniversalLLMClient
impl !RefUnwindSafe for UniversalLLMClient
impl Send for UniversalLLMClient
impl Sync for UniversalLLMClient
impl Unpin for UniversalLLMClient
impl !UnwindSafe for UniversalLLMClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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