|
5 | 5 | Globe as GlobeIcon, |
6 | 6 | Languages as LanguagesIcon, |
7 | 7 | Plus as PlusIcon, |
| 8 | + Telescope as TelescopeIcon, |
8 | 9 | X as XIcon, |
9 | 10 | Zap as ZapIcon, |
10 | 11 | } from 'lucide-vue-next' |
@@ -48,12 +49,19 @@ interface AIConfig { |
48 | 49 | writerModel?: AIModelAssignment |
49 | 50 | commentReviewModel?: AIModelAssignment |
50 | 51 | translationModel?: AIModelAssignment |
| 52 | + insightsModel?: AIModelAssignment |
| 53 | + insightsTranslationModel?: AIModelAssignment |
51 | 54 | enableSummary: boolean |
52 | 55 | enableAutoGenerateSummary: boolean |
53 | 56 | summaryTargetLanguages?: string[] |
54 | 57 | enableTranslation?: boolean |
55 | 58 | enableAutoGenerateTranslation?: boolean |
56 | 59 | translationTargetLanguages?: string[] |
| 60 | + enableInsights?: boolean |
| 61 | + enableAutoGenerateInsightsOnCreate?: boolean |
| 62 | + enableAutoGenerateInsightsOnUpdate?: boolean |
| 63 | + enableAutoTranslateInsights?: boolean |
| 64 | + insightsTargetLanguages?: string[] |
57 | 65 | } |
58 | 66 |
|
59 | 67 | interface ModelInfo { |
@@ -840,6 +848,24 @@ export const AIConfigSection = defineComponent({ |
840 | 848 | providerModels={providerModels.value || {}} |
841 | 849 | onUpdate={(a) => updateConfig({ translationModel: a })} |
842 | 850 | /> |
| 851 | + |
| 852 | + <AIModelAssignmentRow |
| 853 | + label="精读生成" |
| 854 | + description="用于生成长篇精读的模型" |
| 855 | + assignment={config.value.insightsModel} |
| 856 | + providers={config.value.providers || []} |
| 857 | + providerModels={providerModels.value || {}} |
| 858 | + onUpdate={(a) => updateConfig({ insightsModel: a })} |
| 859 | + /> |
| 860 | + |
| 861 | + <AIModelAssignmentRow |
| 862 | + label="精读翻译" |
| 863 | + description="用于翻译精读的模型,留空则复用翻译模型" |
| 864 | + assignment={config.value.insightsTranslationModel} |
| 865 | + providers={config.value.providers || []} |
| 866 | + providerModels={providerModels.value || {}} |
| 867 | + onUpdate={(a) => updateConfig({ insightsTranslationModel: a })} |
| 868 | + /> |
843 | 869 | </SettingsSection> |
844 | 870 |
|
845 | 871 | <SettingsSection |
@@ -879,6 +905,71 @@ export const AIConfigSection = defineComponent({ |
879 | 905 | </SettingsRow> |
880 | 906 | </SettingsSection> |
881 | 907 |
|
| 908 | + <SettingsSection |
| 909 | + title="AI 精读" |
| 910 | + description="在摘要之外输出长篇精读版本,含结构化章节" |
| 911 | + icon={TelescopeIcon} |
| 912 | + > |
| 913 | + <SettingsRow title="启用 AI 精读"> |
| 914 | + <NSwitch |
| 915 | + value={config.value.enableInsights} |
| 916 | + onUpdateValue={(v: boolean) => |
| 917 | + updateConfig({ enableInsights: v }) |
| 918 | + } |
| 919 | + /> |
| 920 | + </SettingsRow> |
| 921 | + |
| 922 | + <SettingsRow |
| 923 | + title="文章创建时自动生成精读" |
| 924 | + description="发布文章时自动生成精读(需要先启用 AI 精读)" |
| 925 | + > |
| 926 | + <NSwitch |
| 927 | + value={config.value.enableAutoGenerateInsightsOnCreate} |
| 928 | + onUpdateValue={(v: boolean) => |
| 929 | + updateConfig({ enableAutoGenerateInsightsOnCreate: v }) |
| 930 | + } |
| 931 | + disabled={!config.value.enableInsights} |
| 932 | + /> |
| 933 | + </SettingsRow> |
| 934 | + |
| 935 | + <SettingsRow |
| 936 | + title="文章更新时重新生成精读" |
| 937 | + description="文章内容变更时重新生成精读" |
| 938 | + > |
| 939 | + <NSwitch |
| 940 | + value={config.value.enableAutoGenerateInsightsOnUpdate} |
| 941 | + onUpdateValue={(v: boolean) => |
| 942 | + updateConfig({ enableAutoGenerateInsightsOnUpdate: v }) |
| 943 | + } |
| 944 | + disabled={!config.value.enableInsights} |
| 945 | + /> |
| 946 | + </SettingsRow> |
| 947 | + |
| 948 | + <SettingsRow |
| 949 | + title="自动翻译精读" |
| 950 | + description="精读生成后按目标语言自动翻译" |
| 951 | + > |
| 952 | + <NSwitch |
| 953 | + value={config.value.enableAutoTranslateInsights} |
| 954 | + onUpdateValue={(v: boolean) => |
| 955 | + updateConfig({ enableAutoTranslateInsights: v }) |
| 956 | + } |
| 957 | + disabled={!config.value.enableInsights} |
| 958 | + /> |
| 959 | + </SettingsRow> |
| 960 | + |
| 961 | + <SettingsRow |
| 962 | + title="精读目标语言" |
| 963 | + description="自动翻译精读的目标语言列表,使用 ISO 639-1 语言代码" |
| 964 | + > |
| 965 | + <TranslationLanguagesInput |
| 966 | + value={config.value.insightsTargetLanguages || []} |
| 967 | + onUpdate={(v) => updateConfig({ insightsTargetLanguages: v })} |
| 968 | + disabled={!config.value.enableInsights} |
| 969 | + /> |
| 970 | + </SettingsRow> |
| 971 | + </SettingsSection> |
| 972 | + |
882 | 973 | <SettingsSection |
883 | 974 | title="AI 翻译" |
884 | 975 | description="文章多语言翻译功能配置" |
|
0 commit comments