pub struct TaskForceAI { /* private fields */ }Implementations§
Source§impl TaskForceAI
impl TaskForceAI
pub fn new(options: TaskForceAIOptions) -> Result<Self, TaskForceAIError>
pub async fn submit_task( &self, prompt: &str, options: Option<TaskSubmissionOptions>, ) -> Result<String, TaskForceAIError>
pub async fn get_task_status( &self, task_id: &str, ) -> Result<TaskStatus, TaskForceAIError>
pub async fn wait_for_completion( &self, task_id: &str, poll_interval: Option<Duration>, max_attempts: Option<u32>, ) -> Result<TaskStatus, TaskForceAIError>
pub async fn run_task( &self, prompt: &str, options: Option<TaskSubmissionOptions>, poll_interval: Option<Duration>, max_attempts: Option<u32>, ) -> Result<TaskStatus, TaskForceAIError>
Source§impl TaskForceAI
impl TaskForceAI
Sourcepub async fn upload_file(
&self,
filename: &str,
content: Bytes,
options: Option<FileUploadOptions>,
) -> Result<File, TaskForceAIError>
pub async fn upload_file( &self, filename: &str, content: Bytes, options: Option<FileUploadOptions>, ) -> Result<File, TaskForceAIError>
Uploads a file to the API.
Sourcepub async fn list_files(
&self,
limit: i32,
offset: i32,
) -> Result<FileListResponse, TaskForceAIError>
pub async fn list_files( &self, limit: i32, offset: i32, ) -> Result<FileListResponse, TaskForceAIError>
Retrieves a list of uploaded files.
Sourcepub async fn get_file(&self, file_id: &str) -> Result<File, TaskForceAIError>
pub async fn get_file(&self, file_id: &str) -> Result<File, TaskForceAIError>
Retrieves metadata for a specific file.
Sourcepub async fn delete_file(&self, file_id: &str) -> Result<(), TaskForceAIError>
pub async fn delete_file(&self, file_id: &str) -> Result<(), TaskForceAIError>
Deletes a file by ID.
Sourcepub async fn download_file(
&self,
file_id: &str,
) -> Result<Bytes, TaskForceAIError>
pub async fn download_file( &self, file_id: &str, ) -> Result<Bytes, TaskForceAIError>
Downloads the content of a file.
Source§impl TaskForceAI
impl TaskForceAI
pub async fn stream_task_status( &self, task_id: &str, ) -> Result<TaskStatusStream, TaskForceAIError>
pub async fn run_task_stream( &self, prompt: &str, options: Option<TaskSubmissionOptions>, ) -> Result<TaskStatusStream, TaskForceAIError>
Source§impl TaskForceAI
impl TaskForceAI
Sourcepub async fn create_thread(
&self,
options: Option<CreateThreadOptions>,
) -> Result<Thread, TaskForceAIError>
pub async fn create_thread( &self, options: Option<CreateThreadOptions>, ) -> Result<Thread, TaskForceAIError>
Creates a new conversation thread.
Sourcepub async fn list_threads(
&self,
limit: i32,
offset: i32,
) -> Result<ThreadListResponse, TaskForceAIError>
pub async fn list_threads( &self, limit: i32, offset: i32, ) -> Result<ThreadListResponse, TaskForceAIError>
Retrieves a list of threads.
Sourcepub async fn get_thread(
&self,
thread_id: i64,
) -> Result<Thread, TaskForceAIError>
pub async fn get_thread( &self, thread_id: i64, ) -> Result<Thread, TaskForceAIError>
Retrieves a specific thread by ID.
Sourcepub async fn delete_thread(
&self,
thread_id: i64,
) -> Result<(), TaskForceAIError>
pub async fn delete_thread( &self, thread_id: i64, ) -> Result<(), TaskForceAIError>
Deletes a thread by ID.
Sourcepub async fn get_thread_messages(
&self,
thread_id: i64,
limit: i32,
offset: i32,
) -> Result<ThreadMessagesResponse, TaskForceAIError>
pub async fn get_thread_messages( &self, thread_id: i64, limit: i32, offset: i32, ) -> Result<ThreadMessagesResponse, TaskForceAIError>
Retrieves messages from a thread.
Sourcepub async fn run_in_thread(
&self,
thread_id: i64,
options: ThreadRunOptions,
) -> Result<ThreadRunResponse, TaskForceAIError>
pub async fn run_in_thread( &self, thread_id: i64, options: ThreadRunOptions, ) -> Result<ThreadRunResponse, TaskForceAIError>
Submits a prompt within a thread context.
Auto Trait Implementations§
impl Freeze for TaskForceAI
impl !RefUnwindSafe for TaskForceAI
impl Send for TaskForceAI
impl Sync for TaskForceAI
impl Unpin for TaskForceAI
impl !UnwindSafe for TaskForceAI
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