Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scald committed Nov 25, 2024
1 parent 5532b50 commit e7ae05d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 433 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//!
//! // Process an image
//! let image_data = std::fs::read("image.jpg").unwrap();
//! let analysis = processor.process(&image_data).await.unwrap();
//! let (analysis, token_usage) = processor.process(&image_data).await.unwrap();
//! println!("Analysis: {}", analysis);
//! }
//! ```
Expand All @@ -36,4 +36,4 @@ pub mod utils;
pub use errors::ProcessorError;
pub use processor::ImageProcessor;
pub use prompts::{ImagePrompt, PromptFormat};
pub use providers::AIProvider;
pub use providers::{AIProvider, TokenUsage};
6 changes: 6 additions & 0 deletions src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ impl ImageProcessor {
/// Some("moondream".to_string()),
/// None
/// );
///
/// # async fn example() {
/// let image_data = std::fs::read("image.jpg").unwrap();
/// let (analysis, token_usage) = processor.process(&image_data).await.unwrap();
/// println!("Analysis: {}", analysis);
/// # }
/// ```
pub fn new(provider: AIProvider, model: Option<String>, format: Option<PromptFormat>) -> Self {
let provider: Box<dyn Provider> = match provider {
Expand Down
Loading

0 comments on commit e7ae05d

Please sign in to comment.