pub struct FileParserCreateRequest {
pub key: String,
pub file_path: PathBuf,
pub tool_type: ToolType,
pub file_type: FileType,
}Expand description
File parser creation client.
This client provides functionality to create file parsing tasks, supporting multiple file formats and parsing tools.
§Examples
ⓘ
use zai_rs::tool::file_parser_create::{FileParserCreateRequest, ToolType, FileType};
use std::path::Path;
let api_key = "your-api-key".to_string();
let file_path = Path::new("document.pdf");
let request = FileParserCreateRequest::new(
api_key,
file_path,
ToolType::Lite,
FileType::PDF,
)?;Fields§
§key: StringAPI key for authentication
file_path: PathBufPath to the file to parse
tool_type: ToolTypeParsing tool type to use
file_type: FileTypeFile type to parse
Implementations§
Source§impl FileParserCreateRequest
impl FileParserCreateRequest
Sourcepub fn new(
key: String,
file_path: &Path,
tool_type: ToolType,
file_type: FileType,
) -> ZaiResult<Self>
pub fn new( key: String, file_path: &Path, tool_type: ToolType, file_type: FileType, ) -> ZaiResult<Self>
Sourcepub fn new_with_auto_type(
key: String,
file_path: &Path,
tool_type: ToolType,
) -> ZaiResult<Self>
pub fn new_with_auto_type( key: String, file_path: &Path, tool_type: ToolType, ) -> ZaiResult<Self>
Sourcepub async fn send(&self) -> ZaiResult<FileParserCreateResponse>
pub async fn send(&self) -> ZaiResult<FileParserCreateResponse>
Sends the file parser task creation request.
§Returns
A FileParserCreateResponse containing the task ID and status.
Auto Trait Implementations§
impl Freeze for FileParserCreateRequest
impl RefUnwindSafe for FileParserCreateRequest
impl Send for FileParserCreateRequest
impl Sync for FileParserCreateRequest
impl Unpin for FileParserCreateRequest
impl UnsafeUnpin for FileParserCreateRequest
impl UnwindSafe for FileParserCreateRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more