fix(web_search): remove unsupported include param from Grok API calls (#12910) (#12945)

xAI's /v1/responses endpoint does not support the 'include' parameter,
returning 400 'Argument not supported: include'. Inline citations are
returned automatically when available — no explicit request needed.

Closes #12910

Co-authored-by: Luna AI <luna@coredirection.ai>
This commit is contained in:
Omair Afzal
2026-02-11 05:27:35 +05:00
committed by GitHub
parent ca629296c6
commit 88428260ce

View File

@@ -473,9 +473,10 @@ async function runGrokSearch(params: {
tools: [{ type: "web_search" }],
};
if (params.inlineCitations) {
body.include = ["inline_citations"];
}
// Note: xAI's /v1/responses endpoint does not support the `include`
// parameter (returns 400 "Argument not supported: include"). Inline
// citations are returned automatically when available — we just parse
// them from the response without requesting them explicitly (#12910).
const res = await fetch(XAI_API_ENDPOINT, {
method: "POST",