MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / get_api_key

Method get_api_key

AskAgent/python/llm_providers/openai.py:41–48  ·  view source on GitHub ↗

Retrieve the OpenAI API key from environment or raise an error.

(cls)

Source from the content-addressed store, hash-verified

39
40 @classmethod
41 def get_api_key(cls) -> str:
42 """
43 Retrieve the OpenAI API key from environment or raise an error.
44 """
45 # Get the API key from the preferred provider config
46 provider_config = CONFIG.llm_endpoints["openai"]
47 api_key = provider_config.api_key
48 return api_key
49
50 @classmethod
51 def get_client(cls) -> AsyncOpenAI:

Callers 1

get_clientMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected