Skip to main content

System Settings

An additional configuration file, system_settings.json, is located in the same folder as user_settings.json, and can be created manually if it does not exist.

Items below are defined as a JSON dictionary.

Logging Service

A logging service can be enabled (default is off) in system_settings.json.

When active, it logs commands executed, with their parameters, and any errors to a file. The files will be stored in the OpenBBUserData\logs folder, with each session assigned a UUID and logged in a separate file.

Add this entry to system_settings.json:

{
"logging_suppress": false,
}

With the configuration set, the logger can be retrieved by name in the code.

logger = logging.getLogger("openbb.logging_service")

Allow OBBject Extensions

OBBject extensions can allow developers to perform additional operations before function output.

danger

These types of extensions are potentially dangerous, and the user must explicitly allow them.

The application will not start if a callback extension is installed without configuring.

They are blocking operations, and the response object may also be mutated.

Changes will not be reflected in the function's signature and docstring.

Ensure that extensions are installed from a trusted source.

Enable by setting the following keys in system_settings.json:

{
"allow_on_command_output": true,
"allow_mutable_extensions": true,
}

They can also be set as environment variables, prefixed with OPENBB_

API Settings

The, "api_settings", key is a nested dictionary, and is passed to the instance of FastAPI.

{
"api_settings": {
"version": "1",
"title": "OpenBB Platform API",
"description": "This is the OpenBB Platform API.",
"terms_of_service": "http://example.com/terms/",
"contact_name": "OpenBB Team",
"contact_url": "https://openbb.co",
"contact_email": "hello@openbb.co",
"license_name": "AGPLv3",
"license_url": "https://github.com/OpenBB-finance/OpenBB/blob/develop/LICENSE",
"servers": [
{
"url": "",
"description": "Local OpenBB development server"
}
],
"cors": {
"allow_origins": [
"*"
],
"allow_methods": [
"*"
],
"allow_headers": [
"*"
]
},
"prefix": "/api/v1"
}
}

Python Settings

The python_settings key is a nested dictionary. It contains configurations for the docstring elements within the Python interface, as well as global HTTP and Uvicorn settings.

Additional keys and values can be supplied, however, unless they are specifically implemented by custom code, they will be ignored.

Docstring Sections

This configuration allows the user to include specific elements of the docstrings. Useful for reducing the context length when incorporating LLMs and function calling. The settings below are for the complete docstring, and are the default state.

{
"python_settings": {
"docstring_sections": ["description", "parameters", "returns", "examples"],
"docstring_max_length": null
}
}

HTTP

important

This section refers to settings available beginning OpenBB v4.4.0

Available Settings
KeyTypeDescription
cafilestrPath to a CA certificate file.
certfilestrPath to a client certificate file.
keyfilestrPath to a client key file.
passwordstrPassword for the client key file (aiohttp only).
verify_sslboolVerify SSL certificates.
fingerprintstrSSL fingerprint (aiohttp only).
proxystrProxy URL.
proxy_authstr, listProxy basic authentication (aiohttp only).
proxy_headersdictProxy headers (aiohttp only).
timeoutintRequest timeout.
authstr, listBasic authentication.
headersdictRequest headers.
cookiesdictDictionary of session cookies.

Any additional keys supplied will be ignored unless explicitly implemented via custom code.

Settings are passed to both Requests and AIOHTTP with helper functions.
  • openbb_core.provider.utils.helpers.make_request - Sync
  • openbb_core.provider.utils.helpers.amake_request - Async
  • openbb_core.provider.utils.helpers.amake_requests - Async (multiple requests)

Return a session object with the settings applied by:

  • openbb_core.provider.utils.helpers.get_requests_session
  • openbb_core.provider.utils.helpers.get_async_requests_session :::

Uvicorn

The, python_settings["uvicorn"], dictionary covers the launch of FastAPI when using the following entry points:

  • Running the FastAPI as a Python module script.
    • python -m openbb_core.api.rest_api
  • Running the openbb-api command.
    • openbb-api

All settings are passed directly to uvicorn.run, and can be found in the Uvicorn documentation

important

Keyword arguments supplied to the command line will take priority over the settings in this configuration.