Const
Constants for the plugin app.
- smarter.apps.llmtool.const.BRAVE_SEARCH_API_KEY_SECRET_NAME = 'brave_search_api_key'
The Secret of the Brave Search api key.
ImageSearchPlugins such as safe_image_search use it, and so do the Brave WebsearchPlugin samples such as research_assistant.
- smarter.apps.llmtool.const.LLMTOOL_ENV_PREFIX = 'APP_LLMTOOL_'
The prefix of the llmtool app’s environment variables, after the optional
SMARTER_.E.g.
SMARTER_APP_LLMTOOL_TAVILY_API_KEY.manage.py initialize_llmtool_api_keysstores each key as a Secret named without it, e.g.tavily_api_key, which the plugins’ manifests name.
- smarter.apps.llmtool.const.OFFICIAL_EXTENSIONS = ('calculator', 'date-calculator', 'weather')
The slugs of the official Smarter Extensions, which
manage.py install_official_extensionsinstalls from the registry.('calculator', 'date-calculator', 'weather')
- class smarter.apps.llmtool.const.PluginCacheTtl(*values)[source]
Bases:
IntEnumSeconds to cache the results of each kind of plugin’s remote calls, with
@cache_results.Each TTL reflects how quickly the remote data is expected to change. The ImageSearch and Websearch values are the defaults of the manifest’s
cacheTtl, which a plugin may override.- API = 3600
An ApiPlugin’s GET responses.
Other methods may change something, so they are never cached.
- DEFAULT = 3600
The default TTL for a plugin’s remote calls to safe_http.py, if the plugin does not specify a cacheTtl in its manifest.
- IMAGE_SEARCH = 604800
An ImageSearchPlugin’s Brave Image Search API responses.
- SKILL = 259200
A SkillPlugin’s remote skill, retrieved from GitHub or another https host.
- SQL = 3600
A SqlPlugin’s query results.
- WEBSEARCH = 3600
A WebsearchPlugin’s search results and web pages.
- WEBSEARCH_ROBOTS_TXT = 3600
The robots.txt files that a WebsearchPlugin obeys.
- smarter.apps.llmtool.const.TAVILY_API_KEY_SECRET_NAME = 'tavily_api_key'
The Secret of the Tavily web search api key, which WebsearchPlugins such as smarter_project_websearch use.