Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ const vertexSchema = apiModelIdProviderModelSchema.extend({
vertexJsonCredentials: z.string().optional(),
vertexProjectId: z.string().optional(),
vertexRegion: z.string().optional(),
enableUrlContext: z.boolean().optional(),
enableGrounding: z.boolean().optional(),
})

const openAiSchema = baseProviderSettingsSchema.extend({
Expand Down
6 changes: 5 additions & 1 deletion webview-ui/src/components/settings/ApiOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ const ApiOptions = ({
)}

{selectedProvider === "vertex" && (
<Vertex apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
<Vertex
apiConfiguration={apiConfiguration}
setApiConfigurationField={setApiConfigurationField}
fromWelcomeView={fromWelcomeView}
/>
)}

{selectedProvider === "gemini" && (
Expand Down
28 changes: 27 additions & 1 deletion webview-ui/src/components/settings/providers/Vertex.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useCallback } from "react"
import { Checkbox } from "vscrui"
import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"

import { type ProviderSettings, VERTEX_REGIONS } from "@roo-code/types"
Expand All @@ -11,9 +12,10 @@ import { inputEventTransform } from "../transforms"
type VertexProps = {
apiConfiguration: ProviderSettings
setApiConfigurationField: (field: keyof ProviderSettings, value: ProviderSettings[keyof ProviderSettings]) => void
fromWelcomeView?: boolean
}

export const Vertex = ({ apiConfiguration, setApiConfigurationField }: VertexProps) => {
export const Vertex = ({ apiConfiguration, setApiConfigurationField, fromWelcomeView }: VertexProps) => {
const { t } = useAppTranslation()

const handleInputChange = useCallback(
Expand Down Expand Up @@ -91,6 +93,30 @@ export const Vertex = ({ apiConfiguration, setApiConfigurationField }: VertexPro
</SelectContent>
</Select>
</div>

{!fromWelcomeView && apiConfiguration.apiModelId?.startsWith("gemini") && (
<div className="mt-6">
<Checkbox
data-testid="checkbox-url-context"
checked={!!apiConfiguration.enableUrlContext}
onChange={(checked: boolean) => setApiConfigurationField("enableUrlContext", checked)}>
{t("settings:providers.geminiParameters.urlContext.title")}
</Checkbox>
<div className="text-sm text-vscode-descriptionForeground mb-3 mt-1.5">
{t("settings:providers.geminiParameters.urlContext.description")}
</div>

<Checkbox
data-testid="checkbox-grounding-search"
checked={!!apiConfiguration.enableGrounding}
onChange={(checked: boolean) => setApiConfigurationField("enableGrounding", checked)}>
{t("settings:providers.geminiParameters.groundingSearch.title")}
</Checkbox>
<div className="text-sm text-vscode-descriptionForeground mb-3 mt-1.5">
{t("settings:providers.geminiParameters.groundingSearch.description")}
</div>
</div>
)}
</>
)
}
Loading
Loading