| Crates.io | gruq |
| lib.rs | gruq |
| version | 0.1.1 |
| created_at | 2024-09-22 11:34:30.73269+00 |
| updated_at | 2024-09-22 11:56:00.016259+00 |
| description | Groq Rust SDK |
| homepage | https://github.com/roushou/mesh |
| repository | https://github.com/roushou/mesh |
| max_upload_size | |
| id | 1382879 |
| size | 31,661 |
This is an unofficial Rust SDK for the Groq API.
More information about this crate can be found in the crate documentation.
Add gruq as a dependency to your Cargo.toml
$ cargo add gruq
An example to create a completion.
use gruq::{
chat::message::{CreateChatCompletion, Message, Role},
client::Client,
config::Config,
models::Model,
};
#[tokio::main]
async fn main() {
let config = Config::from_env().unwrap();
let client = Client::new(config).unwrap();
let messages: Vec<Message> = vec![Message {
role: Role::User,
content: "Hello World".to_string(),
name: None,
}];
let completion_request = CreateChatCompletion::new(Model::Llama38B, messages);
let completion = client
.chat
.create_completion(completion_request)
.await
.unwrap();
println!("{:?}", completion);
}
This project is licensed under the MIT license and Apache-2.0 license.