IntelligenzaArtificiale / Free-Auto-GPT

Free Auto GPT with NO paids API is a repository that offers a simple version of Auto GPT, an autonomous AI agent capable of performing tasks independently. Unlike other versions, our implementation does not rely on any paid OpenAI API, making it accessible to anyone.
MIT License
2.44k stars 383 forks source link

Unable to paste chatgpt session token #51

Closed LylaCoding closed 1 year ago

LylaCoding commented 1 year ago

whenever i try to paste the token into the terminal there is a maximum length that it can be and that maximum is way less that what the session key length is

IntelligenzaArtificiale commented 1 year ago

pls share an screshoot of error.

What is the max length of a Python string?

9 quintillion characters on a 64 bit system on CPython 3.10. That's only if your string is made up of only ASCII characters. The max length can be smaller depending on what characters the string contains due to the way CPython implements strings:

9,223,372,036,854,775,758 characters if your string only has ASCII characters (U+00 to U+7F) or 9,223,372,036,854,775,734 characters if your string only has ASCII characters and characters from the Latin-1 Supplement Unicode block (U+80 to U+FF) or 4,611,686,018,427,387,866 characters if your string only contains characters in the Basic Multilingual Plane (for example if it contains Cyrillic letters but no emojis, i.e. U+0100 to U+FFFF) or 2,305,843,009,213,693,932 characters if your string might contain at least one emoji (more formally, if it can contain a character outside the Basic Multilingual Plane, i.e. U+10000 and above) On a 32 bit system it's around 2 billion or 500 million characters. If you don't know whether you're using a 64 bit or a 32 bit system or what that means, you're probably using a 64 bit system.

it is true the token is very long but it is managed as a simple string.

this is the code that read the COOKIE of chat gpt :

CG_TOKEN = input("Insert chatgpt token >>> ")
os.environ["CHATGPT_TOKEN"] = CG_TOKEN
LylaCoding commented 1 year ago

Turns out it was a problem with terminal on mac. There is no input limit on Windows. You should probably mention this

IntelligenzaArtificiale commented 1 year ago

the solution is so simple.

The limit is not in bash but in your operating system. It's defined by the value of ARG_MAX in your OS's limits.h. You can get the value by running getconf ARG_MAX. On my OSX 10.5 machine (and most other BSD systems) it's 262144. You can read more about this limit here.

LylaCoding commented 1 year ago

Ah thanks, sorry for wasting your time. I found that thread but assumed it was outdated as its almost 14 years old.

IntelligenzaArtificiale commented 1 year ago

Don't worry, you don't waste our time.

Maybe this is a most updated GUIDE ?

LylaCoding commented 1 year ago

Thanks that's great, I'll close this issue now :)