SIGN IN SIGN UP
danielmiessler / Fabric UNCLAIMED

Fabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.

0 0 18 Go

feat(openai): add GrokAI search grounding via xAI Responses API

xAI's Responses API accepts web_search and x_search tool types, but
fabric hardcoded OpenAI's web_search_preview tool name in
buildResponseParams, causing GrokAI plus --search to fail with HTTP 422.

This adds two new fields to openai_compatible.ProviderConfig:
- WebSearchToolName: override the default web_search tool name string
- EnableXSearch: append xAI's x_search tool when search is enabled

Both fields are empty/false by default, preserving backwards
compatibility for all existing providers. GrokAI now sets
WebSearchToolName to "web_search" and EnableXSearch to true.

Tests added in openai_test.go cover the new override paths and
confirm the default provider behavior is unchanged.

Verified with live xAI API key: fabric -V GrokAI --search "query"
now returns grounded results with real source URLs.
K
Kenneth G. Hartman committed
7ced82f782248cb2a1ec28db9e750d19f60d3bca
Parent: 42311fe