Skip to content

Commit

Permalink
feat: Gemini latest GA released models (run-llama#898)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Yang <himself65@outlook.com>
  • Loading branch information
parhammmm and himself65 authored Jun 3, 2024
1 parent 3d484da commit 54230f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-chefs-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---

feat: Gemini GA release models
4 changes: 4 additions & 0 deletions packages/core/src/llm/gemini/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ export const GEMINI_MODEL_INFO_MAP: Record<GEMINI_MODEL, GeminiModelInfo> = {
// multi-modal/multi turn
[GEMINI_MODEL.GEMINI_PRO_1_5_PRO_PREVIEW]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_PRO_1_5_FLASH_PREVIEW]: { contextWindow: 10 ** 6 },
[GEMINI_MODEL.GEMINI_PRO_1_5]: { contextWindow: 2 * 10 ** 6 },
[GEMINI_MODEL.GEMINI_PRO_1_5_FLASH]: { contextWindow: 10 ** 6 },
};

const SUPPORT_TOOL_CALL_MODELS: GEMINI_MODEL[] = [
GEMINI_MODEL.GEMINI_PRO,
GEMINI_MODEL.GEMINI_PRO_VISION,
GEMINI_MODEL.GEMINI_PRO_1_5_PRO_PREVIEW,
GEMINI_MODEL.GEMINI_PRO_1_5_FLASH_PREVIEW,
GEMINI_MODEL.GEMINI_PRO_1_5,
GEMINI_MODEL.GEMINI_PRO_1_5_FLASH,
];

const DEFAULT_GEMINI_PARAMS = {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/llm/gemini/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export enum GEMINI_MODEL {
GEMINI_PRO_LATEST = "gemini-1.5-pro-latest",
GEMINI_PRO_1_5_PRO_PREVIEW = "gemini-1.5-pro-preview-0514",
GEMINI_PRO_1_5_FLASH_PREVIEW = "gemini-1.5-flash-preview-0514",
GEMINI_PRO_1_5 = "gemini-1.5-pro-001",
GEMINI_PRO_1_5_FLASH = "gemini-1.5-flash-001",
}

export interface GeminiModelInfo {
Expand Down

0 comments on commit 54230f0

Please sign in to comment.