shrimpsizemoose / matvey-3000

simple openai chatbot
1 stars 1 forks source link

Parse pic caption when someone replies #3

Closed cra closed 8 months ago

cra commented 1 year ago

Сейчас если реплаить то он натыкается на невовремя прилетевший None, скорее всего формат сообщения надо по-другому парсить типа надо посмотреть как там вытаскивается что это картинка

    return await wrapped()
  File "/home/shrimpsizemoose/inbox/matvey/src/bot_handler.py", line 150, in send_chatgpt_response
    response = openai.ChatCompletion.create(model=config.model, messages=messages_to_send)
  File "/home/shrimpsizemoose/.pyenv/versions/py310g/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/home/shrimpsizemoose/.pyenv/versions/py310g/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/home/shrimpsizemoose/.pyenv/versions/py310g/lib/python3.10/site-packages/openai/api_requestor.py", line 226, in request
    resp, got_stream = self._interpret_response(result, stream)
  File "/home/shrimpsizemoose/.pyenv/versions/py310g/lib/python3.10/site-packages/openai/api_requestor.py", line 620, in _interpret_response
    self._interpret_response_line(
  File "/home/shrimpsizemoose/.pyenv/versions/py310g/lib/python3.10/site-packages/openai/api_requestor.py", line 683, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: None is not of type 'string' - 'messages.1.content'
cra commented 8 months ago

fixed in 263ab2a294df33e97ac7990481439db00ccf2b01 (v.0.4.3)