Skip to content

Commit

Permalink
Blurb Key Error (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 authored Nov 29, 2023
1 parent 30225fd commit 187b94a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/danswer/document_index/vespa/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ def _vespa_hit_to_inference_chunk(hit: dict[str, Any]) -> InferenceChunk:
logger.error(
f"Chunk with blurb: {fields.get(BLURB, 'Unknown')[:50]}... has no Semantic Identifier"
)

# User ran into this, not sure why this could happen, error checking here
blurb = fields.get(BLURB)
if not blurb:
logger.error(f"Chunk with id {fields.get(semantic_identifier)} ")
blurb = ""

source_links = fields.get(SOURCE_LINKS, {})
source_links_dict_unprocessed = (
json.loads(source_links) if isinstance(source_links, str) else source_links
Expand All @@ -482,7 +489,7 @@ def _vespa_hit_to_inference_chunk(hit: dict[str, Any]) -> InferenceChunk:

return InferenceChunk(
chunk_id=fields[CHUNK_ID],
blurb=fields[BLURB],
blurb=blurb,
content=fields[CONTENT],
source_links=source_links_dict,
section_continuation=fields[SECTION_CONTINUATION],
Expand Down

1 comment on commit 187b94a

@vercel
Copy link

@vercel vercel bot commented on 187b94a Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.