| Crates.io | safi |
| lib.rs | safi |
| version | 0.1.0 |
| created_at | 2024-08-06 23:02:36.968003+00 |
| updated_at | 2024-08-06 23:02:36.968003+00 |
| description | Safi API Client for consuming chat, transcription, and translation APIs. |
| homepage | |
| repository | https://safi.insolify.com |
| max_upload_size | |
| id | 1327816 |
| size | 36,727 |
The API is easy to use:
use safi_api_client::{chat::chat, transcription::transcribe, translation::translate}; use tokio;
#[tokio::main] async fn main() { let api_key = "your-api-key";
// Example usage of chat API
match chat("Hello, Safi!", api_key).await {
Ok(response) => println!("Chat response: {}", response),
Err(e) => eprintln!("Error: {}", e),
}
// Example usage of transcription API
match transcribe("https://safi.insolify.com/audio.mp3", api_key).await {
Ok(response) => println!("Transcription: {}", response),
Err(e) => eprintln!("Error: {}", e),
}
// Example usage of translation API
match translate("How far bro", "pidgin", api_key).await {
Ok(response) => println!("Translation: {}", response),
Err(e) => eprintln!("Error: {}", e),
}
}