This is a library for integrating OpenAI in your flow function for test.flows.network.
```rust use openaiflows::{CompletionRequest, completion} use slackflows::{listentochannel, sendmessageto_channel};
pub fn run() { listentochannel("myworkspace", "mychannel", |sm| { let cr = CompletionRequest { prompt: sm.text, ..Default::default() }; let r = createcompletion("myaccount", cr); r.iter().foreach(|c| { sendmessagetochannel("myworkspace", "mychannel", c.tostring()); }); } } ```
When a new message is received from mychannel
, we will create completions using create_completion
then send the result back to Slack.
The whole document is here.