advanced-stack / py-llm-core

A pythonic library providing light-weighted interface with LLMs
MIT License
103 stars 8 forks source link

ERROR: OpenAIError: The api_key client option must be set either by passing api_key to the client #9

Closed andysingal closed 2 months ago

andysingal commented 6 months ago

Here is some of challenges, my notebook: https://colab.research.google.com/drive/1pAch0QBP-MzO7uiiUpapzIxXCm1_Xj7W?usp=sharing

summary_collection = DenserSummaryCollection.summarize(first_10_pages)
print(len(summary_collection.summaries))
---------------------------------------------------------------------------
OpenAIError                               Traceback (most recent call last)
[<ipython-input-21-9f71d5edc8e0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 summary_collection = DenserSummaryCollection.summarize(first_10_pages)
      2 print(len(summary_collection.summaries))

4 frames
[/usr/local/lib/python3.10/dist-packages/openai/_client.py](https://localhost:8080/#) in __init__(self, api_key, organization, base_url, timeout, max_retries, default_headers, default_query, http_client, _strict_response_validation)
     91             api_key = os.environ.get("OPENAI_API_KEY")
     92         if api_key is None:
---> 93             raise OpenAIError(
     94                 "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"
     95             )

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
paschembri commented 6 months ago

@andysingal you need to disable the key asap from your notebook as you shared it publicly

andysingal commented 6 months ago

it is deleted, thanks

On Thu, Dec 7, 2023 at 4:09 PM Pierre Alexandre SCHEMBRI < @.***> wrote:

@andysingal https://github.com/andysingal you need to disable the key asap from your notebook as you shared it publicly

— Reply to this email directly, view it on GitHub https://github.com/advanced-stack/py-llm-core/issues/9#issuecomment-1845102925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4LJNNQZMC3KO47DYVTTW3YIGMHFAVCNFSM6AAAAABAJWBKQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBVGEYDEOJSGU . You are receiving this because you were mentioned.Message ID: @.***>