joshcho / ChatGPT.el

ChatGPT in Emacs
GNU General Public License v3.0
397 stars 34 forks source link

EPC issues with ChatGPT - commands hanging #34

Closed apcode closed 1 year ago

apcode commented 1 year ago

When running chatgpt commands, they are hanging on the ellipses. I investigated and found a fix, but it doesn't seem right.

As stated in the docs I installed pip install epc for use with ChatGPT.el. However, there seems to be a version or fundamental issue with that package.

python epc package uses sexpdata package. The sexpdata package parses lisp expressions in python objects. One of these objects is the Symbol.

However, the epc/handler.py function calls Symbol.value which doesn't exist, so you get a python AttributeError: Symbol has no attribute value

Example where problem exists: python/site-packages/epc/handler.py:87

def unpack_message(bytes):
    data = loads(bytes.decode("utf-8"))
    return (data[0].value, data[1], data[2:])

data[0] is of type Symbol, which doesn't have a value attribute. So I changed this to str(data[0]). I changed a few other places where this is done, e.g. handler.py:259 name = meth.value to 1 name = str(meth)`.

This now works. But how did it ever work for anyone else? What versions are people using? Could someone provide a working requirements.txt

apcode commented 1 year ago

Here are my versions that are incompatible:

sexpdata==0.0.4
epc==0.0.5

I edited epc to work with this version of sexpdata.

AkshayGuptaK commented 1 year ago

v0.0.4 of sexpdata just released on Feb 10. Reverting back to v0.0.3 resolved this issue for me.

joshcho commented 1 year ago

We no longer use epc, as of https://github.com/joshcho/ChatGPT.el/commit/c38c9150b4f156c90c44f330aa0cd2497d66f8c5, closing