minor gultra fix
This commit is contained in:
parent
9ab1e7d0ce
commit
6c9f302fb9
|
@ -81,7 +81,7 @@ export const validateContextSize: RequestPreprocessor = async (req) => {
|
|||
modelMax = 200000;
|
||||
} else if (model.match(/^claude-3/)) {
|
||||
modelMax = 200000;
|
||||
} else if (model.match(/^gemini-$/)) {
|
||||
} else if (model.match(/^gemini-/)) {
|
||||
modelMax = 1024000;
|
||||
} else if (model.match(/^anthropic\.claude-3/)) {
|
||||
modelMax = 200000;
|
||||
|
|
|
@ -103,13 +103,15 @@ export class GoogleAIKeyProvider implements KeyProvider<GoogleAIKey> {
|
|||
return this.keys.map((k) => Object.freeze({ ...k, key: undefined }));
|
||||
}
|
||||
|
||||
public get(_model: string) {
|
||||
const availableKeys = this.keys.filter((k) => !k.isDisabled);
|
||||
public get(model: string) {
|
||||
const neededFamily = getGoogleAIModelFamily(model);
|
||||
const availableKeys = this.keys.filter(
|
||||
(k) => !k.isDisabled && k.modelFamilies.includes(neededFamily)
|
||||
);
|
||||
if (availableKeys.length === 0) {
|
||||
throw new PaymentRequiredError("No Google AI keys available");
|
||||
}
|
||||
|
||||
// (largely copied from the OpenAI provider, without trial key support)
|
||||
// Select a key, from highest priority to lowest priority:
|
||||
// 1. Keys which are not rate limited
|
||||
// a. If all keys were rate limited recently, select the least-recently
|
||||
|
|
Loading…
Reference in New Issue