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
//! Type-safe inline judgments from TypeSafe Jev.
//!
//! ```no_run
//! use guideme::{choose, noul, score, Choice, Guide, Levels, Policy};
//!
//! #[derive(Choice, Clone, Copy, PartialEq, Eq, Debug)]
//! enum Department {
//! /// Payments, invoicing, refunds
//! Billing,
//! /// Bugs, outages, integrations
//! Technical,
//! /// Pricing, upgrades, new accounts
//! #[guide(fallback)]
//! Sales,
//! }
//!
//! #[derive(Levels, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
//! enum Frustration {
//! /// Calm and polite
//! Calm,
//! /// Frustrated
//! Frustrated,
//! /// Very angry
//! VeryAngry,
//! }
//!
//! # async fn demo(ticket: &str) -> Result<(), guideme::Error> {
//! let guide = Guide::from_env()?; // TYPESAFE_API_KEY
//!
//! if guide.ask(noul("Should this ticket be escalated?"), ticket).await? {
//! // escalate
//! }
//!
//! match guide.ask(choose::<Department>("Which team should handle this?"), ticket).await? {
//! Department::Billing => {}
//! Department::Technical => {}
//! Department::Sales => {}
//! }
//!
//! if guide.ask(score::<Frustration>("How frustrated is the customer?"), ticket).await?
//! >= Frustration::Frustrated
//! {
//! // prioritise
//! }
//!
//! // three judgments, one request, one span
//! let (urgent, dept, mood) = guide
//! .ask(
//! (
//! noul("Is this urgent?").yes_above(0.7).no_below(0.3).or(false),
//! choose::<Department>("Which team?").with(Policy::new().min_confidence(0.6)),
//! score::<Frustration>("How frustrated?").detail(),
//! ),
//! ticket,
//! )
//! .await?;
//! # let _ = (urgent, dept, mood);
//! # Ok(()) }
//! ```
pub use Ask;
pub use Error;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;