You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/langchain/utilities
Zach Jones 13d1df2140
Feature: AgentExecutor execution time limit (#2399)
`AgentExecutor` already has support for limiting the number of
iterations. But the amount of time taken for each iteration can vary
quite a bit, so it is difficult to place limits on the execution time.
This PR adds a new field `max_execution_time` to the `AgentExecutor`
model. When called asynchronously, the agent loop is wrapped in an
`asyncio.timeout()` context which triggers the early stopping response
if the time limit is reached. When called synchronously, the agent loop
checks for both the max_iteration limit and the time limit after each
iteration.

When used asynchronously `max_execution_time` gives really tight control
over the max time for an execution chain. When used synchronously, the
chain can unfortunately exceed max_execution_time, but it still gives
more control than trying to estimate the number of max_iterations needed
to cap the execution time.

---------

Co-authored-by: Zachary Jones <zjones@zetaglobal.com>
1 year ago
..
__init__.py requests wrapper (#2367) 1 year ago
apify.py Harrison/apify (#2215) 1 year ago
asyncio.py Feature: AgentExecutor execution time limit (#2399) 1 year ago
bash.py Optionally return shell output on incorrect command (#894) (#899) 1 year ago
bing_search.py Harrison/add to search (#778) 1 year ago
google_search.py feat #1915 support for google custom search site restricted api (#1920) 1 year ago
google_serper.py Google Search API integration with serper.dev (wrapper, tests, docs, … (#909) 1 year ago
loading.py fix: testing in Windows and add missing dev dependency (#2340) 1 year ago
openweathermap.py Add OpenWeatherMap API Tool (#2083) 1 year ago
searx_search.py feat: category support for SearxSearchWrapper (#2271) 1 year ago
serpapi.py Fixed a typo in an Error Message of SerpAPI (#2313) 1 year ago
wikipedia.py Modify output for wikipedia api wrapper (#2287) 1 year ago
wolfram_alpha.py Harrison/errors (#1276) 1 year ago
zapier.py Follow up to #1803 to remove dynamic docs route. (#1818) 1 year ago