@danhachuel/thunderbolt 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +44 -36
- package/hermes_ui/languages.py +16 -0
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -3791,17 +3791,25 @@ def _render_llm_card(settings: dict[str, Any], cards: list[dict[str, Any]], inde
|
|
|
3791
3791
|
model = st.text_input("Modelo manual", value=current_model if selected == manual_model and current_model not in model_catalog else "", key=f"llm_card_{card_id}_model_manual") if selected == manual_model else selected
|
|
3792
3792
|
else:
|
|
3793
3793
|
model = st.text_input("Modelo", value=current_model, help="ID do modelo usado pelo endpoint Chat Completions.", key=f"llm_card_{card_id}_model")
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3794
|
+
base_url = str(card.get("base_url") or definition.default_base_url)
|
|
3795
|
+
endpoint_col, action_col = st.columns([1.65, 1.05])
|
|
3796
|
+
with endpoint_col:
|
|
3797
|
+
if definition.show_base_url:
|
|
3798
|
+
base_url = st.text_input(
|
|
3799
|
+
"Base URL",
|
|
3800
|
+
value=base_url,
|
|
3801
|
+
help="Endpoint OpenAI-compatible deste provider; só aparece quando é configurável.",
|
|
3802
|
+
key=f"llm_card_{card_id}_base_url",
|
|
3803
|
+
)
|
|
3804
|
+
elif base_url:
|
|
3804
3805
|
st.caption(f"Endpoint gerido pelo provider: {base_url}")
|
|
3806
|
+
with action_col:
|
|
3807
|
+
action_buttons = st.columns(2)
|
|
3808
|
+
with action_buttons[0]:
|
|
3809
|
+
refresh_clicked = st.form_submit_button("Consultar modelos", use_container_width=True)
|
|
3810
|
+
with action_buttons[1]:
|
|
3811
|
+
test_clicked = st.form_submit_button("Testar chamada API", use_container_width=True)
|
|
3812
|
+
|
|
3805
3813
|
extra_values: dict[str, str] = {}
|
|
3806
3814
|
if definition.extra_fields:
|
|
3807
3815
|
extra_cols = st.columns(len(definition.extra_fields))
|
|
@@ -3812,26 +3820,26 @@ def _render_llm_card(settings: dict[str, Any], cards: list[dict[str, Any]], inde
|
|
|
3812
3820
|
value=str(card.get(field_name) or ""),
|
|
3813
3821
|
key=f"llm_card_{card_id}_{field_name}",
|
|
3814
3822
|
)
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
value=
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3823
|
+
|
|
3824
|
+
status_cols = st.columns(3)
|
|
3825
|
+
with status_cols[0]:
|
|
3826
|
+
enabled = st.checkbox("Provider activo", value=bool(card.get("enabled", True)), key=f"llm_card_{card_id}_enabled")
|
|
3827
|
+
with status_cols[1]:
|
|
3828
|
+
primary_llm = st.checkbox(
|
|
3829
|
+
"LLM principal",
|
|
3830
|
+
value=str(settings.get(LLM_ACTIVE_CARD_KEY) or "") == card_id,
|
|
3831
|
+
help="Usar este cartão como provider principal para geração de temas, roteiros, títulos e keywords.",
|
|
3832
|
+
key=f"llm_card_{card_id}_primary",
|
|
3833
|
+
)
|
|
3834
|
+
with status_cols[2]:
|
|
3835
|
+
telegram_llm = st.checkbox(
|
|
3836
|
+
"LLM Telegram",
|
|
3837
|
+
value=bool(card.get("telegram_llm", False)),
|
|
3838
|
+
help="Usar este cartão exclusivamente para o roteamento de notificações Telegram. Apenas um cartão pode ficar seleccionado.",
|
|
3839
|
+
key=f"llm_card_{card_id}_telegram",
|
|
3840
|
+
)
|
|
3841
|
+
|
|
3842
|
+
save_clicked = st.form_submit_button("Salvar", type="primary", use_container_width=True)
|
|
3835
3843
|
remove_clicked = False
|
|
3836
3844
|
if definition.code != "openai":
|
|
3837
3845
|
remove_clicked = st.form_submit_button("Remover cartão", use_container_width=True)
|
|
@@ -3921,11 +3929,12 @@ def render_settings():
|
|
|
3921
3929
|
with api_keys_tab:
|
|
3922
3930
|
api_service_tab, material_sources_tab = render_localized_tabs(["Serviços e modelos", "Fontes de materiais"])
|
|
3923
3931
|
with api_service_tab:
|
|
3932
|
+
st.subheader("API Keys")
|
|
3933
|
+
port = st.number_input("Porta Streamlit", 1, 65535, int(settings.get("port", 3030)))
|
|
3934
|
+
moneyprinter_path = st.text_input("Pasta do motor de vídeo", settings.get("moneyprinter_path", ""), key="settings_moneyprinter_path")
|
|
3935
|
+
render_llm_provider_cards(settings)
|
|
3924
3936
|
with st.form("settings_form"):
|
|
3925
|
-
st.
|
|
3926
|
-
port = st.number_input("Porta Streamlit", 1, 65535, int(settings.get("port", 3030)))
|
|
3927
|
-
moneyprinter_path = st.text_input("Pasta do motor de vídeo", settings.get("moneyprinter_path", ""), key="settings_moneyprinter_path")
|
|
3928
|
-
with st.expander("Niche Finder — execução remota no Kaggle", expanded=False):
|
|
3937
|
+
with st.expander("Niche Finder — Kaggle", expanded=False):
|
|
3929
3938
|
st.caption("O dataset permanece no Kaggle. O Thunderbolt usa estas credenciais apenas para publicar/executar a kernel e obter os resultados pequenos da análise.")
|
|
3930
3939
|
kaggle_cols = st.columns(3)
|
|
3931
3940
|
with kaggle_cols[0]:
|
|
@@ -3936,7 +3945,7 @@ def render_settings():
|
|
|
3936
3945
|
kaggle_kernel_slug = text_setting("Slug da kernel", "kaggle_kernel_slug", help_text="Identificador da kernel remota, por exemplo thunderbolt-niche-finder.")
|
|
3937
3946
|
_render_credential_status(kaggle_api_key)
|
|
3938
3947
|
|
|
3939
|
-
with st.expander("Niche Finder —
|
|
3948
|
+
with st.expander("Niche Finder — Apify", expanded=False):
|
|
3940
3949
|
st.caption("O token fica guardado apenas no storage local. A aba Niche Finder Apify só usa este serviço depois de clicar no botão de pesquisa.")
|
|
3941
3950
|
apify_cols = st.columns(4)
|
|
3942
3951
|
with apify_cols[0]:
|
|
@@ -4050,7 +4059,6 @@ def render_settings():
|
|
|
4050
4059
|
st.success("Configurações guardadas localmente. Indique uma pasta válida do motor de vídeo para sincronizar config.toml.")
|
|
4051
4060
|
except Exception as exc:
|
|
4052
4061
|
st.warning(f"Configurações locais guardadas, mas não foi possível sincronizar config.toml: {exc}")
|
|
4053
|
-
render_llm_provider_cards(settings)
|
|
4054
4062
|
with material_sources_tab:
|
|
4055
4063
|
render_material_source_api_keys(settings)
|
|
4056
4064
|
|
package/hermes_ui/languages.py
CHANGED
|
@@ -208,6 +208,22 @@ for _language_code, _llm_control_values in _LLM_CONTROL_TRANSLATIONS.items():
|
|
|
208
208
|
UI_TRANSLATIONS[_language_code].update(_llm_control_values)
|
|
209
209
|
|
|
210
210
|
|
|
211
|
+
_API_KEY_EXPANDER_TRANSLATIONS: dict[str, dict[str, str]] = {
|
|
212
|
+
"pt": {"Niche Finder — Kaggle": "Niche Finder — Kaggle", "Niche Finder — Apify": "Niche Finder — Apify"},
|
|
213
|
+
"en": {"Niche Finder — Kaggle": "Niche Finder — Kaggle", "Niche Finder — Apify": "Niche Finder — Apify"},
|
|
214
|
+
"zh": {"Niche Finder — Kaggle": "利基搜索 — Kaggle", "Niche Finder — Apify": "利基搜索 — Apify"},
|
|
215
|
+
"de": {"Niche Finder — Kaggle": "Kaggle-Nischenfinder", "Niche Finder — Apify": "Apify-Nischenfinder"},
|
|
216
|
+
"vi": {"Niche Finder — Kaggle": "Tìm ngách — Kaggle", "Niche Finder — Apify": "Tìm ngách — Apify"},
|
|
217
|
+
"tr": {"Niche Finder — Kaggle": "Kaggle Niş Bulucu", "Niche Finder — Apify": "Apify Niş Bulucu"},
|
|
218
|
+
"ru": {"Niche Finder — Kaggle": "Поиск ниши — Kaggle", "Niche Finder — Apify": "Поиск ниши — Apify"},
|
|
219
|
+
"es": {"Niche Finder — Kaggle": "Buscador de nichos — Kaggle", "Niche Finder — Apify": "Buscador de nichos — Apify"},
|
|
220
|
+
"id": {"Niche Finder — Kaggle": "Pencari Niche — Kaggle", "Niche Finder — Apify": "Pencari Niche — Apify"},
|
|
221
|
+
"it": {"Niche Finder — Kaggle": "Trova nicchia — Kaggle", "Niche Finder — Apify": "Trova nicchia — Apify"},
|
|
222
|
+
}
|
|
223
|
+
for _language_code, _api_key_values in _API_KEY_EXPANDER_TRANSLATIONS.items():
|
|
224
|
+
UI_TRANSLATIONS[_language_code].update(_api_key_values)
|
|
225
|
+
|
|
226
|
+
|
|
211
227
|
# Labels introduced by the reorganised sidebar. They are merged into the
|
|
212
228
|
# existing UI translation index so every navigation control uses the same
|
|
213
229
|
# translation path as the legacy pages.
|
package/package.json
CHANGED