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 response_mime_type for gemini models (allow JSON-mode output, optionally) #228

Merged
merged 11 commits into from
Jun 10, 2024

Conversation

nicsuzor
Copy link
Contributor

Minor change to optionally add response_mime_type to generation_config. Note this is a preview feature in the Vertex API available for gemini-1.5-pro: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/gemini#parameters

Fulfills #144.

@lkuligin
Copy link
Collaborator

Thanks for your contribution!

response_mime_type was already supported and passed as part as kwargs:

if you feel like we should also allow to setup its default value during model initialization, I'd suggest to redefine the _default_params property (by adding response_mime_type to super()._default_params).

So that similar things are defined at similar place, and the logic not being spread all over the code base. WDYT?

@nicsuzor
Copy link
Contributor Author

if you feel like we should also allow to setup its default value during model initialization, I'd suggest to redefine the _default_params property (by adding response_mime_type to super()._default_params).

So that similar things are defined at similar place, and the logic not being spread all over the code base. WDYT?

Sure thing, I've updated that now.

@lkuligin
Copy link
Collaborator

lkuligin commented Jun 6, 2024

@nicsuzor could you finalize it, please?

@nicsuzor
Copy link
Contributor Author

nicsuzor commented Jun 7, 2024

@lkuligin Yup, edited accordingly.

@lkuligin
Copy link
Collaborator

lkuligin commented Jun 8, 2024

/gcbrun

@lkuligin
Copy link
Collaborator

/gcbrun

@lkuligin
Copy link
Collaborator

/gcbrun

@lkuligin lkuligin merged commit dbd1f55 into langchain-ai:main Jun 10, 2024
15 checks passed
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