fix(search): nest Exa contents options for /search (#9914) (#10018)

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-08-10 11:18:04 -03:00
committed by GitHub
parent 61014aec52
commit 2b6977229b
3 changed files with 7 additions and 5 deletions

View File

@@ -0,0 +1 @@
- fix(search): nest Exa contents options (text/highlights) for /search API (#9914)

View File

@@ -336,8 +336,10 @@ function buildExaRequest(
query: params.query,
numResults: params.maxResults,
type: "auto",
text: true,
highlights: true,
contents: {
text: true,
highlights: true,
},
};
if (includes.length) body.includeDomains = includes;
if (excludes.length) body.excludeDomains = excludes;

View File

@@ -123,7 +123,7 @@ test("handleSearch builds Brave news requests and normalizes favicon metadata",
}
});
test("handleSearch builds Exa requests with include/exclude domains and preserves rich result fields", async () => {
test("handleSearch builds Exa requests with contents-nested options, include/exclude domains, and preserves rich result fields", async () => {
const originalFetch = globalThis.fetch;
let captured;
@@ -165,8 +165,7 @@ test("handleSearch builds Exa requests with include/exclude domains and preserve
query: "agentic workflows",
numResults: 5,
type: "auto",
text: true,
highlights: true,
contents: { text: true, highlights: true },
includeDomains: ["allowed.com"],
excludeDomains: ["blocked.com"],
category: "news",