File size: 908 Bytes
15d6f9f
5cfaafd
15d6f9f
0d1138e
 
 
15d6f9f
 
0d1138e
 
59ba69c
0d1138e
 
 
 
5cfaafd
 
 
15d6f9f
59ba69c
15d6f9f
221bb1f
 
15d6f9f
 
 
 
221bb1f
15d6f9f
 
0d1138e
59ba69c
0d1138e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import json
import os

from openbb import obb
import openbb

import utils


# Configure LLM mode for OpenBB
print("Configuring LLM mode...")
obb.user.preferences.output_type="llm"
obb.system.python_settings.docstring_sections=['description', 'examples']
obb.system.python_settings.docstring_max_length=1024

# Set API keys
obb.user.credentials.fmp_api_key = os.environ["FMP_API_KEY"]

# Configure default provider for OpenBB
print("Configuring default provider...")
OPENBB_CONF_PATH = "~/.openbb_platform/user_settings.json"
path = os.path.expanduser(OPENBB_CONF_PATH)
with open(path) as file:
    config = json.load(file)
for tool_name in utils.get_callable_names("obb", obb):
    tname = tool_name[3:].replace(".", "/")
    config["defaults"]["commands"][tname] = {"provider": "yfinance"}
with open(path, "w") as file:
    json.dump(config, file)

# Build OpenBB
print("Building OpenBB...")
openbb.build()