Skip to main content

keep_image

Function keep_image 

pub async fn keep_image(
    ctx: &ToolCtx,
    bytes: &[u8],
    claimed: Option<&str>,
    name: Option<&str>,
    origin: ImageOrigin,
) -> ImageOutcome
Expand description

Admit and keep the image bytes offered by the call of ctx, and say what the model is shown (ImageOutcome). Like keep_long: with an ImageStore in the agent’s state the bytes go there (by the SHA-256, once, for the conversation); without one they go back in ToolOutput::kept_images for the loop to keep in the run’s state. A model that cannot see, a source the deployment does not allow, a type, a size or a count over its limits are a stand-in line, never an error.