Open dbigham opened 1 year ago
I'm now seeing this part of the docs, below the Quickstart:
"This is a secret token that you need to authenticate your requests to the API. You can generate one using any tool or method you prefer, such as jwt.io."
Even with that additional information, it's not quite clear what I'm needing to do here.
@dbigham Did you resolve this? I'm still not sure what to do here. I found a bearer token from chatgpt, that didn't work. Pasting stuff generated form jwt.io (after clicking share jwt) also didn't work.
Starting out, you can use any arbitrary JWT bearer token. For example, using jwt.io, you can create some arbitrary payload and insert a key into "verify signature" and get a valid bearer token (the string with two .
s) on the Encoded side, and set that as your BEARER_TOKEN
environment variable.
Hope that helps with getting started -- I was a bit confused that the noauth method still required a bearer token.
Yes, what @thatperson42 states is consistent with what I did to get it working.
I new to development, can someone assist me and tell em where I modify the environment variables? There's no .env file for this project.
@shatterstar6457 , the environment variables could be set from the terminal window that you use to launch the application.
So for example, I'm on Windows, so I start powershell, and then I set my environment variables by typing / pasting into the terminal:
$env:DATASTORE="redis"
$env:BEARER_TOKEN="..."
$env:OPENAI_API_KEY="..."
$env:REDIS_HOST="localhost"
$env:REDIS_PORT="6379"
$env:REDIS_INDEX_NAME="index"
$env:REDIS_DOC_PREFIX="doc"
$env:REDIS_DISTANCE_METRIC="COSINE"
$env:REDIS_INDEX_TYPE="FLAT"
Then from the chatgpt-retrieval-plugin
directory I run poetry run dev
.
@shatterstar6457 , the environment variables could be set from the terminal window that you use to launch the application.
So for example, I'm on Windows, so I start powershell, and then I set my environment variables by typing / pasting into the terminal:
$env:DATASTORE="redis" $env:BEARER_TOKEN="..." $env:OPENAI_API_KEY="..." $env:REDIS_HOST="localhost" $env:REDIS_PORT="6379" $env:REDIS_INDEX_NAME="index" $env:REDIS_DOC_PREFIX="doc" $env:REDIS_DISTANCE_METRIC="COSINE" $env:REDIS_INDEX_TYPE="FLAT"
Then from the
chatgpt-retrieval-plugin
directory I runpoetry run dev
.
Thank you so much!
can someone explain what is this bearer token and why its needed ?
@madruga8 Your token should look like this :
BEARER_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.F3f0v8YA_RnW0wnNdkR_uuqD-GddzTDuB2W0lwAzL88
It is the concatenation of 3 string in base 64. First is header, second is payload, and third are data related to the security algorithm defined in the header. Go to https://jwt.io/ and you can replace with your own private key, instead of openai.
Using a JSON web token allows you to authenticate a user without querying the authentification server for verification.
But I am still stuck like you, my project runs good after poetry run start
but the bound to chatGPT is refused:
edits: typo
The Quickstart says that both of these environment variables need to be set, but it would seem that these two environment variables should both be set to one's Open AI API key?
If so, why are both environment variables needed? This caused confusion for me.