Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/llm/llms/Gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { safeParseToolCallArgs } from "../../tools/parseArgs.js";
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
import { extractBase64FromDataUrl } from "../../util/url.js";
import { BaseLLM } from "../index.js";
import { LlmApiRequestType } from "../openaiTypeConverters.js";
import {
GeminiChatContent,
GeminiChatContentPart,
Expand Down Expand Up @@ -41,6 +42,15 @@ class Gemini extends BaseLLM {
maxEmbeddingBatchSize: 100,
};

protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [
"chat",
"embed",
"list",
"rerank",
"streamChat",
"streamFim",
];

// Function to convert completion options to Gemini format
public convertArgs(options: CompletionOptions): GeminiGenerationConfig {
// should be public for use within VertexAI
Expand Down
10 changes: 10 additions & 0 deletions core/llm/llms/VertexAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js";
import { renderChatMessage, stripImages } from "../../util/messageContent.js";
import { BaseLLM } from "../index.js";

import { LlmApiRequestType } from "../openaiTypeConverters.js";
import Anthropic from "./Anthropic.js";
import Gemini from "./Gemini.js";

Expand All @@ -23,6 +24,15 @@ class VertexAI extends BaseLLM {

private clientPromise: Promise<AuthClient | void>;

protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [
"chat",
"embed",
"list",
"rerank",
"streamChat",
"streamFim",
];

/*
Vertex Supports 3 different URL formats
1. Standard VertexAI: e.g. https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent
Expand Down
Loading
Loading