Git Product home page Git Product logo

Comments (10)

devoncarew avatar devoncarew commented on August 19, 2024 1

@devoncarew Not sure what kittens is (typo?) but I imported google_generative_ai as below:

Oops! That was a copy-paste error; it should have read google_generative_ai :)

from generative-ai-dart.

natebosch avatar natebosch commented on August 19, 2024 1

Note that this error:

Error: Only one candidate can be specified

Is not a bug with the SDK. This is a correctly reported error produced by the backend. You'll need to remove the candidateCount argument, or set it to 1 for this request. I don't know the full set of backend restrictions that limit the candidate count to one.

from generative-ai-dart.

natebosch avatar natebosch commented on August 19, 2024

The FormatException should be resolved by #36

It won't result in no exception though - we'd throw a different one with the message "Only one candidate can be specified".

This looks like an intentional error from the backend, but I'm not sure where to get more information about it. @anderdobo do you know who might be able to answer questions about unexpected errors from the LLM?

from generative-ai-dart.

huynguyennovem avatar huynguyennovem commented on August 19, 2024

I have a semi-similar error when specifying candidateCount in GenerationConfig. Here is the full stack trace:

Error: Only one candidate can be specified
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3  throw_
packages/google_generative_ai/src/api.dart 509:38                            <fn>
packages/google_generative_ai/src/api.dart 499:10                            parseGenerateContentResponse
packages/google_generative_ai/src/model.dart 187:12                          generateContent
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
dart-sdk/lib/async/future_impl.dart 162:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 838:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 867:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 643:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 713:7                                    callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

Looks like it hits parseError and #36 should fix it?

Using google_generative_ai: ^0.3.2.

from generative-ai-dart.

devoncarew avatar devoncarew commented on August 19, 2024

To see if this is fixed in main, you can try appending:

dependency_overrides:
  kittens:
    git:
      url: https://github.com/google-gemini/generative-ai-dart.git
      path: pkgs/google_generative_ai

to your pubspec. If this does address the problem, can you report back on this issue? That'll let us know to accelerate publishing the latest.

from generative-ai-dart.

huynguyennovem avatar huynguyennovem commented on August 19, 2024

@devoncarew Not sure what kittens is (typo?) but I imported google_generative_ai as below:

dependency_overrides:
  google_generative_ai:
    git:
      url: https://github.com/google-gemini/generative-ai-dart.git
      path: pkgs/google_generative_ai

Here is the fetched version on pubspec.lock:

  google_generative_ai:
    dependency: "direct main"
    description:
      path: "pkgs/google_generative_ai"
      ref: HEAD
      resolved-ref: eb5e39b2533f40511d517ce873464dc76290159b
      url: "https://github.com/google-gemini/generative-ai-dart.git"
    source: git
    version: "0.3.3-wip"

But the error persists:

Error: Only one candidate can be specified
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3  throw_
packages/google_generative_ai/src/api.dart 509:38                            <fn>
packages/google_generative_ai/src/api.dart 499:10                            parseGenerateContentResponse
packages/google_generative_ai/src/model.dart 188:12                          generateContent
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
dart-sdk/lib/async/future_impl.dart 162:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 838:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 867:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 643:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 713:7                                    callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

from generative-ai-dart.

arnoorani avatar arnoorani commented on August 19, 2024

is this issue resolved I still get this issue, while using google_generative_ai: ^0.4.3

from generative-ai-dart.

arnoorani avatar arnoorani commented on August 19, 2024

@devoncarew Not sure what kittens is (typo?) but I imported google_generative_ai as below:

dependency_overrides:
  google_generative_ai:
    git:
      url: https://github.com/google-gemini/generative-ai-dart.git
      path: pkgs/google_generative_ai

Here is the fetched version on pubspec.lock:

  google_generative_ai:
    dependency: "direct main"
    description:
      path: "pkgs/google_generative_ai"
      ref: HEAD
      resolved-ref: eb5e39b2533f40511d517ce873464dc76290159b
      url: "https://github.com/google-gemini/generative-ai-dart.git"
    source: git
    version: "0.3.3-wip"

But the error persists:

Error: Only one candidate can be specified
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3  throw_
packages/google_generative_ai/src/api.dart 509:38                            <fn>
packages/google_generative_ai/src/api.dart 499:10                            parseGenerateContentResponse
packages/google_generative_ai/src/model.dart 188:12                          generateContent
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
dart-sdk/lib/async/future_impl.dart 162:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 838:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 867:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 643:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 713:7                                    callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

were you able to resolve the issue?

from generative-ai-dart.

devoncarew avatar devoncarew commented on August 19, 2024

@arnoorani - given the age of this issue (and how much the library has changed since then), this may or may not be the same problem. Do you mind filing a new issue w/ what you're seeing, including a stack trace? Thanks!

from generative-ai-dart.

arnoorani avatar arnoorani commented on August 19, 2024

@arnoorani - given the age of this issue (and how much the library has changed since then), this may or may not be the same problem. Do you mind filing a new issue w/ what you're seeing, including a stack trace? Thanks!

The issue does not come up anymore, but will keep an eye out for it, thanks so much for the response.

from generative-ai-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.