Skip to content

Conversation

@sadaf-labs
Copy link

@sadaf-labs sadaf-labs commented Jul 23, 2025

Problem:
Users need real‑time web search inside chats, but current flows lack an integrated SERP lookup—requiring separate DataforSEO calls and manual result passing.


Solution:

  • New /api/chat/web-search endpoint that:

    1. Checks DataforSEO connectivity
    2. Fetches and normalizes live Google SERP via DataforSEO
    3. Wraps results in a web_search_tool message for Azure OpenAI
  • ChatInput toggle (“Web search”) to route queries through /api/chat/web-search when enabled

  • Handler update to merge web‑search replies into the existing chat stream


Environment Variables:

NEXT_PUBLIC_DATAFORSEO_LOGIN=your_login  
NEXT_PUBLIC_DATAFORSEO_PASSWORD=your_password  
AZURE_OPENAI_KEY=your_azure_api_key  
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com  
AZURE_GPT_45_TURBO_NAME=your_deployment_name  

@sadaf-labs sadaf-labs marked this pull request as draft July 29, 2025 09:50
@sadaf-labs sadaf-labs closed this Aug 2, 2025
@sadaf-labs sadaf-labs reopened this Aug 6, 2025
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