Usage

Using the SmartGPT API.

Once you've initialized an instance of SmartGPT, you can easily use it like so:

let execution = smartgpt.run_task(
    "Write an essay on Barack Obama.",
    |action| Ok(()),
    |update| Ok(())
);

The second parameter is known as allow_action. It allows you to take an action, and decide whether or not it should be authorized. Errors are returned in the form of DisallowedAction, which means there was an error in allowing the action, indicating that it shouldn't be allowed.

The third parameter is known as listen_on_update, and allows you to handle the UI for every step in using SmartGPT.

Last updated