Skip to content

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

fix(ui): improve llm api key form verification errors (#2689)

Marc Klingenca1a67368777
diff --git a/web/src/features/llm-api-key/types.ts b/web/src/features/llm-api-key/types.ts
index cd49021688..db4b289722 100644
--- a/web/src/features/llm-api-key/types.ts
+++ b/web/src/features/llm-api-key/types.ts
@@ -4,9 +4,9 @@ import { LLMAdapter } from "@langfuse/shared";
export const CreateLlmApiKey = z.object({
projectId: z.string(),
secretKey: z.string().min(1),
- provider: z.string().min(3),
+ provider: z.string().min(1),
adapter: z.nativeEnum(LLMAdapter),
baseURL: z.string().url().optional(),
withDefaultModels: z.boolean().optional(),
- customModels: z.array(z.string()).optional(),
+ customModels: z.array(z.string().min(1)).optional(),
});
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyDialog.tsx b/web/src/features/public-api/components/CreateLLMApiKeyDialog.tsx
index 8665417cc4..5878a4663c 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyDialog.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyDialog.tsx
@@ -40,7 +40,9 @@ import useProjectIdFromURL from "@/src/hooks/useProjectIdFromURL";
const formSchema = z
.object({
secretKey: z.string().min(1),
- provider: z.string().min(1),
+ provider: z
+ .string()
+ .min(1, "Please add a provider name that identifies this connection."),
adapter: z.nativeEnum(LLMAdapter),
baseURL: z.union([z.literal(""), z.string().url()]),
withDefaultModels: z.boolean(),