21 个版本 (10 个重大更改)
新 0.11.0 | 2024 年 8 月 9 日 |
---|---|
0.10.1 | 2024 年 7 月 4 日 |
0.9.0 | 2024 年 6 月 13 日 |
0.7.1 | 2023 年 11 月 30 日 |
0.4.0 | 2022 年 10 月 29 日 |
#92 in 机器学习
每月 931 次下载
1.5MB
870 行
Aleph Alpha API 的 Rust 客户端
在 Rust 代码中与 Aleph Alpha API 提供的大型语言模型交互。
使用方法
use aleph_alpha_client::{Client, TaskCompletion, How, Task};
#[tokio::main]
fn main() {
// Authenticate against API. Fetches token.
let client = Client::with_authentication("AA_API_TOKEN").unwrap();
// Name of the model we we want to use. Large models give usually better answer, but are also
// more costly.
let model = "luminous-base";
// The task we want to perform. Here we want to continue the sentence: "An apple a day ..."
let task = TaskCompletion::from_text("An apple a day");
// Retrieve the answer from the API
let response = client.completion(&task, model, &How::default()).await.unwrap();
// Print entire sentence with completion
println!("An apple a day{}", response.completion);
}
这是一个 正在进行中 的项目,目前 Rust 客户端不是我们的路线图上的优先事项,因此请期待这个客户端可能不完整。如果我们继续开发它,接口可能会中断。
依赖项
~7–21MB
~275K SLoC