Skip to content

AuthenticationError: Incorrect API key provided: https://************************************************.com. #3

@hherpa

Description

@hherpa

I'm generating an openai api format link for wizardcoder-13b to use in autogen with support for downloading various documents, but your google collab notebook doesn't accept it.

---------------------------------------------------------------------------
AuthenticationError                       Traceback (most recent call last)
[<ipython-input-24-85f187986a5e>](https://localhost:8080/#) in <cell line: 5>()
      3     embedding_function=OpenAIEmbeddings()
      4 )
----> 5 vectorstore.add_documents(docs)

16 frames
[/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py](https://localhost:8080/#) in _interpret_response_line(self, rbody, rcode, rheaders, stream)
    773         stream_error = stream and "error" in resp.data
    774         if stream_error or not 200 <= rcode < 300:
--> 775             raise self.handle_error_response(
    776                 rbody, rcode, resp.data, rheaders, stream_error=stream_error
    777             )

AuthenticationError: Incorrect API key provided: https://************************************************.com. You can find your API key at https://platform.openai.com/account/api-keys.

Is there anything I can do about it? (+ if you know another way to generate OpenAI API format link, I would be very grateful if you could share it). Also if the error isn't in the link, I can assume it's in the way I'm uploading it (I edited the code a bit):

import autogen
import os

config_list = [
    {
        "model": "mistral-7b",
        "api_key": "https://brothers-chip-training-potentially.trycloudflare.com", # - This is roughly what the links I generate look like (regular autogen accepts them and works fine, but I need document support)
    },
]

gpt4_api_key = "https://brothers-chip-training-potentially.trycloudflare.com"
os.environ['OPENAI_API_KEY'] = gpt4_api_key

Once again, I would like to point out that normal autogen accepts and works with this link, but with LangChain it does not allow it for some reason.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions