Crate banana_rust_sdk
source ·Expand description
The Banana sdk contains three simple asycn functions to call the Banana services API.
We’re moving fast and so we will most likely not prioritize backwards compatibility. The run() function is what you’ll use 99% of the time and the other can be seen as helper functions
Examples
Basic usage:
use banana_rust_sdk;
use serde::Serialize;
#[tokio::main]
async fn main() {
#[derive(Serialize)]
struct ModelInputs {
prompt: String
}
let api_key = "API_KEY";
let model_key = "MODEL_KEY";
let model_inputs = ModelInputs {
prompt: "try to predict the next [MASK] of this sentence.".to_string()
};
let model_inputs = serde_json::to_value(model_inputs).unwrap();
let res = banana_rust_sdk::run(api_key, model_key, model_inputs).await.unwrap();
let json = serde_json::to_value(res).unwrap();
println!("{:?}", json);
}