guardrails
guardrails copied to clipboard
-> 27 openai.completions.create,[bug]
raw_llm_response, validated_response, *rest = guard( openai.completions.create, prompt_params={ "nl_instruction": "Select the name of the employee who has the highest salary." }, max_tokens=2048, temperature=0, ) Error occured-:
OpenAIError Traceback (most recent call last)
4 frames /usr/local/lib/python3.10/dist-packages/openai/_client.py in init(self, api_key, organization, base_url, timeout, max_retries, default_headers, default_query, http_client, _strict_response_validation) 98 api_key = os.environ.get("OPENAI_API_KEY") 99 if api_key is None: --> 100 raise OpenAIError( 101 "The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable" 102 )
OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
Hi! How are you passing the OpenAI api key currently?
Hi @AayushiKumari. There's been no update on this in several months. Are you still having issues? Please feel free to reopen this if it's still a problem.