generative-ai-js
generative-ai-js copied to clipboard
model.StartChat() only supports simplified Chinese, not traditional Chinese. However, model.generateContent() supports traditional Chinese.
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
- 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);
- get result
0
- 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);
- the result like this:
Specifications
**清溪**
溪水潺潺绕石鸣,
绿柳依依拂清风。
游鱼戏藻影绰绰,
鸟语花香沁心胸。
山岚缥缈似烟雾,
掩映山色醉人目。
我醉青山不知归,
人间烦恼尽消疏。
80
- Version: 0.2.1
- Platform: ubuntu 22.04 in WSL
Could not repro with Gemini 1.5 flash or pro. Can you confirm this is still a problem?
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.