Skip to content

Commit 563d59d

Browse files
author
stlc-bot
committed
feat(search): /web/search - for news results extend description with matching passages from article.
Stainless-Generated-From: 886d267338f383f44126cfcf45695712cd94e784
1 parent 81b8d81 commit 563d59d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎pkg/cmd/web.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ var webSearch = requestflag.WithInnerFlags(cli.Command{
316316
Usage: "Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: \"us\", \"gb\", \"de\".",
317317
BodyPath: "country",
318318
},
319+
&requestflag.Flag[*int64]{
320+
Name: "description-max-characters",
321+
Usage: "Maximum length of each result's `description`, in characters.",
322+
Default: nil,
323+
BodyPath: "descriptionMaxCharacters",
324+
},
319325
&requestflag.Flag[[]string]{
320326
Name: "exclude-domain",
321327
Usage: `Blocklist — drop results from these domains. Up to 100 domains. Example: ["pinterest.com", "reddit.com"].`,

‎pkg/cmd/web_test.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ func TestWebSearch(t *testing.T) {
213213
"web", "search",
214214
"--query", "Stripe API authentication",
215215
"--country", "af",
216+
"--description-max-characters", "0",
216217
"--exclude-domain", "xxx",
217218
"--freshness", "last_24_hours",
218219
"--highlights-options", "{enabled: true, maxCharacters: 100}",
@@ -238,6 +239,7 @@ func TestWebSearch(t *testing.T) {
238239
"web", "search",
239240
"--query", "Stripe API authentication",
240241
"--country", "af",
242+
"--description-max-characters", "0",
241243
"--exclude-domain", "xxx",
242244
"--freshness", "last_24_hours",
243245
"--highlights-options.enabled=true",
@@ -268,6 +270,7 @@ func TestWebSearch(t *testing.T) {
268270
pipeData := []byte("" +
269271
"query: Stripe API authentication\n" +
270272
"country: af\n" +
273+
"descriptionMaxCharacters: 0\n" +
271274
"excludeDomains:\n" +
272275
" - xxx\n" +
273276
"freshness: last_24_hours\n" +

0 commit comments

Comments
 (0)