search-tools

Create Search Tool

Changed on

Add a search or fetch instance at runtime. Storing an API key requires OTARI_SECRET_KEY.

Creating a second search instance, while the first is the in-loop default only because it is the only one, first sets web_search_default_tool to the first in the same commit, and says so in the response, so that adding an instance never turns in-loop search off. That runtime value wins over the configuration file until it is cleared.

post/api/v1/search-tools

Request

  • The document declares no server URL.
  • Auth: one of:
    • API key in header Otari-Key
    • API key in header x-api-key

Request body

api_basestring nullable

Backend endpoint. Omit to inherit the provider's default (searxng inherits web_search_url).

api_keystring nullable

Provider API key. Stored encrypted; never returned.

fetch_toolstring nullable

For a search instance: the fetch instance that enriches its results, a configured or stored one or builtin_fetch. Omit it for the fetch default.

kind'search' | 'fetch'

'search' or 'fetch'. It cannot change once created.

namestring required

Name callers pass as 'search_tool_name' or in /api/v1/search/{tool}, or that names a fetch instance. It contains no '/' or ':', is not builtin_fetch or none in any case, and is unique across search and fetch instances.

optionsobject nullable

Provider-native request fields used as defaults (e.g. exa's 'type', searxng's 'engines').

providerstring required

Provider id. GET /api/v1/search-tools/providers lists the search providers, and with ?kind=fetch the fetch providers.

timeoutnumber nullable

Per-request timeout in seconds.

Example request

{
  "api_base": "http://searxng:8080",
  "name": "local",
  "provider": "searxng"
}

Response

Successful Response

api_basestring nullable
created_atstring nullable
decryptableboolean
fetch_toolstring nullable

A search instance's enrichment fetch instance. Null means the fetch default enriches it.

kind'search' | 'fetch'

Whether this is a search or a fetch instance.

last4string nullable
namestring required
noticestring nullable

What else the create changed, for the operator to read.

optionsobject
pinned_web_search_default_toolstring nullable

Set when this create also stored web_search_default_tool, naming the search instance that was the in-loop default because it was the only one, so that adding a second does not turn in-loop search off. This runtime value wins over the configuration file until it is cleared.

providerstring required
shadows_configboolean

True when a config-file search tool of the same name exists; the stored one is in effect.

timeoutnumber nullable
updated_atstring nullable

Changes

    • breaking

      added the pattern ^[^/:]+$ to the request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status