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

Add support for overriding API version #114

Merged
merged 4 commits into from
Apr 9, 2024
Merged

Add support for overriding API version #114

merged 4 commits into from
Apr 9, 2024

Conversation

natebosch
Copy link
Collaborator

@natebosch natebosch commented Apr 9, 2024

This API will be required for authors to use to try function calling
while the backend support is still in version v1beta.

Add a RequestOptions class. For now this supports only the apiVersion
configuration. In the future this may add a timeout (#44) if implement
a deeper HTTP timeout functionality than Future.timeout.

This API will be required for authors to use to try function calling
while the backend support is still in version `v1beta`.

Add a RequestOptions class. For now this supports only the `apiVersion`
configuration. In the future this may add a `timeout` (#44) if implement
a deeper HTTP timeout functionality than `Future.timeout`.

Add a utility for VertexAI SDK to pass a callback instead of a single
URI.
@natebosch natebosch requested a review from devoncarew April 9, 2024 00:09
@natebosch
Copy link
Collaborator Author

I had implemented this originally with the intent to support RequestOptions on individual generateContent calls, but I think we ended up dropping that and so I think I'll simplify back down to a single URI for now.

@natebosch natebosch marked this pull request as draft April 9, 2024 00:13
@natebosch natebosch marked this pull request as ready for review April 9, 2024 00:21
Copy link
Collaborator

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ some dartdoc suggestions

required ApiClient client,
List<SafetySetting> safetySettings = const [],
GenerationConfig? generationConfig,
RequestOptions? requestOptions,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do think we'll have more options, this lgtm. Otherwise we may want to just simplify this to apiVersion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it's likely we'll add more options at some point. I'm pretty comfortable starting with this design even if there is only a single configuration because it matches exactly the design in other languages (although some of the other languages already support timeout).

pkgs/google_generative_ai/lib/src/model.dart Show resolved Hide resolved
pkgs/google_generative_ai/lib/src/model.dart Show resolved Hide resolved
@natebosch natebosch merged commit 20e96b9 into main Apr 9, 2024
7 checks passed
@natebosch natebosch deleted the request-options branch April 9, 2024 15:57
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

Successfully merging this pull request may close these issues.

2 participants