| Crates.io | batch-mode-batch-client |
| lib.rs | batch-mode-batch-client |
| version | 0.2.2 |
| created_at | 2025-02-27 05:50:36.729368+00 |
| updated_at | 2025-07-13 10:39:41.214342+00 |
| description | This crate provides a client for interacting with OpenAI's batch processing API, allowing you to manage and download batch files asynchronously. It offers functionality for managing batch statuses, uploading files, and retrieving results after batch processing. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1571347 |
| size | 253,334 |
This crate provides a client for interacting with OpenAI's batch processing API, allowing you to manage and download batch files asynchronously. It offers functionality for managing batch statuses, uploading files, and retrieving results after batch processing.
use openai_batch_client::OpenAIClientHandle;
let client = OpenAIClientHandle::new();
let batch = client.create_batch("input_file_id").await?;
let file = client.upload_batch_file("path_to_file").await?;
let batch = client.retrieve_batch("batch_id").await?;
use openai_batch_client::check_and_download::check_for_and_download_output_and_error_online;
check_for_and_download_output_and_error_online(&mut batch_file_triple, &client).await?;
This crate uses error-tree for error management, providing structured errors such as BatchFailed, BatchStillProcessing, and other batch-related errors.
OPENAI_API_KEY environment variable must be set with your OpenAI API key.This crate is licensed under the MIT License. See LICENSE for details.