#chat #translation #transcription #api #api-client #response #transcribe

bin+lib safi

萨菲API客户端,用于消费聊天、转录和翻译API

1个不稳定版本

0.1.0 2024年8月6日

#1364Web编程

Download history 115/week @ 2024-08-05

每月115 次下载

MIT 许可证

10KB
98

API易于使用

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),
}

}

依赖关系

~6–18MB
~270K SLoC