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

fix: GoogleGemini generation_config param #665

Merged
merged 4 commits into from
Jun 22, 2024

Conversation

mazenkhalil
Copy link
Contributor

Fixes #648

@andreibondarev
Copy link
Collaborator

@mazenkhalil Do you think you could add a quick spec?

@mazenkhalil
Copy link
Contributor Author

@mazenkhalil Do you think you could add a quick spec?

I have synced the whole implementation with GeminiAPI & and I have added the tests

@mazenkhalil
Copy link
Contributor Author

@andreibondarev Any update here?

@mazenkhalil
Copy link
Contributor Author

@andreibondarev Is there anything I can do to speed up the review process here?

parameters[:generation_config] = {temperature: parameters.delete(:temperature)} if parameters[:temperature]
parameters[:generation_config] ||= {}
parameters[:generation_config][:temperature] ||= parameters[:temperature] if parameters[:temperature]
parameters.delete(:temperature)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not change:

parameters[:generation_config][:temperature] ||= parameters[:temperature] if parameters[:temperature]
parameters.delete(:temperature)

to

parameters[:generation_config][:temperature] ||= parameters.delete(:temperature) if parameters[:temperature]

everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we always need to delete the parameter even if it is already defined in the generation_config. Otherwise actual payload will have additional unneeded parameters. This case already covered in the specs.

@@ -0,0 +1,25 @@
module Langchain
module Utils
class HashTransformer
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if we should've just yanked out the code out of the activesupport lib? This is fine, but I was wondering if it could be more elegant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code here is 100% genuine, not copied from ActiveSupport in any way. In fact It is GPT generated.

@andreibondarev
Copy link
Collaborator

@andreibondarev Is there anything I can do to speed up the review process here?

A few comments, otherwise -- let's ship it!

@andreibondarev
Copy link
Collaborator

@mazenkhalil Thank you! Merged.

@andreibondarev andreibondarev merged commit 4c2dad0 into patterns-ai-core:main Jun 22, 2024
5 checks passed
@mazenkhalil mazenkhalil deleted the issues/648 branch June 22, 2024 17:33
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.

Google Gemini LLM generation config problem
2 participants