Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dio833 opened this issue Feb 29, 2024 · 0 comments
Assignees
Labels
component:other Questions unrelated to SDK status:triaged Issue/PR triaged to the corresponding sub-team type:bug Something isn't working

Comments

@dio833
Copy link

dio833 commented Feb 29, 2024

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
@singhniraj08 singhniraj08 added component:other Questions unrelated to SDK type:bug Something isn't working status:triaged Issue/PR triaged to the corresponding sub-team labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:other Questions unrelated to SDK status:triaged Issue/PR triaged to the corresponding sub-team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants