An easy-to-use typed Google Dialogflow client for Rust
This library was extracted from a personal project. As a result, it may still be very basic and quite rigid. However, I'm all for this library growing and becoming more capable.
The concept of this library is to provide a relatively type-safe interface to Dialogflow. Intents are modelled as a single Rust enum
that you can pattern-match on.
Take the following Dialogflow intents:
You can then query and deserialize intents with this code :
```rust
enum Intent { Hello, Weather { location: String, }, ThankYou, }
let intent = dialogflow.detectintentserde::
match intent { Intent::Weather { location } => println!("The user asked for the weather in/at {location}"), ... } ```
Due to the private / proprietary / externally-hosted nature of Dialogflow, testing this library isn't as easy as any other library. In addition to that, because Dialogflow relies on AI, there's always a small probability that a text may be interpreted differently if the model is re-trained, making tests undeterministic. I could eventually try to make the Google Backend mockable to test the deserialization part of the library. Besides that, I'm running tests locally on a private Dialogflow model, but having tests run on only one computer makes it impossible to enforce rules about having the code pass tests before being commited.
MIT OR APACHE-2.0