pub struct PictureDescriptionOptions {
pub endpoint: String,
pub model: String,
pub api_key: Option<String>,
pub prompt: Option<String>,
pub mode: PictureDescriptionMode,
pub concurrency: usize,
}Expand description
The picture-description pass (#670): every picture of a document — a
DOCX/PPTX/XLSX/HTML embedded image, a PDF figure crop, a sampled video
frame — goes to an OpenAI-compatible vision endpoint and the answer
becomes its description annotation (meta.description in docling JSON,
printed after the caption in Markdown). MarkItDown’s llm_client /
llm_model / llm_prompt and its markitdown-ocr plugin, on every format
and surface. Endpoint, model and key fall back to the DOCLING_RS_VLM_*
environment like the page pipeline’s; the prompt does not
(DOCLING_RS_VLM_PROMPT asks for a page’s markup, not a caption).
Fields§
§endpoint: StringThe server’s /v1 base or the full …/chat/completions URL.
model: StringModel name as the server knows it.
api_key: Option<String>Bearer token, if the endpoint wants one.
prompt: Option<String>The instruction sent with every picture; None = the mode’s prompt.
mode: PictureDescriptionModeCaption or OCR.
concurrency: usizePictures in flight at once (default 1; the endpoint’s rate limit sets the ceiling — 429s retry with backoff).
Implementations§
Source§impl PictureDescriptionOptions
impl PictureDescriptionOptions
Sourcepub fn resolve(
endpoint: Option<String>,
model: Option<String>,
) -> Result<Self, ConversionError>
pub fn resolve( endpoint: Option<String>, model: Option<String>, ) -> Result<Self, ConversionError>
Build options from explicit values, the endpoint, model and key
falling back to the DOCLING_RS_VLM_* environment. Endpoint and
model are required.
Sourcepub fn provenance(&self) -> String
pub fn provenance(&self) -> String
created_by of the descriptions this produces: the model name.
Sourcepub fn describe(
&self,
agent: &Agent,
mimetype: &str,
image: &[u8],
) -> Result<Option<String>, RequestError>
pub fn describe( &self, agent: &Agent, mimetype: &str, image: &[u8], ) -> Result<Option<String>, RequestError>
Ask the endpoint about one image (mimetype as the data URI says
it). The retry policy is the page loop’s; an empty answer is None,
the way MarkItDown reads a blank completion as “no text”.
Trait Implementations§
Source§impl Clone for PictureDescriptionOptions
impl Clone for PictureDescriptionOptions
Auto Trait Implementations§
impl Freeze for PictureDescriptionOptions
impl RefUnwindSafe for PictureDescriptionOptions
impl Send for PictureDescriptionOptions
impl Sync for PictureDescriptionOptions
impl Unpin for PictureDescriptionOptions
impl UnsafeUnpin for PictureDescriptionOptions
impl UnwindSafe for PictureDescriptionOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more