mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
- Description: check title and excerpt separately for page_content so that if title is empty but excerpt is present, the page_content will only contain the excerpt - Issue: #7782 - Tag maintainer: @3coins @baskaryan - Twitter handle: wilsonleao
This commit is contained in:
parent
d92926cbc2
commit
efa67ed0ef
@ -38,9 +38,12 @@ def combined_text(title: str, excerpt: str) -> str:
|
||||
The combined text.
|
||||
|
||||
"""
|
||||
if not title or not excerpt:
|
||||
return ""
|
||||
return f"Document Title: {title} \nDocument Excerpt: \n{excerpt}\n"
|
||||
text = ""
|
||||
if title:
|
||||
text += f"Document Title: {title}\n"
|
||||
if excerpt:
|
||||
text += f"Document Excerpt: \n{excerpt}\n"
|
||||
return text
|
||||
|
||||
|
||||
class Highlight(BaseModel, extra=Extra.allow):
|
||||
|
Loading…
Reference in New Issue
Block a user