From 67e28d393dd9614252c77caad05ecc4151dc7578 Mon Sep 17 00:00:00 2001 From: Moritz Althaus Date: Wed, 12 Jun 2024 15:16:19 +0200 Subject: [PATCH] docs: replace deprecated execute method with completion --- src/lib.rs | 2 +- src/prompt.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4d874fa..9a50ab3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ //! let task = TaskCompletion::from_text("An apple a day", 10); //! //! // Retrieve the answer from the API -//! let response = client.execute(model, &task, &How::default()).await.unwrap(); +//! let response = client.completion(&task, model, &How::default()).await.unwrap(); //! //! // Print entire sentence with completion //! println!("An apple a day{}", response.completion); diff --git a/src/prompt.rs b/src/prompt.rs index 590b4f9..acde35c 100644 --- a/src/prompt.rs +++ b/src/prompt.rs @@ -80,7 +80,7 @@ impl<'a> Modality<'a> { /// The model can only see squared pictures. Images are centercropped. /// /// ```no_run - /// use aleph_alpha_client::{Client, How, Modality, Prompt, Sampling, Stopping, TaskCompletion}; + /// use aleph_alpha_client::{Client, How, Modality, Prompt, Sampling, Stopping, TaskCompletion, Task}; /// use dotenv::dotenv; /// use std::path::PathBuf; /// @@ -102,8 +102,8 @@ impl<'a> Modality<'a> { /// }; /// // Execute /// let model = "luminous-base"; - /// let client = Client::new(&aa_api_token).unwrap(); - /// let response = client.execute(model, &task, &How::default()).await.unwrap(); + /// let job = task.with_model(model); + /// let response = client.output_of(&job, &How::default()).await.unwrap(); /// // Show result /// println!("{}", response.completion); /// }