gkamradt / QuickAgent

255 stars 112 forks source link

Issue with API's #6

Open DrewPear309 opened 2 months ago

DrewPear309 commented 2 months ago

I keep getting this error regardless of the API i use. Groq or OpenAI gives the same respective error.

(venv) PS C:\qagent> python quickagent.py Python-dotenv could not parse statement starting at line 1 Traceback (most recent call last): File "C:\qagent\quickagent.py", line 218, in manager = ConversationManager() ^^^^^^^^^^^^^^^^^^^^^ File "C:\qagent\quickagent.py", line 195, in init self.llm = LanguageModelProcessor() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\qagent\quickagent.py", line 34, in init self.llm = ChatOpenAI(temperature=0, model_name="gpt-4-0125-preview", openai_api_key=os.getenv("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"))

File "C:\qagent\venv\Lib\site-packages\langchain_core\load\serializable.py", line 120, in init super().init(**kwargs) File "C:\qagent\venv\Lib\site-packages\pydantic\v1\main.py", line 341, in init raise validation_error pydantic.v1.error_wrappers.ValidationError: 1 validation error for ChatOpenAI root Did not find openai_api_key, please add an environment variable OPENAI_API_KEY which contains it, or pass openai_api_key as a named parameter. (type=value_error)

tazei186 commented 2 months ago

same issue

gkamradt commented 2 months ago

Please try putting the openai api key in the environment as a variable

On Tue, Apr 23, 2024 at 3:19 PM tazei186 @.***> wrote:

same issue

— Reply to this email directly, view it on GitHub https://github.com/gkamradt/QuickAgent/issues/6#issuecomment-2073567358, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACK22PPRVRAVBH3JZPIOCMTY63M6NAVCNFSM6AAAAABGIP7OGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTGU3DOMZVHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>