diff --git a/ui/admin/app/components/model-providers/ModelProviderForm.tsx b/ui/admin/app/components/model-providers/ModelProviderForm.tsx index cdbb6559..fffcc716 100644 --- a/ui/admin/app/components/model-providers/ModelProviderForm.tsx +++ b/ui/admin/app/components/model-providers/ModelProviderForm.tsx @@ -22,6 +22,7 @@ import { ControlledInput } from "~/components/form/controlledInputs"; import { ModelProviderConfigurationLinks, ModelProviderRequiredTooltips, + ModelProviderSensitiveFields, } from "~/components/model-providers/constants"; import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"; import { Button } from "~/components/ui/button"; @@ -211,26 +212,34 @@ export function ModelProviderForm({ className="flex flex-col gap-4" > {requiredConfigParamFields.fields.map( - (field, i) => ( -
- { + const type = ModelProviderSensitiveFields[ + field.name + ] + ? "password" + : "text"; + + return ( +
-
- ) + className="flex gap-2 items-center justify-center" + > + +
+ ); + } )} diff --git a/ui/admin/app/components/model-providers/constants.ts b/ui/admin/app/components/model-providers/constants.ts index ee402be4..74839cc6 100644 --- a/ui/admin/app/components/model-providers/constants.ts +++ b/ui/admin/app/components/model-providers/constants.ts @@ -48,3 +48,23 @@ export const ModelProviderRequiredTooltips: { "Container that holds related Azure resources. Can typically be found in Azure Portal > Resource Groups > [OpenAI Resource Group] > Overview", }, }; + +export const ModelProviderSensitiveFields: Record = + { + // OpenAI + OTTO8_OPENAI_MODEL_PROVIDER_API_KEY: true, + + // Azure OpenAI + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_ENDPOINT: false, + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_CLIENT_ID: false, + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_CLIENT_SECRET: true, + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_TENANT_ID: false, + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_SUBSCRIPTION_ID: false, + OTTO8_AZURE_OPENAI_MODEL_PROVIDER_RESOURCE_GROUP: false, + + // Anthropic + OTTO8_ANTHROPIC_MODEL_PROVIDER_API_KEY: true, + + // Voyage + OTTO8_VOYAGE_MODEL_PROVIDER_API_KEY: true, + };