Access Bing Search for News, Images, and Videos
LlamaIndex tool that lets an agent search Bing for news, images, and videos.
Why it matters
Integrate Bing Search capabilities into your AI agent to retrieve real-time news, images, and videos directly from Bing.
Outcomes
What it gets done
Perform news searches using Bing.
Retrieve relevant images via Bing.
Find video content through Bing searches.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-tool-tools-bing-search | bash Overview
Bing Search Tool
The Bing Search Tool wires Bing's news, image, and video search into a LlamaIndex agent as three callable functions, letting the agent pull live search results into a conversation. Use it when an agent needs current news, images, or video results mid-conversation. It requires a Bing Search API key set up through Azure.
What it does
The Bing Search Tool connects to a Bing account and gives an agent the ability to search for news, images, and videos. It exposes three functions: bing_news_search (search for news results related to a query), bing_image_search (search for images related to a query), and bing_video_search (search for videos related to a query). It is designed to be used as a way to load data as a Tool in an Agent.
When to use - and when NOT to
Use it when an agent needs to pull live news, images, or video results into a conversation -- for example fielding a chain of questions like "what's the latest news about superconductors," "what does lk-99 look like," and "is there any videos of it levitating." It requires a Bing Search API key set up through Azure, so it is not usable without an existing Azure Bing Search resource.
Inputs and outputs
Given a text query, each function returns the corresponding search results (news, images, or videos). Setup requires an api_key passed to BingSearchToolSpec, which is then attached to an agent via to_tool_list():
from llama_index.tools.bing_search import BingSearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = BingSearchToolSpec(api_key="your-key")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1")
)
print(await agent.run("what's the latest news about superconductors"))
print(await agent.run("what does lk-99 look like"))
print(await agent.run("is there any videos of it levitating"))
Who it's for
Developers building LlamaIndex agents that need to answer questions with current news, images, or video results and already have, or are willing to set up, a Bing Search API key.
Source README
Bing Search Tool
This tool connects to a Bing account and allows an Agent to perform searches for news, images and videos.
You will need to set up a search key using Azure,learn more here: https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/overview
Usage
This tool has a more extensive example usage documented in a Jupyter notebook here
Here's an example usage of the BingSearchToolSpec.
from llama_index.tools.bing_search import BingSearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = BingSearchToolSpec(api_key="your-key")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(), llm=OpenAI(model="gpt-4.1")
)
print(await agent.run("what's the latest news about superconductors"))
print(await agent.run("what does lk-99 look like"))
print(await agent.run("is there any videos of it levitating"))
bing_news_search: Search for news results related to a querybing_image_search: Search for images related to a querybing_video_search: Search for videos related to a query
This loader is designed to be used as a way to load data as a Tool in a Agent.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.