MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/agent/tools_controller.py:36–43  ·  view source on GitHub ↗
(self, openai_api_key, all_tools, stream_output=False, llm='ChatGPT')

Source from the content-addressed store, hash-verified

34 """Use multiple tools to answer a question. Basically pass a natural question to
35 """
36 def __init__(self, openai_api_key, all_tools, stream_output=False, llm='ChatGPT'):
37 if len(openai_api_key) < 3: # not valid key (TODO: more rigorous checking)
38 openai_api_key = os.environ.get('OPENAI_API_KEY')
39 self.openai_api_key = openai_api_key
40 self.stream_output = stream_output
41 self.llm_model = llm
42 self.set_openai_api_key(openai_api_key)
43 self.load_tools(all_tools)
44
45 def set_openai_api_key(self, key):
46 logger.info("Using {}".format(self.llm_model))

Callers

nothing calls this directly

Calls 2

set_openai_api_keyMethod · 0.95
load_toolsMethod · 0.95

Tested by

no test coverage detected