Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(playground+evals): add gemini and vertex support (#4485)

Hassieb Pakzad82e5f1a9328a
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 30cf42e4b9..7ae0efe954 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -64,6 +64,7 @@
"@langchain/anthropic": "^0.3.8",
"@langchain/aws": "^0.1.2",
"@langchain/core": "^0.3.18",
+ "@langchain/google-vertexai": "^0.1.3",
"@langchain/openai": "^0.3.14",
"@opentelemetry/api": ">=1.0.0 <1.10.0",
"@prisma/client": "^5.22.0",
diff --git a/packages/shared/src/interfaces/customLLMProviderConfigSchemas.ts b/packages/shared/src/interfaces/customLLMProviderConfigSchemas.ts
index deaa9607e3..cd5df67b53 100644
--- a/packages/shared/src/interfaces/customLLMProviderConfigSchemas.ts
+++ b/packages/shared/src/interfaces/customLLMProviderConfigSchemas.ts
@@ -10,3 +10,19 @@ export const BedrockCredentialSchema = z
})
.optional();
export type BedrockCredential = z.infer<typeof BedrockCredentialSchema>;
+
+export const GCPServiceAccountKeySchema = z.object({
+ type: z.literal("service_account"),
+ project_id: z.string(),
+ private_key_id: z.string(),
+ private_key: z.string(),
+ client_email: z.string(),
+ client_id: z.string(),
+ auth_uri: z.string(),
+ token_uri: z.string(),
+ auth_provider_x509_cert_url: z.string(),
+ client_x509_cert_url: z.string(),
+});
+
+export type GCPServiceAccountKey = z.infer<typeof GCPServiceAccountKeySchema>;
+export default GCPServiceAccountKeySchema;
diff --git a/packages/shared/src/server/llm/fetchLLMCompletion.ts b/packages/shared/src/server/llm/fetchLLMCompletion.ts
index 5387e2f6a1..989e27d9a3 100644
--- a/packages/shared/src/server/llm/fetchLLMCompletion.ts
+++ b/packages/shared/src/server/llm/fetchLLMCompletion.ts
@@ -3,6 +3,7 @@ import type { ZodSchema } from "zod";
import { CallbackHandler } from "langfuse-langchain";
import { ChatAnthropic } from "@langchain/anthropic";
+import { ChatVertexAI } from "@langchain/google-vertexai";
import { ChatBedrockConverse } from "@langchain/aws";
import {
AIMessage,
@@ -15,7 +16,7 @@ import {
} from "@langchain/core/output_parsers";
import { IterableReadableStream } from "@langchain/core/utils/stream";
import { ChatOpenAI } from "@langchain/openai";
-import {
+import GCPServiceAccountKeySchema, {
BedrockConfigSchema,
BedrockCredentialSchema,
} from "../../interfaces/customLLMProviderConfigSchemas";
@@ -139,7 +140,11 @@ export async function fetchLLMCompletion(
return new AIMessage(message.content);
});
- let chatModel: ChatOpenAI | ChatAnthropic | ChatBedrockConverse;
+ let chatModel:
+ | ChatOpenAI
+ | ChatAnthropic
+ | ChatBedrockConverse
+ | ChatVertexAI;
if (modelParams.adapter === LLMAdapter.Anthropic) {
chatModel = new ChatAnthropic({
anthropicApiKey: apiKey,
@@ -191,6 +196,21 @@ export async function fetchLLMCompletion(
callbacks: finalCallbacks,
maxRetries,
});
+ } else if (modelParams.adapter === LLMAdapter.VertexAI) {
+ const credentials = GCPServiceAccountKeySchema.parse(JSON.parse(apiKey));
+
+ chatModel = new ChatVertexAI({
+ modelName: modelParams.model,
+ temperature: modelParams.temperature,
+ maxOutputTokens: modelParams.max_tokens,
+ topP: modelParams.top_p,
+ callbacks: finalCallbacks,
+ maxRetries,
+ authOptions: {
+ projectId: credentials.project_id,
+ credentials,
+ },
+ });
} else {
// eslint-disable-next-line no-unused-vars
const _exhaustiveCheck: never = modelParams.adapter;
diff --git a/packages/shared/src/server/llm/types.ts b/packages/shared/src/server/llm/types.ts
index e0157648d3..7c570b3312 100644
--- a/packages/shared/src/server/llm/types.ts
+++ b/packages/shared/src/server/llm/types.ts
@@ -16,6 +16,7 @@ export enum LLMAdapter {
OpenAI = "openai",
Azure = "azure",
Bedrock = "bedrock",
+ VertexAI = "vertex-ai",
}
export enum ChatMessageRole {
@@ -114,10 +115,18 @@ export const anthropicModels = [
"claude-instant-1.2",
] as const;
+export const vertexAIModels = [
+ "gemini-1.5-pro",
+ "gemini-1.5-flash",
+ "gemini-1.0-pro",
+] as const;
+
export type AnthropicModel = (typeof anthropicModels)[number];
+export type VertexAIModel = (typeof vertexAIModels)[number];
export const supportedModels = {
[LLMAdapter.Anthropic]: anthropicModels,
[LLMAdapter.OpenAI]: openAIModels,
+ [LLMAdapter.VertexAI]: vertexAIModels,
[LLMAdapter.Azure]: [],
[LLMAdapter.Bedrock]: [],
} as const;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ae45dbdbe9..9711451d84 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -101,7 +101,7 @@ importers:
'@vercel/style-guide':
specifier: ^6.0.0
eslint-config-next:
specifier: ^14.2.15
@@ -152,6 +152,9 @@ importers:
'@langchain/core':
specifier: ^0.3.18
+ '@langchain/google-vertexai':
+ specifier: ^0.1.3
'@langchain/openai':
specifier: ^0.3.14
@@ -199,10 +202,10 @@ importers:
version: 0.27.4
langchain:
specifier: ^0.3.6
langfuse-langchain:
specifier: 3.30.3
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -578,7 +581,7 @@ importers:
version: 0.27.4
langchain:
specifier: ^0.3.6
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -694,7 +697,7 @@ importers:
'@testing-library/jest-dom':
specifier: ^6.4.6
'@testing-library/react':
specifier: ^15.0.7
@@ -2391,6 +2394,24 @@ packages:
resolution: {integrity: sha512-IEZCrFs1Xd0J2FTH1D3Lnm3/Yk2r8LSpwDeLYwcCom3rNAK5k4mKQ2rwIpNq3YuqBdrTNMKRO+PopjkP1SB17A==}
engines: {node: '>=18'}
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-yry0taVC5AUwn55Gc6PTQX2XHLfbh6PAOheatkB77u22bYzLNaKG+DGQR8CRVRS9oZEXuNpXyAV7X2+2wv1w6Q==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.21 <0.4.0'
+
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-/FfF/5KNP78gUHLMhyqI9kMlYy7v+uyRddjx0lsiTOGWTZeFhhemmYw4Vbb8ltUSgfyx7/c9M8GryxY9vW5pqA==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.21 <0.4.0'
+
+ '@langchain/[email protected]':
+ resolution: {integrity: sha512-AOvojzPiKKv1gZiH9tBYPBcZ3nOCuQAQsh4a/djYmlwjcA5bIb/teOa9eFZVTB83L2eM1U5steZF4nwQHnIIvw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@langchain/core': '>=0.2.21 <0.4.0'
+
'@langchain/[email protected]':
resolution: {integrity: sha512-lNWjUo1tbvsss45IF7UQtMu1NJ6oUKvhgPYWXnX9f/d6OmuLu7D99HQ3Y88vLcUo9XjjOy417olYHignMduMjA==}
engines: {node: '>=18'}
@@ -5518,6 +5539,10 @@ packages:
resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
engines: {node: '>=12'}
@@ -5619,6 +5644,9 @@ packages:
resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==}
+ resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==}
+
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
@@ -5668,6 +5696,9 @@ packages:
resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
+ resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==}
+
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
@@ -6616,6 +6647,9 @@ packages:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
+ resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==}
+
resolution: {integrity: sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==}
engines: {node: '>=14'}
@@ -7098,6 +7132,9 @@ packages:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+ resolution: {integrity: sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==}
+
resolution: {integrity: sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==}
hasBin: true
@@ -7278,6 +7315,14 @@ packages:
resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
+ resolution: {integrity: sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
engines: {node: '>=6.9.0'}
@@ -7411,6 +7456,16 @@ packages:
resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==}
engines: {node: '>=18'}
+ resolution: {integrity: sha512-f7aQCJODJFmYWN6PeNKzgvy9LI2tYmXnzpNDHEjG5sDNPgGb2FXQyTBnXeSH+PAtpKESFD+LmHw3Ox3mN7e1Fg==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ==}
+ engines: {node: '>=12.0.0'}
+ deprecated: Package is no longer maintained
+ hasBin: true
+
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
@@ -7435,6 +7490,10 @@ packages:
resolution: {integrity: sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==}
engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
+ resolution: {integrity: sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ==}
+ engines: {node: '>=12.0.0'}
+
resolution: {integrity: sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==}
@@ -8206,6 +8265,9 @@ packages:
engines: {node: '>=6'}
hasBin: true
+ resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==}
+
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
@@ -8251,6 +8313,12 @@ packages:
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
engines: {node: '>=4.0'}
+ resolution: {integrity: sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==}
+
+ resolution: {integrity: sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==}
+
resolution: {integrity: sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==}
hasBin: true
@@ -9027,6 +9095,10 @@ packages:
resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+ resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==}
+ engines: {node: '>= 6.13.0'}
+
resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==}
hasBin: true
@@ -12278,14 +12350,15 @@ snapshots:
- '@aws-sdk/client-sso-oidc'
- aws-crt
+ '@aws-sdk/[email protected](@aws-sdk/[email protected])':
dependencies:
+ '@aws-sdk/client-sts': 3.675.0
+ '@aws-sdk/core': 3.667.0
'@aws-sdk/credential-provider-env': 3.667.0
'@aws-sdk/credential-provider-http': 3.667.0
- '@aws-sdk/credential-provider-ini': 3.668.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])
'@aws-sdk/credential-provider-process': 3.667.0
- '@aws-sdk/credential-provider-sso': 3.668.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))
- '@aws-sdk/credential-provider-web-identity': 3.667.0(@aws-sdk/[email protected])
+ '@aws-sdk/credential-provider-sso': 3.675.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))
+ '@aws-sdk/credential-provider-web-identity': 3.667.0(@aws-sdk/[email protected])
'@aws-sdk/types': 3.667.0
'@smithy/credential-provider-imds': 3.2.4
'@smithy/property-provider': 3.1.7
@@ -12294,16 +12367,16 @@ snapshots:
tslib: 2.6.3
transitivePeerDependencies:
- '@aws-sdk/client-sso-oidc'
- - '@aws-sdk/client-sts'
- aws-crt
+ optional: true
- '@aws-sdk/[email protected]':
dependencies:
'@aws-sdk/credential-provider-env': 3.667.0
'@aws-sdk/credential-provider-http': 3.667.0
- '@aws-sdk/credential-provider-ini': 3.675.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])
+ '@aws-sdk/credential-provider-ini': 3.668.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])
'@aws-sdk/credential-provider-process': 3.667.0
- '@aws-sdk/credential-provider-sso': 3.675.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))
+ '@aws-sdk/credential-provider-sso': 3.668.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))
'@aws-sdk/credential-provider-web-identity': 3.667.0(@aws-sdk/[email protected])
'@aws-sdk/types': 3.667.0
'@smithy/credential-provider-imds': 3.2.4
@@ -12315,7 +12388,6 @@ snapshots:
- '@aws-sdk/client-sso-oidc'
- '@aws-sdk/client-sts'
- aws-crt
- optional: true
dependencies:
@@ -12355,6 +12427,26 @@ snapshots:
- '@aws-sdk/client-sts'
- aws-crt
+ '@aws-sdk/[email protected](@aws-sdk/[email protected])':
+ dependencies:
+ '@aws-sdk/credential-provider-env': 3.667.0
+ '@aws-sdk/credential-provider-http': 3.667.0
+ '@aws-sdk/credential-provider-ini': 3.675.0(@aws-sdk/[email protected])
+ '@aws-sdk/credential-provider-process': 3.667.0
+ '@aws-sdk/credential-provider-sso': 3.675.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))
+ '@aws-sdk/credential-provider-web-identity': 3.667.0(@aws-sdk/[email protected])
+ '@aws-sdk/types': 3.667.0
+ '@smithy/credential-provider-imds': 3.2.4
+ '@smithy/property-provider': 3.1.7
+ '@smithy/shared-ini-file-loader': 3.1.8
+ '@smithy/types': 3.5.0
+ tslib: 2.6.3
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - '@aws-sdk/client-sts'
+ - aws-crt
+ optional: true
+
'@aws-sdk/[email protected]':
dependencies:
'@aws-sdk/core': 3.667.0
@@ -13651,12 +13743,41 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.1.0(@types/[email protected])
+ '@inquirer/type': 3.0.1(@types/[email protected])
+ '@types/node': 20.10.5
+ optional: true
+
dependencies:
'@inquirer/core': 10.1.0(@types/[email protected])
'@inquirer/type': 3.0.1(@types/[email protected])
'@types/node': 20.11.29
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/core': 10.1.0(@types/[email protected])
+ '@inquirer/type': 3.0.1(@types/[email protected])
+ '@types/node': 20.14.8
+ optional: true
+
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/figures': 1.0.8
+ '@inquirer/type': 3.0.1(@types/[email protected])
+ ansi-escapes: 4.3.2
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ strip-ansi: 6.0.1
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.2
+ transitivePeerDependencies:
+ - '@types/node'
+ optional: true
+
dependencies:
'@inquirer/figures': 1.0.8
@@ -13671,14 +13792,39 @@ snapshots:
transitivePeerDependencies:
- '@types/node'
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@inquirer/figures': 1.0.8
+ '@inquirer/type': 3.0.1(@types/[email protected])
+ ansi-escapes: 4.3.2
+ cli-width: 4.1.0
+ mute-stream: 2.0.0
+ signal-exit: 4.1.0
+ strip-ansi: 6.0.1
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.2
+ transitivePeerDependencies:
+ - '@types/node'
+ optional: true
+
'@inquirer/[email protected]': {}
'@inquirer/[email protected]': {}
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@types/node': 20.10.5
+ optional: true
+
dependencies:
'@types/node': 20.11.29
+ '@inquirer/[email protected](@types/[email protected])':
+ dependencies:
+ '@types/node': 20.14.8
+ optional: true
+
'@ioredis/[email protected]': {}
'@isaacs/[email protected]':
@@ -13711,42 +13857,6 @@ snapshots:
jest-util: 29.7.0
slash: 3.0.0
- dependencies:
- '@jest/console': 29.7.0
- '@jest/reporters': 29.7.0
- '@jest/test-result': 29.7.0
- '@jest/transform': 29.7.0
- '@jest/types': 29.6.3
- '@types/node': 20.14.8
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- ci-info: 3.9.0
- exit: 0.1.2
- graceful-fs: 4.2.11
- jest-changed-files: 29.7.0
- jest-config: 29.7.0(@types/[email protected])
- jest-haste-map: 29.7.0
- jest-message-util: 29.7.0
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-resolve-dependencies: 29.7.0
- jest-runner: 29.7.0
- jest-runtime: 29.7.0
- jest-snapshot: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- jest-watcher: 29.7.0
- micromatch: 4.0.8
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-ansi: 6.0.1
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
- - ts-node
- optional: true
-
dependencies:
'@jest/console': 29.7.0
@@ -13961,12 +14071,12 @@ snapshots:
- '@aws-sdk/client-sts'
- aws-crt
dependencies:
'@aws-sdk/client-bedrock-agent-runtime': 3.668.0
'@aws-sdk/client-bedrock-runtime': 3.668.0
'@aws-sdk/client-kendra': 3.668.0
- '@aws-sdk/credential-provider-node': 3.675.0
+ '@aws-sdk/credential-provider-node': 3.675.0(@aws-sdk/[email protected])
'@langchain/core': 0.3.18([email protected]([email protected]))
zod: 3.23.8
zod-to-json-schema: 3.23.5([email protected])
@@ -13992,6 +14102,33 @@ snapshots:
transitivePeerDependencies:
- openai
+ dependencies:
+ '@langchain/core': 0.3.18([email protected]([email protected]))
+ uuid: 10.0.0
+ zod-to-json-schema: 3.23.5([email protected])
+ transitivePeerDependencies:
+ - zod
+
+ dependencies:
+ '@langchain/core': 0.3.18([email protected]([email protected]))
+ '@langchain/google-common': 0.1.3(@langchain/[email protected]([email protected]([email protected])))([email protected])
+ google-auth-library: 8.9.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ - zod
+
+ dependencies:
+ '@langchain/core': 0.3.18([email protected]([email protected]))
+ '@langchain/google-gauth': 0.1.3(@langchain/[email protected]([email protected]([email protected])))([email protected])
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+ - zod
+
dependencies:
'@langchain/core': 0.3.18([email protected]([email protected]))
@@ -16664,7 +16801,7 @@ snapshots:
lz-string: 1.5.0
pretty-format: 27.5.1
dependencies:
'@adobe/css-tools': 4.4.0
'@babel/runtime': 7.24.7
@@ -16678,7 +16815,7 @@ snapshots:
'@jest/globals': 29.7.0
'@types/jest': 29.5.12
- vitest: 2.1.2(@types/[email protected])
dependencies:
@@ -17328,7 +17465,7 @@ snapshots:
'@ungap/[email protected]': {}
dependencies:
'@babel/core': 7.24.3
'@babel/eslint-parser': 7.24.1(@babel/[email protected])([email protected])
@@ -17336,19 +17473,19 @@ snapshots:
'@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser': 7.12.0([email protected])([email protected])
eslint-config-prettier: 9.1.0([email protected])
+ eslint-import-resolver-alias: 1.1.2([email protected])
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
eslint-plugin-eslint-comments: 3.2.0([email protected])
eslint-plugin-jsx-a11y: 6.8.0([email protected])
eslint-plugin-react: 7.34.1([email protected])
eslint-plugin-react-hooks: 4.6.0([email protected])
eslint-plugin-testing-library: 6.2.0([email protected])([email protected])
eslint-plugin-tsdoc: 0.2.17
eslint-plugin-unicorn: 51.0.1([email protected])
prettier-plugin-packagejson: 2.4.12([email protected])
optionalDependencies:
'@next/eslint-plugin-next': 14.2.15
@@ -17369,6 +17506,16 @@ snapshots:
chai: 5.1.1
tinyrainbow: 1.2.0
+ dependencies:
+ '@vitest/spy': 2.1.2
+ estree-walker: 3.0.3
+ magic-string: 0.30.11
+ optionalDependencies:
+ vite: 5.2.14(@types/[email protected])([email protected])
+ optional: true
+
dependencies:
'@vitest/spy': 2.1.2
@@ -17378,13 +17525,14 @@ snapshots:
vite: 5.2.14(@types/[email protected])([email protected])
dependencies:
'@vitest/spy': 2.1.2
estree-walker: 3.0.3
magic-string: 0.30.11
optionalDependencies:
- vite: 5.2.14(@types/[email protected])
+ vite: 5.2.14(@types/[email protected])([email protected])
optional: true
'@vitest/[email protected]':
@@ -17812,6 +17960,8 @@ snapshots:
is-array-buffer: 3.0.4
is-shared-array-buffer: 1.0.3
+
@@ -17935,6 +18085,8 @@ snapshots:
+
@@ -18013,6 +18165,8 @@ snapshots:
+
@@ -18432,13 +18586,13 @@ snapshots:
crc-32: 1.2.2
readable-stream: 3.6.2
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
- jest-config: 29.7.0(@types/[email protected])
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@@ -18446,15 +18600,14 @@ snapshots:
- babel-plugin-macros
- supports-color
- ts-node
- optional: true
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@@ -18462,6 +18615,7 @@ snapshots:
- babel-plugin-macros
- supports-color
- ts-node
+ optional: true
@@ -18990,6 +19144,10 @@ snapshots:
+ dependencies:
+ safe-buffer: 5.2.1
+
dependencies:
'@one-ini/wasm': 0.1.1
@@ -19233,7 +19391,7 @@ snapshots:
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.8.0([email protected])
eslint-plugin-react: 7.34.1([email protected])
eslint-plugin-react-hooks: 4.6.0([email protected])
@@ -19250,7 +19408,7 @@ snapshots:
dependencies:
eslint: 8.57.0
- eslint-plugin-import: 2.29.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])
eslint-plugin-n: 16.6.2([email protected])
eslint-plugin-promise: 6.4.0([email protected])
@@ -19259,9 +19417,9 @@ snapshots:
eslint: 8.57.0
eslint-plugin-turbo: 1.13.4([email protected])
dependencies:
dependencies:
@@ -19276,8 +19434,8 @@ snapshots:
debug: 4.3.7([email protected])
enhanced-resolve: 5.17.1
eslint: 8.57.0
fast-glob: 3.3.2
get-tsconfig: 4.8.1
is-core-module: 2.15.1
@@ -19294,7 +19452,7 @@ snapshots:
enhanced-resolve: 5.17.1
eslint: 8.57.0
fast-glob: 3.3.2
get-tsconfig: 4.8.1
is-core-module: 2.15.1
@@ -19305,25 +19463,25 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 7.12.0([email protected])([email protected])
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 7.12.0([email protected])([email protected])
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
@@ -19340,7 +19498,7 @@ snapshots:
eslint: 8.57.0
ignore: 5.3.1
dependencies:
array-includes: 3.1.7
array.prototype.findlastindex: 1.2.4
@@ -19367,40 +19525,13 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
- dependencies:
- array-includes: 3.1.7
- array.prototype.findlastindex: 1.2.4
- array.prototype.flat: 1.3.2
- array.prototype.flatmap: 1.3.2
- debug: 3.2.7
- doctrine: 2.1.0
- eslint: 8.57.0
- eslint-import-resolver-node: 0.3.9
- hasown: 2.0.2
- is-core-module: 2.15.1
- is-glob: 4.0.3
- minimatch: 3.1.2
- object.fromentries: 2.0.8
- object.groupby: 1.0.3
- object.values: 1.2.0
- semver: 6.3.1
- tsconfig-paths: 3.15.0
- optionalDependencies:
- '@typescript-eslint/parser': 7.12.0([email protected])([email protected])
- transitivePeerDependencies:
- - eslint-import-resolver-typescript
- - eslint-import-resolver-webpack
- - supports-color
-
dependencies:
'@typescript-eslint/utils': 5.62.0([email protected])([email protected])
eslint: 8.57.0
optionalDependencies:
'@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
- jest: 29.7.0
+ jest: 29.7.0(@types/[email protected])([email protected])
transitivePeerDependencies:
- supports-color
- typescript
@@ -19442,12 +19573,12 @@ snapshots:
dependencies:
eslint: 8.57.0
globals: 13.24.0
optionalDependencies:
dependencies:
@@ -19529,13 +19660,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@typescript-eslint/utils': 7.3.1([email protected])([email protected])
eslint: 8.57.0
optionalDependencies:
'@typescript-eslint/eslint-plugin': 7.3.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
transitivePeerDependencies:
- supports-color
- typescript
@@ -19759,6 +19890,8 @@ snapshots:
+
dependencies:
strnum: 1.0.5
@@ -19930,6 +20063,24 @@ snapshots:
+ dependencies:
+ extend: 3.0.2
+ https-proxy-agent: 5.0.1
+ is-stream: 2.0.1
+ node-fetch: 2.7.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+
+ dependencies:
+ gaxios: 5.1.3
+ json-bigint: 1.0.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+
@@ -20098,6 +20249,25 @@ snapshots:
slash: 5.1.0
unicorn-magic: 0.1.0
+ dependencies:
+ arrify: 2.0.1
+ base64-js: 1.5.1
+ ecdsa-sig-formatter: 1.0.11
+ fast-text-encoding: 1.0.6
+ gaxios: 5.1.3
+ gcp-metadata: 5.3.0
+ gtoken: 6.1.2
+ jws: 4.0.0
+ lru-cache: 6.0.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+
+ dependencies:
+ node-forge: 1.3.1
+
dependencies:
get-intrinsic: 1.2.4
@@ -20138,6 +20308,15 @@ snapshots:
+ dependencies:
+ gaxios: 5.1.3
+ google-p12-pem: 4.0.1
+ jws: 4.0.0
+ transitivePeerDependencies:
+ - encoding
+ - supports-color
+
@@ -20759,16 +20938,16 @@ snapshots:
- babel-plugin-macros
- supports-color
dependencies:
- '@jest/core': 29.7.0
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
- create-jest: 29.7.0
exit: 0.1.2
import-local: 3.1.0
- jest-config: 29.7.0(@types/[email protected])
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@@ -20777,18 +20956,17 @@ snapshots:
- babel-plugin-macros
- supports-color
- ts-node
- optional: true
dependencies:
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
+ create-jest: 29.7.0(@types/[email protected])([email protected])
exit: 0.1.2
import-local: 3.1.0
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@@ -20797,6 +20975,7 @@ snapshots:
- babel-plugin-macros
- supports-color
- ts-node
+ optional: true
dependencies:
@@ -20829,37 +21008,6 @@ snapshots:
- babel-plugin-macros
- supports-color
- dependencies:
- '@babel/core': 7.24.3
- '@jest/test-sequencer': 29.7.0
- '@jest/types': 29.6.3
- babel-jest: 29.7.0(@babel/[email protected])
- chalk: 4.1.2
- ci-info: 3.9.0
- deepmerge: 4.3.1
- glob: 7.2.3
- graceful-fs: 4.2.11
- jest-circus: 29.7.0([email protected])
- jest-environment-node: 29.7.0
- jest-get-type: 29.6.3
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-runner: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- micromatch: 4.0.8
- parse-json: 5.2.0
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-json-comments: 3.1.1
- optionalDependencies:
- '@types/node': 20.14.8
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
- optional: true
-
dependencies:
'@babel/core': 7.24.3
@@ -21127,30 +21275,30 @@ snapshots:
merge-stream: 2.0.0
supports-color: 8.1.1
dependencies:
- '@jest/core': 29.7.0
'@jest/types': 29.6.3
import-local: 3.1.0
- jest-cli: 29.7.0
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
- supports-color
- ts-node
- optional: true
dependencies:
'@jest/types': 29.6.3
import-local: 3.1.0
+ jest-cli: 29.7.0(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
- supports-color
- ts-node
+ optional: true
@@ -21226,6 +21374,10 @@ snapshots:
+ dependencies:
+ bignumber.js: 9.1.2
+
@@ -21269,6 +21421,17 @@ snapshots:
object.assign: 4.1.5
object.values: 1.2.0
+ dependencies:
+ buffer-equal-constant-time: 1.0.1
+ ecdsa-sig-formatter: 1.0.11
+ safe-buffer: 5.2.1
+
+ dependencies:
+ jwa: 2.0.0
+ safe-buffer: 5.2.1
+
dependencies:
commander: 8.3.0
@@ -21304,7 +21467,7 @@ snapshots:
dependencies:
'@langchain/core': 0.3.18([email protected]([email protected]))
'@langchain/openai': 0.3.14(@langchain/[email protected]([email protected]([email protected])))
@@ -21322,13 +21485,14 @@ snapshots:
optionalDependencies:
'@langchain/anthropic': 0.3.8(@langchain/[email protected]([email protected]([email protected])))
'@langchain/aws': 0.1.2(@aws-sdk/[email protected](@aws-sdk/[email protected]))(@aws-sdk/[email protected])(@langchain/[email protected]([email protected]([email protected])))
+ '@langchain/google-vertexai': 0.1.3(@langchain/[email protected]([email protected]([email protected])))([email protected])
axios: 1.7.7
handlebars: 4.7.8
transitivePeerDependencies:
- encoding
- openai
dependencies:
'@langchain/core': 0.3.18([email protected]([email protected]))
'@langchain/openai': 0.3.14(@langchain/[email protected]([email protected]([email protected])))
@@ -21345,7 +21509,8 @@ snapshots:
zod-to-json-schema: 3.23.5([email protected])
optionalDependencies:
'@langchain/anthropic': 0.3.8(@langchain/[email protected]([email protected]([email protected])))
- '@langchain/aws': 0.1.2(@langchain/[email protected]([email protected]([email protected])))
+ '@langchain/aws': 0.1.2(@aws-sdk/[email protected])(@langchain/[email protected]([email protected]([email protected])))
+ '@langchain/google-vertexai': 0.1.3(@langchain/[email protected]([email protected]([email protected])))([email protected])
axios: 1.7.7
handlebars: 4.7.8
transitivePeerDependencies:
@@ -21356,9 +21521,9 @@ snapshots:
dependencies:
mustache: 4.2.0
dependencies:
langfuse: 3.30.3
langfuse-core: 3.30.3
@@ -22073,6 +22238,32 @@ snapshots:
optionalDependencies:
msgpackr-extract: 3.0.3
+ dependencies:
+ '@bundled-es-modules/cookie': 2.0.1
+ '@bundled-es-modules/statuses': 1.0.1
+ '@bundled-es-modules/tough-cookie': 0.1.6
+ '@inquirer/confirm': 5.0.2(@types/[email protected])
+ '@mswjs/interceptors': 0.37.1
+ '@open-draft/deferred-promise': 2.2.0
+ '@open-draft/until': 2.1.0
+ '@types/cookie': 0.6.0
+ '@types/statuses': 2.0.5
+ chalk: 4.1.2
+ graphql: 16.9.0
+ headers-polyfill: 4.0.3
+ is-node-process: 1.2.0
+ outvariant: 1.4.3
+ path-to-regexp: 6.3.0
+ strict-event-emitter: 0.5.1
+ type-fest: 4.27.0
+ yargs: 17.7.2
+ optionalDependencies:
+ typescript: 5.4.5
+ transitivePeerDependencies:
+ - '@types/node'
+ optional: true
+
dependencies:
'@bundled-es-modules/cookie': 2.0.1
@@ -22098,6 +22289,32 @@ snapshots:
transitivePeerDependencies:
- '@types/node'
+ dependencies:
+ '@bundled-es-modules/cookie': 2.0.1
+ '@bundled-es-modules/statuses': 1.0.1
+ '@bundled-es-modules/tough-cookie': 0.1.6
+ '@inquirer/confirm': 5.0.2(@types/[email protected])
+ '@mswjs/interceptors': 0.37.1
+ '@open-draft/deferred-promise': 2.2.0
+ '@open-draft/until': 2.1.0
+ '@types/cookie': 0.6.0
+ '@types/statuses': 2.0.5
+ chalk: 4.1.2
+ graphql: 16.9.0
+ headers-polyfill: 4.0.3
+ is-node-process: 1.2.0
+ outvariant: 1.4.3
+ path-to-regexp: 6.3.0
+ strict-event-emitter: 0.5.1
+ type-fest: 4.27.0
+ yargs: 17.7.2
+ optionalDependencies:
+ typescript: 5.4.5
+ transitivePeerDependencies:
+ - '@types/node'
+ optional: true
+
@@ -22210,6 +22427,8 @@ snapshots:
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
+
dependencies:
detect-libc: 2.0.3
@@ -24550,12 +24769,12 @@ snapshots:
d3-time: 3.1.0
d3-timer: 3.0.1
dependencies:
cac: 6.7.14
debug: 4.3.7([email protected])
pathe: 1.1.2
- vite: 5.2.14(@types/[email protected])
+ vite: 5.2.14(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@types/node'
- less
@@ -24583,7 +24802,24 @@ snapshots:
- supports-color
- terser
+ dependencies:
+ cac: 6.7.14
+ debug: 4.3.7([email protected])
+ pathe: 1.1.2
+ vite: 5.2.14(@types/[email protected])([email protected])
+ transitivePeerDependencies:
+ - '@types/node'
+ - less
+ - lightningcss
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ optional: true
+
dependencies:
esbuild: 0.20.2
postcss: 8.4.47
@@ -24591,6 +24827,7 @@ snapshots:
optionalDependencies:
'@types/node': 20.10.5
fsevents: 2.3.3
+ terser: 5.36.0
optional: true
@@ -24603,10 +24840,21 @@ snapshots:
fsevents: 2.3.3
terser: 5.36.0
+ dependencies:
+ esbuild: 0.20.2
+ postcss: 8.4.47
+ rollup: 4.13.0
+ optionalDependencies:
+ '@types/node': 20.14.8
+ fsevents: 2.3.3
+ terser: 5.36.0
+ optional: true
+
dependencies:
'@vitest/expect': 2.1.2
- '@vitest/mocker': 2.1.2(@vitest/[email protected])([email protected](@types/[email protected]))
'@vitest/pretty-format': 2.1.2
'@vitest/runner': 2.1.2
'@vitest/snapshot': 2.1.2
@@ -24621,11 +24869,12 @@ snapshots:
tinyexec: 0.3.0
tinypool: 1.0.1
tinyrainbow: 1.2.0
- vite: 5.2.14(@types/[email protected])
- vite-node: 2.1.2(@types/[email protected])
+ vite: 5.2.14(@types/[email protected])([email protected])
+ vite-node: 2.1.2(@types/[email protected])([email protected])
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 20.10.5
+ jsdom: 20.0.3
transitivePeerDependencies:
- less
- lightningcss
@@ -24671,6 +24920,41 @@ snapshots:
- supports-color
- terser
+ dependencies:
+ '@vitest/expect': 2.1.2
+ '@vitest/pretty-format': 2.1.2
+ '@vitest/runner': 2.1.2
+ '@vitest/snapshot': 2.1.2
+ '@vitest/spy': 2.1.2
+ '@vitest/utils': 2.1.2
+ chai: 5.1.1
+ debug: 4.3.7([email protected])
+ magic-string: 0.30.11
+ pathe: 1.1.2
+ std-env: 3.7.0
+ tinybench: 2.9.0
+ tinyexec: 0.3.0
+ tinypool: 1.0.1
+ tinyrainbow: 1.2.0
+ vite: 5.2.14(@types/[email protected])([email protected])
+ vite-node: 2.1.2(@types/[email protected])([email protected])
+ why-is-node-running: 2.3.0
+ optionalDependencies:
+ '@types/node': 20.14.8
+ jsdom: 20.0.3
+ transitivePeerDependencies:
+ - less
+ - lightningcss
+ - msw
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ optional: true
+
diff --git a/web/src/ee/features/playground/page/hooks/useModelParams.ts b/web/src/ee/features/playground/page/hooks/useModelParams.ts
index 9835d2413c..620541983d 100644
--- a/web/src/ee/features/playground/page/hooks/useModelParams.ts
+++ b/web/src/ee/features/playground/page/hooks/useModelParams.ts
@@ -170,5 +170,17 @@ function getDefaultAdapterParams(
max_tokens: { value: 256, enabled: true },
top_p: { value: 1, enabled: true },
};
+
+ case LLMAdapter.VertexAI:
+ return {
+ adapter: {
+ value: adapter,
+ enabled: true,
+ },
+ temperature: { value: 1, enabled: true },
+ maxTemperature: { value: 2, enabled: true },
+ max_tokens: { value: 256, enabled: true },
+ top_p: { value: 1, enabled: true },
+ };
}
}
diff --git a/web/src/features/llm-api-key/server/router.ts b/web/src/features/llm-api-key/server/router.ts
index 20f9d6d7b1..2473460a6f 100644
--- a/web/src/features/llm-api-key/server/router.ts
+++ b/web/src/features/llm-api-key/server/router.ts
@@ -11,9 +11,14 @@ import {
LLMApiKeySchema,
ChatMessageRole,
supportedModels,
+ GCPServiceAccountKeySchema,
} from "@langfuse/shared";
import { encrypt } from "@langfuse/shared/encryption";
-import { fetchLLMCompletion, logger } from "@langfuse/shared/src/server";
+import {
+ fetchLLMCompletion,
+ LLMAdapter,
+ logger,
+} from "@langfuse/shared/src/server";
export function getDisplaySecretKey(secretKey: string) {
return secretKey.endsWith('"}')
@@ -143,6 +148,14 @@ export const llmApiKeyRouter = createTRPCRouter({
if (!model) throw Error("No model found");
+ if (input.adapter === LLMAdapter.VertexAI) {
+ const parsed = GCPServiceAccountKeySchema.safeParse(
+ JSON.parse(input.secretKey),
+ );
+ if (!parsed.success)
+ throw Error("Invalid GCP service account JSON key");
+ }
+
const testMessages: ChatMessage[] = [
{ role: ChatMessageRole.System, content: "You are a bot" },
{ role: ChatMessageRole.User, content: "How are you?" },
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
index b973c5dced..5a121301e7 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
@@ -362,6 +362,27 @@ export function CreateLLMApiKeyForm({
<FormDescription>
Your API keys are stored encrypted on our servers.
</FormDescription>
+ {currentAdapter === LLMAdapter.VertexAI && (
+ <FormDescription className="text-dark-yellow">
+ Paste your GCP service account JSON key here. The service
+ account must have `Vertex AI User` role permissions. Example
+ JSON:
+ <pre className="text-xs">
+ {`{
+ "type": "service_account",
+ "project_id": "<project_id>",
+ "private_key_id": "<private_key_id>",
+ "private_key": "<private_key>",
+ "client_email": "<client_email>",
+ "client_id": "<client_id>",
+ "auth_uri": "<auth_uri>",
+ "token_uri": "<token_uri>",
+ "auth_provider_x509_cert_url": "<auth_provider_x509_cert_url>",
+ "client_x509_cert_url": "<client_x509_cert_url>",
+}`}
+ </pre>
+ </FormDescription>
+ )}
<FormControl>
<Input {...field} />
</FormControl>