Skip to content

Commit a76377d

Browse files
author
stlc-bot
committed
fix(scrape): retain highlight headings only when needed (#1245)
Stainless-Generated-From: ec16bbc
1 parent 0459b42 commit a76377d

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎src/context/dev/types/web_scrape_params.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ class Formats(TypedDict, total=False):
107107
"""The original HTTP response body."""
108108

109109
highlights: bool
110-
"""Relevant passages for your question or topic. Adds 3 credits."""
110+
"""
111+
Relevant passages for your question or topic, with headings included when needed
112+
for context. Adds 3 credits.
113+
"""
111114

112115
html: bool
113116
"""Rendered HTML."""

‎src/context/dev/types/web_scrape_response.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ class CacheMetadata(BaseModel):
6969

7070

7171
class Highlights(BaseModel):
72-
"""Relevant passages for your question or topic."""
72+
"""Relevant passages for your question or topic, in page order.
73+
74+
A heading in square brackets is included when needed to interpret a passage. Empty when the page has no text.
75+
"""
7376

7477
data: Optional[List[str]] = None
7578

@@ -346,7 +349,11 @@ class WebScrapeResponse(BaseModel):
346349
"""
347350

348351
highlights: Highlights
349-
"""Relevant passages for your question or topic."""
352+
"""Relevant passages for your question or topic, in page order.
353+
354+
A heading in square brackets is included when needed to interpret a passage.
355+
Empty when the page has no text.
356+
"""
350357

351358
html: HTML
352359
"""Rendered HTML after content filters."""

0 commit comments

Comments
 (0)