pub struct GrokModel { /* private fields */ }Expand description
xAI Grok provider adapter implementing ChatModel.
Implementations§
Source§impl GrokModel
impl GrokModel
Sourcepub fn new(config: GrokModelConfig) -> Result<Self, ProviderError>
pub fn new(config: GrokModelConfig) -> Result<Self, ProviderError>
Creates a model adapter from explicit config.
Trait Implementations§
Source§impl ChatModel for GrokModel
impl ChatModel for GrokModel
Source§fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ModelMessage],
tools: &'life2 [ModelToolDefinition],
tool_choice: ModelToolChoice,
) -> Pin<Box<dyn Future<Output = Result<ModelCompletion, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ModelMessage],
tools: &'life2 [ModelToolDefinition],
tool_choice: ModelToolChoice,
) -> Pin<Box<dyn Future<Output = Result<ModelCompletion, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invokes one model completion step for the current message history.
Auto Trait Implementations§
impl Freeze for GrokModel
impl !RefUnwindSafe for GrokModel
impl Send for GrokModel
impl Sync for GrokModel
impl Unpin for GrokModel
impl UnsafeUnpin for GrokModel
impl !UnwindSafe for GrokModel
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