Skip to content
Open
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
58 changes: 28 additions & 30 deletions apps/dokploy/components/dashboard/settings/handle-ai.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,36 +275,34 @@ export const HandleAi = ({ aiId }: Props) => {
)}
/>

{!isOllama && (
<FormField
control={form.control}
name="apiKey"
render={({ field }) => (
<FormItem>
<FormLabel>API Key</FormLabel>
<FormControl>
<Input
type="password"
placeholder="sk-..."
autoComplete="one-time-code"
{...field}
onChange={(e) => {
field.onChange(e);
// Reset model when user changes API Key
if (form.getValues("model")) {
form.setValue("model", "");
}
}}
/>
</FormControl>
<FormDescription>
Your API key for authentication
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
)}
<FormField
control={form.control}
name="apiKey"
render={({ field }) => (
<FormItem>
<FormLabel>API Key</FormLabel>
<FormControl>
<Input
type="password"
placeholder="sk-..."
autoComplete="one-time-code"
{...field}
onChange={(e) => {
field.onChange(e);
// Reset model when user changes API Key
if (form.getValues("model")) {
form.setValue("model", "");
}
}}
/>
</FormControl>
<FormDescription>
Your API key for authentication
</FormDescription>
<FormMessage />
</FormItem>
)}
/>

{isLoadingServerModels && (
<span className="text-sm text-muted-foreground">
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/utils/ai/select-ai-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export function selectAIProvider(config: { apiUrl: string; apiKey: string }) {
});
case "ollama":
return createOllama({
// optional settings, e.g.
baseURL: config.apiUrl,
apiKey: config.apiKey,
});
case "deepinfra":
return createDeepInfra({
Expand Down