Skip to content

Conversation

@EricStrohmaier
Copy link

I added web search functionality using xAI's built-in search capabilities.

This PR integrates xAI's web search feature (from the SDK) into the chatbot, allowing Grok models to search the web and cite sources in their responses.

Changes made

Backend:

  • Added search parameter configuration in lib/ai/providers.ts (mode: auto, max 10 results)
  • Updated message schema to store search results
  • Result processing and deduplication in the chat route

Frontend:

  • Created SearchResults component with collapsible source list
  • Added SearchingIndicator for loading state
  • Results display into message

1.
Screenshot 2025-11-09 at 12 10 04 PM
2.
Screenshot 2025-11-09 at 12 10 26 PM
3.
Screenshot 2025-11-09 at 12 10 41 PM

Notes:

Tested with various queries that benefit from web search:

  • Current events ("latest news about...")

Happy to make any changes or adjustments based on feedback!

@vercel
Copy link

vercel bot commented Nov 9, 2025

@EricStrohmaier is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant