Strvm / meta-ai-api

Llama 3 API (MetaAI Reverse Engineered)
158 stars 27 forks source link

Error when trying to get "response" #8

Closed themanyfaceddemon closed 2 months ago

themanyfaceddemon commented 2 months ago

Code:

from meta_ai_api import MetaAI
import traceback

try:
    ai = MetaAI()
    response = ai.prompt(message="What was the Warriors score last game?")
    if response:
        print(response)
    else:
        print("response is not valid")
except Exception as e:
    print(f"Errror: {e}")
    traceback.print_exc()

When I try to run the script I get the following:

G:\Desktop>python test.py
Errror: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\Desktop\test.py", line 6, in <module>
    response = ai.prompt(message="What was the Warriors score last game?")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 95, in prompt
    self.access_token = self.get_access_token()
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 71, in get_access_token
    auth_json = response.json()
                ^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

G:\Desktop>python test.py
Errror: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\Desktop\test.py", line 6, in <module>
    response = ai.prompt(message="What was the Warriors score last game?")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 95, in prompt
    self.access_token = self.get_access_token()
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 71, in get_access_token
    auth_json = response.json()
                ^^^^^^^^^^^^^^^
  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I don't fully understand what the problem is.

sudityashrivastav commented 2 months ago

I believe this is the problem of python's compatibility. I had tried to install in in windows but got some shit errors after this I tried relit.com but got the some error which you have right now.

basically he has to choose language like golang or node js. That would be more compatible wiht more devices.

themanyfaceddemon commented 2 months ago

💀

Strvm commented 2 months ago

Code:


from meta_ai_api import MetaAI

import traceback

try:

    ai = MetaAI()

    response = ai.prompt(message="What was the Warriors score last game?")

    if response:

        print(response)

    else:

        print("response is not valid")

except Exception as e:

    print(f"Errror: {e}")

    traceback.print_exc()

When I try to run the script I get the following:


G:\Desktop>python test.py

Errror: Expecting value: line 1 column 1 (char 0)

Traceback (most recent call last):

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 971, in json

    return complexjson.loads(self.text, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads

    return _default_decoder.decode(s)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\decoder.py", line 337, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\decoder.py", line 355, in raw_decode

    raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "G:\Desktop\test.py", line 6, in <module>

    response = ai.prompt(message="What was the Warriors score last game?")

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 95, in prompt

    self.access_token = self.get_access_token()

                        ^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 71, in get_access_token

    auth_json = response.json()

                ^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 975, in json

    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

G:\Desktop>python test.py

Errror: Expecting value: line 1 column 1 (char 0)

Traceback (most recent call last):

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 971, in json

    return complexjson.loads(self.text, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads

    return _default_decoder.decode(s)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\decoder.py", line 337, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Program Files\Python311\Lib\json\decoder.py", line 355, in raw_decode

    raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "G:\Desktop\test.py", line 6, in <module>

    response = ai.prompt(message="What was the Warriors score last game?")

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 95, in prompt

    self.access_token = self.get_access_token()

                        ^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\meta_ai_api\main.py", line 71, in get_access_token

    auth_json = response.json()

                ^^^^^^^^^^^^^^^

  File "C:\Users\Cain\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 975, in json

    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I don't fully understand what the problem is.

Hi, I'll take a look at it today. Just to confirm, you are able to use it on https://meta.ai correct?

themanyfaceddemon commented 2 months ago

Mmmmmm, regional lock. I'll go smoke bamboo

Strvm commented 2 months ago

Mmmmmm, regional lock. I'll go smoke bamboo

Yea sorry about that.. I'll try to add the possibility to add proxies in future versions to bypass that location banning

themanyfaceddemon commented 2 months ago

Well, we found an error and that’s good. Thank you!