-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCargo.toml
127 lines (117 loc) · 3.9 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
[package]
name = "misanthropic"
version = "0.5.1"
edition = "2021"
authors = ["Michael de Gans <[email protected]>"]
description = "An async, ergonomic, client for Anthropic's Messages API"
homepage = "https://github.com/mdegans/misanthropic"
repository = "https://github.com/mdegans/misanthropic"
readme = "README.md"
keywords = ["anthropic", "messages", "client", "async", "stream"]
categories = [
"api-bindings",
"asynchronous",
"network-programming",
"text-processing",
"web-programming::http-client",
]
license = "MIT"
[package.metadata.docs.rs]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
[lints.rust]
unsafe_code = "forbid"
[profile.release]
lto = true
strip = true
# There are (hopefully) no panics in this library. If there are, they are bugs.
panic = "abort"
[dependencies]
base64 = "0.22"
derive_more = { version = "1", features = ["from", "is_variant", "display"] }
eventsource-stream = "0.2"
futures = "0.3"
image = { version = "0.25", optional = true }
log = { version = "0.4", optional = true }
memsecurity = { version = "3.5", optional = true }
zeroize = { version = "1", features = ["derive"] }
# rustls because I am sick of getting Dependabot alerts for OpenSSL.
reqwest = { version = "0.12", features = ["json", "stream"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
# markdown support
pulldown-cmark = { version = "0.12", optional = true, features = ["serde"] }
pulldown-cmark-to-cmark = { version = "17", optional = true }
static_assertions = "1"
langsan = { version = "0", features = [
"english",
"french",
"german",
"italian",
"serde",
"emoji",
"verbose",
], optional = true }
# For HTML escaping
xml-rs = { version = "0.8", optional = true }
[dev-dependencies]
# for all examples
clap = { version = "4", features = ["derive"] }
env_logger = "0.11"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
# for the strawberry example
itertools = "0.13"
# for the python example
subprocess = "0.2"
tempfile = "3.12"
[features]
# rustls because I am sick of getting Dependabot alerts for OpenSSL.
default = ["rustls-tls", "langsan"]
# Image crate support. Note that images are supported without this feature but
# you must handle encoding/decoding yourself. This is mostly for interop with
# the `image` crate.
image = ["dep:image"]
# A beta has been enabled. It is not necessary to set this manually. Only one
# beta can be enabled at a time (for example, `prompt-caching`).
beta = []
# Use the image crate to support JPEG images.
jpeg = ["image", "image/jpeg"]
# Use the image crate to support PNG images.
png = ["image", "image/png"]
# Use the image crate to support GIF images.
gif = ["image", "image/gif"]
# Use the image crate to support WEBP images.
webp = ["image", "image/webp"]
# Enable prompt caching (recommended, however limits model choices)
prompt-caching = ["beta"]
# Enable logging
log = ["dep:log"]
# Use rustls instead of the system SSL, such as OpenSSL.
rustls-tls = ["reqwest/rustls-tls"]
# Use `pulldown-cmark` for markdown parsing and `pulldown-cmark-to-cmark` for
# converting to CommonMark.
markdown = ["pulldown-cmark/serde", "dep:pulldown-cmark-to-cmark"]
# Utilities for converting prompts and messages to HTML. Enables `markdown`.
html = ["markdown", "xml-rs"]
# Derive PartialEq for all structs and enums.
partial-eq = []
# Input and output sanitization
langsan = ["dep:langsan"]
# Encrypted key in memory. Without this the key is still zeroed on drop, but is
# not encrypted. This is a more secure option for the paranoid. Does not build
# on wasm32.
memsecurity = ["dep:memsecurity"]
[[example]]
name = "strawberry"
required-features = ["markdown"]
doc-scrape-examples = true
[[example]]
name = "python"
required-features = ["markdown", "prompt-caching"]
doc-scrape-examples = true
[[example]]
name = "website_wizard"
doc-scrape-examples = true
[[example]]
name = "neologism"
doc-scrape-examples = true