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 ability to set modelParams on getGenerativeModelFromCachedContent() #254

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

hsubox76
Copy link
Collaborator

@hsubox76 hsubox76 commented Sep 10, 2024

Add a modelParams arg to getGenerativeModelFromCachedContent(), allowing users to set generationConfig and safetySettings.

@hsubox76 hsubox76 marked this pull request as ready for review September 10, 2024 19:21
Copy link
Collaborator

@dlarocque dlarocque left a comment

Choose a reason for hiding this comment

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

Is the failed node integration test a flake?

@@ -481,7 +481,7 @@ export class GoogleGenerativeAI {
// (undocumented)
apiKey: string;
getGenerativeModel(modelParams: ModelParams, requestOptions?: RequestOptions): GenerativeModel;
getGenerativeModelFromCachedContent(cachedContent: CachedContent, requestOptions?: RequestOptions): GenerativeModel;
getGenerativeModelFromCachedContent(cachedContent: CachedContent, modelParams?: Partial<ModelParams>, requestOptions?: RequestOptions): GenerativeModel;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we make this Partial<>? Is ModelParams.model only optional when it's passed to this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

None of the params are required here, and the whole object is optional, because cachedContent should have everything it needs to initialize (it always has "model").

@dlarocque dlarocque self-requested a review September 11, 2024 18:06
@hsubox76 hsubox76 merged commit fc008a1 into main Sep 11, 2024
9 checks passed
@hsubox76 hsubox76 deleted the ch-add-model-params branch September 11, 2024 19:37
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