mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:31:43 +00:00
fix(cody-gateway): Disable flagging Google requests (#63295)
- Fixes https://github.com/sourcegraph/sourcegraph/issues/63294 This PR turns off flagging for all Google models entirely. ## Test plan Not tested yet.
This commit is contained in:
parent
8c83b5f55b
commit
7452324ea5
@ -77,16 +77,9 @@ func (*GoogleHandlerMethods) validateRequest(_ context.Context, _ log.Logger, fe
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *GoogleHandlerMethods) shouldFlagRequest(_ context.Context, _ log.Logger, req googleRequest) (*flaggingResult, error) {
|
||||
result, err := isFlaggedRequest(
|
||||
nil, // tokenizer, meaning token counts aren't considered when for flagging consideration.
|
||||
flaggingRequest{
|
||||
ModelName: req.Model,
|
||||
FlattenedPrompt: req.BuildPrompt(),
|
||||
MaxTokens: int(req.GenerationConfig.MaxOutputTokens),
|
||||
},
|
||||
makeFlaggingConfig(g.config.FlaggingConfig))
|
||||
return result, err
|
||||
func (g *GoogleHandlerMethods) shouldFlagRequest(_ context.Context, _ log.Logger, _ googleRequest) (*flaggingResult, error) {
|
||||
// This entirely disables flagging for Google.
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Used to modify the request body before it is sent to upstream.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user