vercel-llm-api icon indicating copy to clipboard operation
vercel-llm-api copied to clipboard

Issues while making prompts with Cyrillic characters.

Open FanaticExplorer opened this issue 1 year ago • 3 comments

When I send openai:gpt-3.5-turbo a chat request on russian (for example, "Расскажи больше про себя"), i get an error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/curl_cffi/curl.py", line 53, in write_callback
    callback(ffi.buffer(ptr, nmemb)[:])
  File "/home/vercel_ai.py", line 123, in callback
    chunks_queue.put(data.decode())
                     ^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: unexpected end of data

And when I make a chat on Ukrainian with the same model, it gives only part of the text. For example, "Розкажи більше про себе" returned

Звісно, я з радістю розповім більше про себе! 

... //answers like usual

Щодо моїх функцій, я можу допомогти вам з по

And that's all; it didn't finished his answer.

FanaticExplorer avatar Jul 25 '23 20:07 FanaticExplorer

Somehow, while trying to ask on russian, i got whole new error:

Traceback (most recent call last):
  File "/home/vercel_ai.py", line 137, in stream_request
    chunk = chunks_queue.get(block=True, timeout=0.01)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/queue.py", line 179, in get
    raise Empty
_queue.Empty

FanaticExplorer avatar Jul 26 '23 20:07 FanaticExplorer

Any progress?

FanaticExplorer avatar Jan 22 '24 13:01 FanaticExplorer

We're stuck on an entirely different issue which renders the library unusable 😅

See issue #22

0x6a69616e avatar Jan 22 '24 13:01 0x6a69616e