Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Aleph-Alpha/aleph-alpha-client-rs
https://github.com/Aleph-Alpha/aleph-alpha-client-rs
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/Aleph-Alpha/aleph-alpha-client-rs
- Owner: Aleph-Alpha
- License: mit
- Created: 2022-01-22T13:59:16.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T21:23:18.000Z (19 days ago)
- Last Synced: 2024-10-25T06:02:58.177Z (18 days ago)
- Language: Rust
- Size: 1.45 MB
- Stars: 7
- Watchers: 12
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Aleph Alpha API client for Rust
Interact with large language models provided by the Aleph Alpha API in Rust code.
## Usage
```rust
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", 10);
// 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);
}
```This is a **work in progress** currently the Rust client is not a priority on our Roadmap, so expect this client to be incomplete. If we work on it expect interfaces to break.