From 5531bc4972f044cae3290d2a5c0a13f3e8702864 Mon Sep 17 00:00:00 2001 From: Ghost Jake <89829542+Deepak-Kesavan@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:02:08 +0530 Subject: [PATCH] feat: add include_line_confidence parameter to whisper method - Add include_line_confidence parameter to LLMWhispererClientV2.whisper() method - Parameter adds line confidence scores to line metadata returned by highlights API - Requires add_line_nos to be enabled for this feature to work - Bump version from 2.4.2 to 2.5.0 --- src/unstract/llmwhisperer/__init__.py | 2 +- src/unstract/llmwhisperer/client_v2.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/unstract/llmwhisperer/__init__.py b/src/unstract/llmwhisperer/__init__.py index c491098..3c08165 100644 --- a/src/unstract/llmwhisperer/__init__.py +++ b/src/unstract/llmwhisperer/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.4.2" +__version__ = "2.5.0" from .client_v2 import LLMWhispererClientV2 # noqa: F401 diff --git a/src/unstract/llmwhisperer/client_v2.py b/src/unstract/llmwhisperer/client_v2.py index 1a54d25..f4f9f0f 100644 --- a/src/unstract/llmwhisperer/client_v2.py +++ b/src/unstract/llmwhisperer/client_v2.py @@ -232,6 +232,7 @@ def whisper( mark_horizontal_lines: bool = False, line_spitter_strategy: str = "left-priority", add_line_nos: bool = False, + include_line_confidence: bool = False, lang: str = "eng", tag: str = "default", filename: str = "", @@ -263,6 +264,8 @@ def whisper( line_spitter_strategy (str, optional): The line splitter strategy. Defaults to "left-priority". add_line_nos (bool, optional): Adds line numbers to the extracted text and saves line metadata, which can be queried later using the highlights API. + include_line_confidence (bool, optional): Adds line confidence to the line metadata returned by + the highlights API. Requires add_line_nos to be enabled. Defaults to False. lang (str, optional): The language of the document. Defaults to "eng". tag (str, optional): The tag for the document. Defaults to "default". filename (str, optional): The name of the file to store in reports. Defaults to "". @@ -298,6 +301,7 @@ def whisper( "mark_horizontal_lines": mark_horizontal_lines, "line_spitter_strategy": line_spitter_strategy, "add_line_nos": add_line_nos, + "include_line_confidence": include_line_confidence, "lang": lang, "tag": tag, "filename": filename,