Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions instructor/v2/dsl/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def validate_sources(self, info: ValidationInfo) -> "CitationMixin":
# Get the context from the info
text_chunks = info.context.get("context", None)

if text_chunks is None:
return self

# Get the spans of the substring_phrase in the context
spans = list(self.get_spans(text_chunks))
# Replace the substring_phrase with the actual substring
Expand Down