diff --git a/src/assets/locale/en/openai.json b/src/assets/locale/en/openai.json index 460e450..18a5f81 100644 --- a/src/assets/locale/en/openai.json +++ b/src/assets/locale/en/openai.json @@ -1,6 +1,6 @@ { - "settings": "OpenAI API Settings", - "heading": "OpenAI API Settings", + "settings": "OpenAI Compatible API", + "heading": "OpenAI compatible API", "subheading": "Manage and configure your OpenAI API Compatible providers here.", "addBtn": "Add Provider", "table": { @@ -33,9 +33,10 @@ "title": "Model List", "subheading": "Please select the models you want to use with this provider.", "success": "Successfully added new models." - } + }, + "tipLMStudio": "Page Assist will automatically fetch the models you loaded on LM Studio. You don't need to add them manually." }, - "addSuccess": "Provider added successfully.", + "addSuccess": "Provider added successfully.", "deleteSuccess": "Provider deleted successfully.", "updateSuccess": "Provider updated successfully.", "delete": "Delete", diff --git a/src/components/Option/Settings/openai.tsx b/src/components/Option/Settings/openai.tsx index d0a889c..d1646d0 100644 --- a/src/components/Option/Settings/openai.tsx +++ b/src/components/Option/Settings/openai.tsx @@ -1,3 +1,9 @@ +/** + * The `OpenAIApp` component is the main entry point for the OpenAI configuration management functionality in the application. + * It provides a user interface for adding, editing, deleting, and refetching OpenAI configurations. + * The component uses React Query to manage the state and perform CRUD operations on the OpenAI configurations. + * It also includes a modal for fetching the available models from the selected OpenAI configuration. + */ import { Form, Input, Modal, Table, message, Tooltip, Select } from "antd" import { useState } from "react" import { useTranslation } from "react-i18next" @@ -8,7 +14,7 @@ import { updateOpenAIConfig } from "@/db/openai" import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" -import { Pencil, Trash2, RotateCwIcon, DownloadIcon } from "lucide-react" +import { Pencil, Trash2, RotateCwIcon, DownloadIcon, AlertTriangle } from "lucide-react" import { OpenAIFetchModel } from "./openai-fetch-model" import { OAI_API_PROVIDERS } from "@/utils/oai-api-providers" @@ -245,7 +251,11 @@ export const OpenAIApp = () => { placeholder={t("modal.apiKey.placeholder")} /> - + { + provider === "lmstudio" &&