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

This commit is contained in:
diegosouzapw
2026-08-10 10:14:00 -03:00
parent 61014aec52
commit 3e6cd36158
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",