Comments (10)
@devoncarew Not sure what
kittens
is (typo?) but I importedgoogle_generative_ai
as below:
Oops! That was a copy-paste error; it should have read google_generative_ai
:)
from generative-ai-dart.
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.
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.
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.
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.
@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.
is this issue resolved I still get this issue, while using google_generative_ai: ^0.4.3
from generative-ai-dart.
@devoncarew Not sure what
kittens
is (typo?) but I importedgoogle_generative_ai
as below:dependency_overrides: google_generative_ai: git: url: https://github.com/google-gemini/generative-ai-dart.git path: pkgs/google_generative_aiHere 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.
@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 - 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)
- Multi-modal chat with `gemini-pro-vision` HOT 1
- Security Policy violation Branch Protection HOT 64
- Security Policy violation Outside Collaborators HOT 12
- Security Policy violation SECURITY.md HOT 16
- Pub not pulling correct build HOT 1
- Error 500 (internal error) while prompting with function call HOT 2
- Not allowed to use if user in Hong Kong HOT 1
- Server Exception Developer instruction is not enabled for models/gemini-pro HOT 4
- Multi content doesn't work with google generative ai flutter package HOT 2
- Is there a way to run AI locally? HOT 1
- Allow setting a base URL
- import problem HOT 1
- (firebase_vertexai: ^0.2.2) FormatException: Unhandled CitationMetadata format HOT 10
- Chinese will be garbled in function calling HOT 1
- Context Caching
- Function calling only considers functions in the first tool? HOT 1
- 1.0 Release
- BUG: role with null value added to the history on content blocked due to Safety reasons
- The model is overloaded. Please try again later. HOT 1
- Code Execution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generative-ai-dart.