-
Notifications
You must be signed in to change notification settings - Fork 307
Closed
Labels
component:js sdkIssue/PR related to JavaScript SDKIssue/PR related to JavaScript SDKstatus:triagedIssue/PR triaged to the corresponding sub-teamIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't workingSomething isn't working
Description
Expected Behavior
after receiving that error,
{
candidates: [ { finishReason: 'RECITATION', index: 0 } ],
text: [Function (anonymous)],
functionCall: [Function (anonymous)],
functionCalls: [Function (anonymous)]
}
to be able to continue to chatting, model's last element of history must contain an empty text, such as
{
role: 'user',
parts: [ { text: 'meme kanserinde hangi ilaçlar kullanılır?\n' } ]
},
{
parts: [ { text: '' } ], role: 'model'
}
Actual Behavior
this error kills chat session
{
candidates: [ { finishReason: 'RECITATION', index: 0 } ],
text: [Function (anonymous)],
functionCall: [Function (anonymous)],
functionCalls: [Function (anonymous)]
}
because now last element of history contains empty parts[] as follows
{
role: 'user',
parts: [ { text: 'meme kanserinde hangi ilaçlar kullanılır?\n' } ]
},
{ parts: [], role: 'model' }
if I continue to chat , always get that error::
GoogleGenerativeAIError: [400 Bad Request] * GenerateContentRequest.contents[3].parts: contents.parts must not be empty
in that line of source code
const result = await chat.sendMessage(prompt);
Steps to Reproduce the Problem
- give a large context prompt so that your text contains texts from trained data. Ask a question about your large context prompt. My large context prompt contains 35k tokens, and I do not want to share here. there may be other ways to get RECITATION error: Gemini API : The recitation problem is annoying google/generative-ai-docs#257
- gemini 1.5 pro gives RECITATION error
- now ask anything
Specifications
- Version: nodejs (20.12.2 LTS), gemini js api : "@google/generative-ai": "^0.9.0" , model gemini 1.5 pro v1beta
- Platform: Windows
odragora
Metadata
Metadata
Assignees
Labels
component:js sdkIssue/PR related to JavaScript SDKIssue/PR related to JavaScript SDKstatus:triagedIssue/PR triaged to the corresponding sub-teamIssue/PR triaged to the corresponding sub-teamtype:bugSomething isn't workingSomething isn't working