Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(llm): move Base URL into an Advanced options card
Elian Dorand5d321c8b9a5
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex e0e69908d7..ead477f0d6 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -3074,6 +3074,7 @@"provider_name": "Name","provider_type": "Provider","connection_details": "Connection",+ "advanced_options": "Advanced options","provider_desc_anthropic": "Claude models via the Anthropic API. Requires an API key.","provider_desc_claude_agent": "Uses your Claude Pro/Max subscription, no API key. Requires Claude Code on the Trilium server.","provider_desc_openai": "GPT models via the OpenAI API. Requires an API key.",diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsxindex 4d0517b347..715b5040b5 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx@@ -148,39 +148,43 @@ export default function AddProviderModal({ show, onHidden, onSave }: AddProvider<Card heading={t("llm.connection_details")}><CardSection>{usesApiKey ? (- <>- <FormGroup- name="base-url"- label={t("llm.base_url")}- description={- !baseUrlIsValid- ? <span className="text-danger">{t("llm.base_url_invalid")}</span>- : t("llm.base_url_description")- }- >- <FormTextBox- type="text"- currentValue={baseUrl}- onChange={setBaseUrl}- placeholder={providerType?.defaultBaseUrl}- />- </FormGroup>-- <FormGroup name="api-key" label={t("llm.api_key")}>- <FormTextBox- type="password"- currentValue={apiKey}- onChange={setApiKey}- placeholder={t("llm.api_key_placeholder")}- autoFocus- />- </FormGroup>- </>+ <FormGroup name="api-key" label={t("llm.api_key")}>+ <FormTextBox+ type="password"+ currentValue={apiKey}+ onChange={setApiKey}+ placeholder={t("llm.api_key_placeholder")}+ autoFocus+ />+ </FormGroup>) : (<p>{t("llm.claude_agent_description")}</p>)}</CardSection></Card>++ {usesApiKey && (+ <Card heading={t("llm.advanced_options")}>+ <CardSection>+ <FormGroup+ name="base-url"+ label={t("llm.base_url")}+ description={+ !baseUrlIsValid+ ? <span className="text-danger">{t("llm.base_url_invalid")}</span>+ : t("llm.base_url_description")+ }+ >+ <FormTextBox+ type="text"+ currentValue={baseUrl}+ onChange={setBaseUrl}+ placeholder={providerType?.defaultBaseUrl}+ />+ </FormGroup>+ </CardSection>+ </Card>+ )}</Modal>,document.body);