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.
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
This section refers to settings available beginning OpenBB v4.4.0
Available Settings
| Key | Type | Description |
|---|---|---|
| cafile | str | Path to a CA certificate file. |
| certfile | str | Path to a client certificate file. |
| keyfile | str | Path to a client key file. |
| password | str | Password for the client key file (aiohttp only). |
| verify_ssl | bool | Verify SSL certificates. |
| fingerprint | str | SSL fingerprint (aiohttp only). |
| proxy | str | Proxy URL. |
| proxy_auth | str, list | Proxy basic authentication (aiohttp only). |
| proxy_headers | dict | Proxy headers (aiohttp only). |
| timeout | int | Request timeout. |
| auth | str, list | Basic authentication. |
| headers | dict | Request headers. |
| cookies | dict | Dictionary of session cookies. |
Any additional keys supplied will be ignored unless explicitly implemented via custom code.
openbb_core.provider.utils.helpers.make_request- Syncopenbb_core.provider.utils.helpers.amake_request- Asyncopenbb_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_sessionopenbb_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-apicommand.- openbb-api
All settings are passed directly to uvicorn.run, and can be found in the Uvicorn documentation
Keyword arguments supplied to the command line will take priority over the settings in this configuration.