- SDK
- Web Search
SDK
Web Search
Enable real-time web search in conversations via the SDK.
Overview
Web search gives your assistant access to current information from the internet. Pass web_search="Auto" on any message and the assistant decides when web search is helpful.
web_search is a per-turn parameter — pass it on every call where you want it active.
Non-Streaming
Python
JavaScript
TypeScript
import asyncio
from backboard import BackboardClient
async def main():
client = BackboardClient(api_key="YOUR_API_KEY")
response = await client.send_message(
"What are the latest developments in AI this week?",
web_search="Auto",
)
print(response.content)
if __name__ == "__main__":
asyncio.run(main())
Streaming
Python
JavaScript
TypeScript
async for chunk in await client.send_message(
"What are today's top tech headlines?",
web_search="Auto",
stream=True,
):
if chunk.get("type") == "content_streaming":
print(chunk.get("content", ""), end="", flush=True)
print()
Web Search + Memory
Combine web search with memory in a single message. Since memories are stored per-assistant, pass assistant_id to retrieve from the correct memory store:
Python
JavaScript
TypeScript
response = await client.send_message(
"Based on my preferences, find me the latest Python framework news",
assistant_id="your-assistant-id",
web_search="Auto",
memory="Auto",
)
print(response.content)
Options
| Value | Behavior |
|---|---|
"Auto" | Assistant decides when to search the web |
"off" | Disabled (default) |
Web search adds latency as the system retrieves and processes current information. Use Auto mode to let the assistant decide when it’s needed.