generative-ai-js icon indicating copy to clipboard operation
generative-ai-js copied to clipboard

model.StartChat() only supports simplified Chinese, not traditional Chinese. However, model.generateContent() supports traditional Chinese.

Open dio833 opened this issue 1 year ago • 2 comments

Expected Behavior

model gemini-pro startChat with traditional Chinese prompt returss result text.

Actual Behavior

model gemini-pro startChat with traditional Chinese prompt returns empty string.

Steps to Reproduce the Problem

  1. asked the question in traditional Chinese
  const model = genAI.getGenerativeModel({ model: "gemini-pro"});
  
  const chat = model.startChat({
    history: [
    ],
    generationConfig: {
      maxOutputTokens: 100,
    },
  });

  const msg = "創作一首古詩";

  const result = await chat.sendMessage(msg);
  const response = await result.response;
  const text = response.text();
  console.log(text);
  console.log(text.length);
  1. get result

0
  1. If I asked the same question in simplified Chinese
  const model = genAI.getGenerativeModel({ model: "gemini-pro"});
  
  const chat = model.startChat({
    history: [
    ],
    generationConfig: {
      maxOutputTokens: 100,
    },
  });


  const msg = "创作一首古诗";

  const result = await chat.sendMessage(msg);
  const response = await result.response;
  const text = response.text();
  console.log(text);
  console.log(text.length);
  1. the result like this:

Specifications

**清溪**

溪水潺潺绕石鸣,
绿柳依依拂清风。
游鱼戏藻影绰绰,
鸟语花香沁心胸。

山岚缥缈似烟雾,
掩映山色醉人目。
我醉青山不知归,
人间烦恼尽消疏。
80
  • Version: 0.2.1
  • Platform: ubuntu 22.04 in WSL

dio833 avatar Feb 29 '24 10:02 dio833

Could not repro with Gemini 1.5 flash or pro. Can you confirm this is still a problem?

IvanLH avatar Feb 20 '25 18:02 IvanLH

Could not repro with Gemini 1.5 flash or pro. Can you confirm this is still a problem?

Same here, I could not reproduce this issue with gemini-2.0-pro-exp-02-05 or gemini-1.5-pro.

andyc2513 avatar Mar 21 '25 17:03 andyc2513