ExaToolkit
autogen.beta.tools.search.exa.ExaToolkit #
Bases: Toolkit
Toolkit that exposes the Exa neural search engine as four related tools sharing one HTTP client.
The four tools mirror Exa's primary endpoints: - exa_search: web search with optional text content - exa_find_similar: find pages similar to a given URL - exa_get_contents: fetch full text for specific URLs - exa_answer: get an AI-generated answer with citations
By default, passing the whole toolkit to an agent registers all four tools. To use a subset, or to customise per-tool parameters, call the factory methods directly and pass the returned tools to the agent::
toolkit = ExaToolkit(api_key=...)
# all four tools
agent = Agent("a", config=config, tools=[toolkit])
# only two, with custom parameters
agent = Agent(
"a",
config=config,
tools=[
toolkit.search(num_results=5, search_type="neural"),
toolkit.answer(),
],
)
The constructor reads EXA_API_KEY from the environment when api_key is omitted (handled by the underlying exa_py.AsyncExa SDK).
Source code in autogen/beta/tools/search/exa.py
search #
search(*, num_results=None, max_characters=None, search_type=None, category=None, include_domains=None, exclude_domains=None, start_published_date=None, end_published_date=None, start_crawl_date=None, end_crawl_date=None, livecrawl=None, user_location=None, moderation=None, name='exa_search', description="Search the web using Exa's neural search engine. Returns ranked results with titles, URLs, relevance scores, and optional text content.", middleware=())
Source code in autogen/beta/tools/search/exa.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
find_similar #
find_similar(*, num_results=None, include_domains=None, exclude_domains=None, exclude_source_domain=None, category=None, name='exa_find_similar', description='Find web pages similar to a given URL. Useful for discovering related content, competitors, or alternative sources.', middleware=())
Source code in autogen/beta/tools/search/exa.py
get_contents #
get_contents(*, name='exa_get_contents', description='Get the full text content of specific URLs. Useful when you already know which pages you need and want to read them.', middleware=())
Source code in autogen/beta/tools/search/exa.py
answer #
answer(*, name='exa_answer', description='Generate an AI-powered answer to a question with citations from web sources.', middleware=())
Source code in autogen/beta/tools/search/exa.py
set_provider #
schemas async #
register #
tool #
tool(function=None, *, name=None, description=None, schema=None, sync_to_thread=True, middleware=())