pub struct CompletionApi { /* private fields */ }Expand description
API endpoint for text completions.
Implementations§
Source§impl CompletionApi
impl CompletionApi
Sourcepub fn new(http_client: ReqwestClient, config: &ClientConfig) -> Self
pub fn new(http_client: ReqwestClient, config: &ClientConfig) -> Self
Creates a new CompletionApi with the given reqwest client and configuration.
Sourcepub async fn completion(
&self,
request: CompletionRequest,
) -> Result<CompletionResponse>
pub async fn completion( &self, request: CompletionRequest, ) -> Result<CompletionResponse>
Calls the completions endpoint. The request payload includes at minimum the model and prompt fields,
along with any additional generation parameters (temperature, top_p, and so on).
Auto Trait Implementations§
impl Freeze for CompletionApi
impl !RefUnwindSafe for CompletionApi
impl Send for CompletionApi
impl Sync for CompletionApi
impl Unpin for CompletionApi
impl !UnwindSafe for CompletionApi
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