#language-model #api-client #ai #llm #api-bindings #aleph-alpha

aleph-alpha-client

在 Rust 代码中与 Aleph Alpha API 提供的大型语言模型交互

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 机器学习

Download history 100/week @ 2024-04-22 184/week @ 2024-04-29 112/week @ 2024-05-06 107/week @ 2024-05-13 112/week @ 2024-05-20 289/week @ 2024-05-27 101/week @ 2024-06-03 306/week @ 2024-06-10 259/week @ 2024-06-17 487/week @ 2024-06-24 622/week @ 2024-07-01 228/week @ 2024-07-08 184/week @ 2024-07-15 194/week @ 2024-07-22 189/week @ 2024-07-29 349/week @ 2024-08-05

每月 931 次下载

MIT 许可证

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