Skip to content

Commit

Permalink
Patch README.md usage (#4)
Browse files Browse the repository at this point in the history
Rename `Request` to `Prompt`
  • Loading branch information
mdegans authored Sep 24, 2024
1 parent 0735915 commit f82988b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "misanthropic"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Michael de Gans <[email protected]>"]
description = "An async, ergonomic, client for Anthropic's Messages API"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Is an unofficial simple, ergonomic, client for the Anthropic Messages API.
// When requests are made, the key header is marked as sensitive.
let client = Client::new(key)?;

// Request a stream of events or errors. `json!` can be used, the `Request`
// Request a stream of events or errors. `json!` can be used, the `Prompt`
// builder pattern (shown in the `Single Message` example below), or anything
// serializable.
let stream = client
Expand Down Expand Up @@ -51,10 +51,10 @@ let content: String = stream
let client = Client::new(key)?;

// Many common usage patterns are supported out of the box for building
// `Request`s, such as messages from an iterable of tuples of `Role` and
// `Prompt`s, such as messages from an iterable of tuples of `Role` and
// `String`.
let message = client
.message(Request::default().messages([(Role::User, args.prompt)]))
.message(Prompt::default().messages([(Role::User, args.prompt)]))
.await?;

println!("{}", message);
Expand Down

0 comments on commit f82988b

Please sign in to comment.