Skip to content

Commit

Permalink
docs(groq): update README
Browse files Browse the repository at this point in the history
  • Loading branch information
roushou committed Sep 22, 2024
1 parent ba78a46 commit 45e1989
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion groq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gruq"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
authors = ["Roushou <[email protected]>"]
description = "Groq Rust SDK"
Expand Down
14 changes: 9 additions & 5 deletions groq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ An example to create a completion.

```rust,ignore
use gruq::{
chats::message::{CreateChatCompletion, Message, Role},
chat::message::{CreateChatCompletion, Message, Role},
client::Client,
config::Config,
models::{gpt::Gpt, Model},
models::Model,
};
#[tokio::main]
Expand All @@ -44,12 +44,16 @@ async fn main() {
let client = Client::new(config).unwrap();
let messages: Vec<Message> = vec![Message {
content: "Hello World".into(),
role: Role::User,
content: "Hello World".to_string(),
name: None,
}];
let request = CreateChatCompletion::new(Model::Gpt(Gpt::GPT4), messages);
let completion = client.chat.create_completion(request).await.unwrap();
let completion_request = CreateChatCompletion::new(Model::Llama38B, messages);
let completion = client
.chat
.create_completion(completion_request)
.await
.unwrap();
println!("{:?}", completion);
}
```
Expand Down

0 comments on commit 45e1989

Please sign in to comment.