Skip to content

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?

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
@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