Skip to content

Commit 1d67bd2

Browse files
committed
fix: granite33 response_end span uses sentence length not full response length
_add_citation_response_spans computed response_end as index + len(response_text_without_citations), which is the length of the entire stripped response rather than the cited sentence. This caused every citation span to overshoot, potentially past the end of the string. Fixes #843
1 parent a1f1ad7 commit 1d67bd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • mellea/formatters/granite/granite3/granite33

mellea/formatters/granite/granite3/granite33/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def _add_citation_response_spans(
223223

224224
citation["response_text"] = response_text
225225
citation["response_begin"] = index
226-
citation["response_end"] = index + len(response_text_without_citations)
226+
citation["response_end"] = index + len(response_text)
227227

228228
return augmented_citation_info
229229

0 commit comments

Comments
 (0)