1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::{
    error::OpenAIError,
    types::{CreateEditRequest, CreateEditResponse},
    Client,
};

/// Given a prompt and an instruction, the model will return
/// an edited version of the prompt.
pub struct Edit;

impl Edit {
    /// Creates a new edit for the provided input, instruction, and parameters
    pub async fn create(
        client: &Client,
        request: CreateEditRequest,
    ) -> Result<CreateEditResponse, OpenAIError> {
        client.post("/edits", request).await
    }
}