This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Cody Gateway: Add support for Google non-streaming endpoint#63166
Merged
Conversation
…ctions to Gemini API - Added `Stream` field to `googleRequest` struct to enable streaming completions - Added `SymtemInstruction` field to `googleRequest` struct to allow setting system instructions - Updated `GoogleHandlerMethods.validateRequest` to allow `FeatureEmbeddings` instead of `FeatureCodeCompletions` - Updated `GoogleHandlerMethods.getRequestMetadata` to return the `Stream` field - Updated `GoogleGatewayFeatureClient.GetRequest` to handle streaming for both `FeatureCodeCompletions` and `FeatureChatCompletions` - Removed unsupported feature checks in `googleCompletionStreamClient`
23b74df to
c2c79bf
Compare
emidoots
approved these changes
Jun 11, 2024
emidoots
left a comment
Member
There was a problem hiding this comment.
Code looks great, thanks for adding tests - nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for non-stream request for Google Gemini provider
Streamfield togoogleRequeststruct to enable streaming completionsSymtemInstructionfield togoogleRequeststruct to allow setting system instructionsGoogleHandlerMethods.validateRequestto allowFeatureEmbeddingsinstead ofFeatureCodeCompletionsGoogleHandlerMethods.getRequestMetadatato return theStreamfieldGoogleGatewayFeatureClient.GetRequestto handle streaming for bothFeatureCodeCompletionsandFeatureChatCompletionsgoogleCompletionStreamClientTest plan
Unit tests updated for non-stream request.
To manually test this:
Note: You can get the accessToken for Gemini API in 1Password.
Output:
Changelog