Skip to content

getTextObject is throwing occasionally #22

Description

@danew

Occasionally when calling gemini.ask the response throws the following error:

256 |   }
257 |   return parts;
258 | };
259 | var _Gemini = class _Gemini {
260 |   constructor(key, options = {}) {
261 |     this.getTextObject = (response) => response.candidates[0].content.parts[0];
                                                                    ^
TypeError: undefined is not an object (evaluating 'response.candidates[0].content.parts')
      at /Users/danew/development/github/SaneFYI/dbjs/node_modules/gemini-ai/dist/index.mjs:261:63
      at /Users/danew/development/github/SaneFYI/dbjs/node_modules/gemini-ai/dist/index.mjs:275:23

private getTextObject = (response: GeminiResponse) =>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions