This is a library for integrating OpenAI in your flow function for [test.flows.network](https://test.flows.network).
## Usage example
```rust
use openai_flows::{CompletionRequest, completion}
use slack_flows::{listen_to_channel, send_message_to_channel};
#[no_mangle]
pub fn run() {
listen_to_channel("myworkspace", "mychannel", |sm| {
let cr = CompletionRequest {
prompt: sm.text,
..Default::default()
};
let r = create_completion("myaccount", cr);
r.iter().for_each(|c| {
send_message_to_channel("myworkspace", "mychannel", c.to_string());
});
}
}
```
When a new message is received from `mychannel`, we will create completions using [`create_completion`](https://docs.rs/openai-flows/latest/openai_flows/fn.create_completion.html) then send the result back to Slack.
The whole document is [here](https://docs.rs/openai-flows).