vertyco / vrt-cogs

Utility cogs for Red by Vertyco
MIT License
48 stars 28 forks source link

[Assistant] Error when using !chat #162

Closed KinoShiro closed 9 months ago

KinoShiro commented 9 months ago

Describe the bug I am Using a docker to run the gpt api but for some reason I keep getting this error. Whenever I try using the chat function. I've gotten it to work in the past but I think when I've updated it stopped working

Traceback (most recent call last):
  File "/data/cogs/CogManager/cogs/assistant/common/chat.py", line 148, in handle_message
    reply = await self.get_chat_response(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/cogs/CogManager/cogs/assistant/common/chat.py", line 258, in get_chat_response
    return await self._get_chat_response(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/cogs/CogManager/cogs/assistant/common/chat.py", line 379, in _get_chat_response
    raise e
  File "/data/cogs/CogManager/cogs/assistant/common/chat.py", line 363, in _get_chat_response
    response: ChatCompletionMessage = await self.request_response(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/cogs/CogManager/cogs/assistant/common/api.py", line 130, in request_response
    conf.update_usage(
  File "/data/cogs/CogManager/cogs/assistant/common/models.py", line 174, in update_usage
    self.usage[model].output_tokens += output_tokens
TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
vertyco commented 9 months ago

This should be fixed in update 5.7.10