kramcat / CharacterAI

Unofficial Python API for character.ai
https://docs.kram.cat
MIT License
378 stars 51 forks source link

No eligible candidates in send_message() #47

Closed R1senDev closed 9 months ago

R1senDev commented 10 months ago

While executing: cli.chat.send_message(chat['external_id'], tgt, msg) (as in example)

Full exception text:

Traceback (most recent call last):
  File "/usr/lib/python3.11/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
    cli.main()
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
    run()
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/risenanderson/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "/home/risenanderson/projects/dsbots/Scarabot/main.py", line 22, in <module>
    data = cli.chat.send_message(chat['external_id'], tgt, msg)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/risenanderson/.local/lib/python3.11/site-packages/characterai/characterai.py", line 593, in send_message
    raise errors.FilterError('No eligible candidates')
characterai.errors.FilterError: No eligible candidates
KubaPro010 commented 10 months ago

It's just the filter, C.AI can filter the message, when it will censor it, this error will be raised

R1senDev commented 10 months ago

It's just the filter, C.AI can filter the message, when it will censor it, this error will be raised

Hmm, but I just wrote "Hello!"...

KubaPro010 commented 10 months ago

Then the lib would be broken, I think there was a filtering parameter, set it to False

kramcat commented 10 months ago

I also sometimes get this error until I understand what the problem is.

but I think many people get it because of incorrect parameters, read about this function in the documentation

kramcat commented 9 months ago

fixed on v0.8.0