Cody Gateway: Add Gemini models to PLG and Enterprise users#63053
Conversation
* Add support for Google Generative AI as a completions provider * Add new `google` package to handle Google Generative AI client * Update `client.go` and `codygateway.go` to handle the new Google provider * Set default models for chat, fast chat, and completions when Google is the configured provider
| - A feature flag for Cody, `completions.smartContextWindow` is added and set to "enabled" by default. It allows clients to adjust the context window based on the name of the chat model. When smartContextWindow is enabled, the `completions.chatModelMaxTokens` value is ignored. ([#62802](https://github.com/sourcegraph/sourcegraph/pull/62802)) | ||
| - Code Insights: When facing the "incomplete datapoints" warning, you can now use GraphQL to discover which repositories had problems. The schemas for `TimeoutDatapointAlert` and `GenericIncompleteDatapointAlert` now contain an additional `repositories` field. ([#62756](https://github.com/sourcegraph/sourcegraph/pull/62756)). | ||
| - Users will now be presented with a modal that reminds them to connect any external code host accounts that's required for permissions. Without these accounts connected, users may be unable to view repositories that they otherwise have access to. [#62983](https://github.com/sourcegraph/sourcegraph/pull/62983) | ||
| - Added support for Google as an LLM provider for Cody, with the following models available through Cody Gateway: Gemini Pro (`gemini-pro-latest`), Gemini 1.5 Flash (`gemini-1.5-flash-latest`), and Gemini 1.5 Pro (`gemini-1.5-pro-latest`). [#63053](https://github.com/sourcegraph/sourcegraph/pull/63053) |
There was a problem hiding this comment.
Is this something we still do manually? Doesn't the "# Changelog" section of the PR take care of it?
There was a problem hiding this comment.
It was a genuine question. 😄 I saw the template in the PR, so I've started using it, but never checked whether some automated or manual process actually added my changes to the changelog. Right now I'm just blindly relying on the assumption that some process will take care of it.
vdavid
left a comment
There was a problem hiding this comment.
I went through all files in detail, and TBH, it just LGTM. Saw the test coverage where there was significant logic, and that you ran this code and worked for you, so I don't have anything to add, it looks good. Great job, Bee! :)
chrsmith
left a comment
There was a problem hiding this comment.
Some nit picks and suggestions for cleanup, but this all looks good to me! ![]()
|
|
CLOSE https://github.com/sourcegraph/cody-issues/issues/211 & https://github.com/sourcegraph/cody-issues/issues/412 & https://github.com/sourcegraph/cody-issues/issues/412
UNBLOCK https://github.com/sourcegraph/cody/pull/4360
googlepackage to handle Google Generative AI clientclient.goandcodygateway.goto handle the new Google providerTest plan
For Enterprise instances using google as provider:
Note: You can get the accessToken for Gemini API in 1Password.
Verified locally:
Before
Cody Gateway returns
no client known for upstream provider googleChangelog
Added support for Google as an LLM provider for Cody, with the following models available through Cody Gateway: Gemini Pro (
gemini-pro-latest), Gemini 1.5 Flash (gemini-1.5-flash-latest), and Gemini 1.5 Pro (gemini-1.5-pro-latest).