This is only interacting with OpenAI's language models
cli
There is a library that exposes the various endpoints and a command line binary (cli
) to use it
To use: cargo run --bin cli -- --help
``` Command line argument definitions
Usage: cli [OPTIONS]
Options:
-m, --model OPENAI_API_KEY
]
-d, --mode
When the programme is running, enter prompts at the ">".
Generally text entered is sent to the LLM.
Text that starts with "! " is a command to the system.
|Command| Result|
|:---|:---|
|! p| List internal settings|
|! md| List available models|
|! ms <prompt>
]| Set or display the system
prompt. This only really makes sense in chat after ! cc
|
|! mask
The LLMs can be used in different modes. Each mode corresponds to an API endpoint.
The meaning of the prompts change with the mode.
role
set to "system". It defines the characteristics of the machine. Some examples:
Generate or edit images based on a prompt.
Enter Image mode with the meta command: ! m image [image to edit]
. If you provide an image to edit "ImageEdit" mode is entered instead, and the supplied image is edited.
If an image is not supplied (at ! m image
prompt) the user enters a prompt and an image is generated by OpenAI based n that prompt. It is stored for image edit. Generating a new image over writes the old one.
Mask To edit an image the process works best if a mask is supplied. This is a 1024x1024 PNG image with a transparent region. The editing will happen in the transparent region. There are two ways to supply a mask: when entering image edit, or with a meta command
! m image_edit path_to/mask.png
mask
Meta Command The mask can be set or changed at any time using the meta command: ! mask path/to_mask.png
If no mask is supplied a 1024x1024 transparent PNG file is created and used.