pub struct Model {
pub parent: Config,
pub versions: Version,
}
Expand description
Used to interact with the Model Endpoints.
Fields§
§parent: Config
Holds a reference to a Configuration struct, which contains the base url, auth token among other settings.
versions: Version
Holds a reference to a Version struct, which contains the functionality for interacting with the version endpoints of the Replicate API.
Implementations§
Source§impl Model
Model struct contains all the functionality for interacting with the model endpoints of the Replicate API.
Currently supports the following endpoint:
impl Model
Model struct contains all the functionality for interacting with the model endpoints of the Replicate API. Currently supports the following endpoint:
Sourcepub fn new(rep: Config) -> Self
pub fn new(rep: Config) -> Self
Create a new Model struct.
§Arguments
rep
- The config (crate::config::Config
) to use for authentication and communication.
Sourcepub fn get(
&self,
model_owner: &str,
model_name: &str,
) -> Result<GetModel, ReplicateError>
pub fn get( &self, model_owner: &str, model_name: &str, ) -> Result<GetModel, ReplicateError>
Get the details of a model.
§Arguments
model_owner
- The owner of the model.model_name
- The name of the model.
§Example
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
let model = replicate.models.get("replicate", "hello-world")?;
println!("Model : {:?}", model);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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