googleapis / nodejs-vertexai

Apache License 2.0
115 stars 44 forks source link

When using Japanese with vertex_ai.preview.getGenerativeModel, REPLACEMENT CHARACTERS are displayed. #78

Closed Arahabica closed 10 months ago

Arahabica commented 10 months ago

When using Japanese with vertex_ai.preview.getGenerativeModel, REPLACEMENT CHARACTERS are displayed.

Environment details

Steps to reproduce

  1. Use Japanese with vertex_ai.preview.getGenerativeModel.
  2. Observe that the response displays REPLACEMENT CHARACTERS as shown below:
豊臣秀吉(1537年-1598年���は、日本の戦国時代から安土桃山時代にかけて活躍した������・大名・政治家です。
Arahabica commented 10 months ago

I use gemini-pro-vision model.

Arahabica commented 10 months ago

It seems like the issue might be due to simple string concatenation here. https://github.com/googleapis/nodejs-vertexai/blob/9546fe6aed5f647495cc8f511dd78f56f6755a35/src/process_stream.ts#L45

sararob commented 10 months ago

This should have been fixed by https://github.com/googleapis/nodejs-vertexai/pull/86. Could you confirm by installing from main via npm install "https://github.com/googleapis/nodejs-vertexai" and sending the same request you tried before?

Arahabica commented 10 months ago

@sararob I have confirmed that the problem is fixed. Thank you!

sararob commented 10 months ago

Thanks for confirming! I'll close this issue.