Skip to content

Commit 5ef3893

Browse files
committed
feat: vertex optional base url configuration
1 parent 6ed2ca7 commit 5ef3893

File tree

3 files changed

+11
-0
lines changed
  • apps/web/src/app/(private)/settings/_components/ProviderApiKeys/New/_components/Configuration/Vertex
  • packages/core/src/services/ai

3 files changed

+11
-0
lines changed

apps/web/src/app/(private)/settings/_components/ProviderApiKeys/New/_components/Configuration/Vertex/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ export function VertexConfiguration() {
5151
fieldNamespace: '[googleCredentials][privateKey]',
5252
})}
5353
/>
54+
<Input
55+
type='text'
56+
label='Base URL (Optional)'
57+
info='Base URL for the Google Vertex API calls e.g. to use proxy servers. By default, it is constructed using the location and project.'
58+
name={buildConfigFieldName({
59+
fieldNamespace: 'baseUrl',
60+
})}
61+
placeholder='https://${location}-aiplatform.googleapis.com/v1/projects/${project}/locations/${location}/publishers/google'
62+
/>
5463
</>
5564
)
5665
}

packages/core/src/services/ai/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function validateVertexConfig({
9090
if (result.success) {
9191
const config = result.data
9292
const privateKey = config.googleCredentials.privateKey.replace(/\\n/g, '\n')
93+
9394
return Result.ok({
9495
...config,
9596
googleCredentials: {

packages/core/src/services/ai/providers/helpers/vertex.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { z } from 'zod'
22

33
export const vertexConfigurationSchema = z.object({
4+
baseUrl: z.string().optional(),
45
project: z.string(),
56
location: z.string(),
67
googleCredentials: z.object({

0 commit comments

Comments
 (0)