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

getTextObject is throwing occasionally #22

Open
danew opened this issue Jun 26, 2024 · 0 comments
Open

getTextObject is throwing occasionally #22

danew opened this issue Jun 26, 2024 · 0 comments

Comments

@danew
Copy link

danew commented Jun 26, 2024

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) =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant