mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 14:49:29 +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.
|
The combined text.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not title or not excerpt:
|
text = ""
|
||||||
return ""
|
if title:
|
||||||
return f"Document Title: {title} \nDocument Excerpt: \n{excerpt}\n"
|
text += f"Document Title: {title}\n"
|
||||||
|
if excerpt:
|
||||||
|
text += f"Document Excerpt: \n{excerpt}\n"
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class Highlight(BaseModel, extra=Extra.allow):
|
class Highlight(BaseModel, extra=Extra.allow):
|
||||||
|
Loading…
Reference in New Issue
Block a user