guardrails icon indicating copy to clipboard operation
guardrails copied to clipboard

-> 27 openai.completions.create,[bug]

Open AayushiKumari opened this issue 10 months ago • 1 comments

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) in <cell line: 26>() 25 26 raw_llm_response, validated_response, *rest = guard( ---> 27 openai.completions.create, 28 prompt_params={ 29 "nl_instruction": "Select the name of the employee who has the highest salary."

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

AayushiKumari avatar Apr 11 '24 07:04 AayushiKumari

Hi! How are you passing the OpenAI api key currently?

zsimjee avatar Apr 11 '24 17:04 zsimjee

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.

dtam avatar Jul 22 '24 17:07 dtam