mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Add batch api
This commit is contained in:
@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileData {
|
||||
pub id: String,
|
||||
pub oejct: String,
|
||||
pub object: String,
|
||||
pub bytes: i32,
|
||||
pub created_at: i64,
|
||||
pub filename: String,
|
||||
@ -34,7 +34,7 @@ impl FileUploadRequest {
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileUploadResponse {
|
||||
pub id: String,
|
||||
pub oejct: String,
|
||||
pub object: String,
|
||||
pub bytes: i32,
|
||||
pub created_at: i64,
|
||||
pub filename: String,
|
||||
@ -56,48 +56,15 @@ impl FileDeleteRequest {
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileDeleteResponse {
|
||||
pub id: String,
|
||||
pub oejct: String,
|
||||
pub object: String,
|
||||
pub delete: bool,
|
||||
pub headers: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct FileRetrieveRequest {
|
||||
pub file_id: String,
|
||||
}
|
||||
|
||||
impl FileRetrieveRequest {
|
||||
pub fn new(file_id: String) -> Self {
|
||||
Self { file_id }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileRetrieveResponse {
|
||||
pub id: String,
|
||||
pub oejct: String,
|
||||
pub bytes: i32,
|
||||
pub created_at: i64,
|
||||
pub filename: String,
|
||||
pub purpose: String,
|
||||
pub headers: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct FileRetrieveContentRequest {
|
||||
pub file_id: String,
|
||||
}
|
||||
|
||||
impl FileRetrieveContentRequest {
|
||||
pub fn new(file_id: String) -> Self {
|
||||
Self { file_id }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct FileRetrieveContentResponse {
|
||||
pub id: String,
|
||||
pub oejct: String,
|
||||
pub object: String,
|
||||
pub bytes: i32,
|
||||
pub created_at: i64,
|
||||
pub filename: String,
|
||||
|
Reference in New Issue
Block a user