Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] TypeError: 'ChatCitation' object is not subscriptable #97

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def insert_citations(text: str, citations: list[dict]):
# Process citations in the order they were provided
for citation in citations:
# Adjust start/end with offset
start, end = citation['start'] + offset, citation['end'] + offset
cited_docs = [str(int(doc[4:]) + 1) for doc in citation["document_ids"]]
start, end = citation.start + offset, citation.end + offset
cited_docs = [str(int(doc[4:]) + 1) for doc in citation.document_ids]
# Shorten citations if they're too long for convenience
if len(cited_docs) > 3:
placeholder = "[" + ", ".join(cited_docs[:3]) + "...]"
Expand Down
Loading