MCPcopy Create free account
hub / github.com/evilsocket/cake / generate_image

Method generate_image

cake-core/src/cake/sharding/api/test_helpers.rs:177–188  ·  view source on GitHub ↗
(
        &mut self,
        _args: &ImageGenerationArgs,
        mut callback: F,
    )

Source from the content-addressed store, hash-verified

175#[async_trait]
176impl ImageGenerator for MockImageGenerator {
177 async fn generate_image<F>(
178 &mut self,
179 _args: &ImageGenerationArgs,
180 mut callback: F,
181 ) -> Result<()>
182 where
183 F: FnMut(Vec<ImageBuffer<Rgb<u8>, Vec<u8>>>) + Send + 'static,
184 {
185 let img = ImageBuffer::from_pixel(1, 1, Rgb([255u8, 0, 0]));
186 callback(vec![img]);
187 Ok(())
188 }
189}
190
191#[async_trait]

Callers 2

generate_imageFunction · 0.45
generate_image_openaiFunction · 0.45

Calls 1

generate_imageFunction · 0.85

Tested by

no test coverage detected