diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 059be38362b17f..138fb886d6aea0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,34 +1,32 @@ -# Checklist: +# Summary -> [!IMPORTANT] -> Please review the checklist below before submitting your pull request. - -- [ ] Please open an issue before creating a PR or link to an existing issue -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - -# Description - -Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. Close issue syntax: `Fixes #`, see [documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) for more details. +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -Fixes +> [!Tip] +> Close issue syntax: `Fixes #` or `Resolves #`, see [documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) for more details. -## Type of Change -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) -- [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement -- [ ] Dependency upgrade - -# Testing Instructions +# Screenshots -Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration + + + + + + + + + +
Before: After:
......
-- [ ] Test A -- [ ] Test B +# Checklist +> [!IMPORTANT] +> Please review the checklist below before submitting your pull request. +- [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) +- [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) +- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. +- [x] I've updated the documentation accordingly. +- [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods diff --git a/README.md b/README.md index d42b3b13a68204..4c2d80385495d9 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ chat on Discord + + join Reddit follow on X(Twitter) diff --git a/README_AR.md b/README_AR.md index e46ba7373840c9..a4cfd744c064a3 100644 --- a/README_AR.md +++ b/README_AR.md @@ -15,6 +15,9 @@ chat on Discord + + join Reddit follow on X(Twitter) diff --git a/README_CN.md b/README_CN.md index 070951699a85ba..2a3f12dd05bf14 100644 --- a/README_CN.md +++ b/README_CN.md @@ -15,6 +15,9 @@ chat on Discord + + join Reddit follow on X(Twitter) diff --git a/README_ES.md b/README_ES.md index 7da5ac7b61fb19..ab79ec9f85b95f 100644 --- a/README_ES.md +++ b/README_ES.md @@ -15,6 +15,9 @@ chat en Discord + + join Reddit seguir en X(Twitter) diff --git a/README_FR.md b/README_FR.md index 15f6f2650f8f2b..1c963b495f8f66 100644 --- a/README_FR.md +++ b/README_FR.md @@ -15,6 +15,9 @@ chat sur Discord + + join Reddit suivre sur X(Twitter) diff --git a/README_JA.md b/README_JA.md index a2e6b173f5bfcd..b0f06ff259729b 100644 --- a/README_JA.md +++ b/README_JA.md @@ -15,6 +15,9 @@ Discordでチャット + + Reddit X(Twitter)でフォロー diff --git a/README_KL.md b/README_KL.md index 8f2affdce5ae59..be727774e92500 100644 --- a/README_KL.md +++ b/README_KL.md @@ -15,6 +15,9 @@ chat on Discord + + Follow Reddit follow on X(Twitter) diff --git a/README_KR.md b/README_KR.md index 6c3a9ed7f6ea06..9f8e072ba67963 100644 --- a/README_KR.md +++ b/README_KR.md @@ -15,6 +15,9 @@ chat on Discord + + Follow Reddit follow on X(Twitter) diff --git a/README_PT.md b/README_PT.md index 3d66b768023f17..d822cbea67a265 100644 --- a/README_PT.md +++ b/README_PT.md @@ -19,6 +19,9 @@ chat on Discord + + Follow Reddit follow on X(Twitter) @@ -238,4 +241,4 @@ Para proteger sua privacidade, evite postar problemas de segurança no GitHub. E ## Licença -Este repositório está disponível sob a [Licença de Código Aberto Dify](LICENSE), que é essencialmente Apache 2.0 com algumas restrições adicionais. \ No newline at end of file +Este repositório está disponível sob a [Licença de Código Aberto Dify](LICENSE), que é essencialmente Apache 2.0 com algumas restrições adicionais. diff --git a/README_SI.md b/README_SI.md new file mode 100644 index 00000000000000..41a44600e8b6b9 --- /dev/null +++ b/README_SI.md @@ -0,0 +1,180 @@ +![cover-v5-optimized](https://github.com/langgenius/dify/assets/13230914/f9e19af5-61ba-4119-b926-d10c4c06ebab) + +

+ 📌 Predstavljamo nalaganje datotek Dify Workflow: znova ustvarite Google NotebookLM Podcast +

+ +

+ Dify Cloud · + Samostojno gostovanje · + Dokumentacija · + Povpraševanje za podjetja +

+ +

+ + Static Badge + + Static Badge + + chat on Discord + + follow on X(Twitter) + + Docker Pulls + + Commits last month + + Issues closed + + Discussion posts +

+ +

+ README in English + 简体中文版自述文件 + 日本語のREADME + README en Español + README en Français + README tlhIngan Hol + README in Korean + README بالعربية + Türkçe README + README Tiếng Việt + README Slovenščina +

+ + +Dify je odprtokodna platforma za razvoj aplikacij LLM. Njegov intuitivni vmesnik združuje agentski potek dela z umetno inteligenco, cevovod RAG, zmogljivosti agentov, upravljanje modelov, funkcije opazovanja in več, kar vam omogoča hiter prehod od prototipa do proizvodnje. + +## Hitri začetek +> Preden namestite Dify, se prepričajte, da vaša naprava izpolnjuje naslednje minimalne sistemske zahteve: +> +>- CPU >= 2 Core +>- RAM >= 4 GiB + +
+ +Najlažji način za zagon strežnika Dify je prek docker compose . Preden zaženete Dify z naslednjimi ukazi, se prepričajte, da sta Docker in Docker Compose nameščena na vašem računalniku: + +```bash +cd dify +cd docker +cp .env.example .env +docker compose up -d +``` + +Po zagonu lahko dostopate do nadzorne plošče Dify v brskalniku na [http://localhost/install](http://localhost/install) in začnete postopek inicializacije. + +#### Iskanje pomoči +Prosimo, glejte naša pogosta vprašanja [FAQ](https://docs.dify.ai/getting-started/install-self-hosted/faqs) če naletite na težave pri nastavitvi Dify. Če imate še vedno težave, se obrnite na [skupnost ali nas](#community--contact). + +> Če želite prispevati k Difyju ali narediti dodaten razvoj, glejte naš vodnik za [uvajanje iz izvorne kode](https://docs.dify.ai/getting-started/install-self-hosted/local-source-code) + +## Ključne značilnosti +**1. Potek dela**: + Zgradite in preizkusite zmogljive poteke dela AI na vizualnem platnu, pri čemer izkoristite vse naslednje funkcije in več. + + + https://github.com/langgenius/dify/assets/13230914/356df23e-1604-483d-80a6-9517ece318aa + + + +**2. Celovita podpora za modele**: + Brezhibna integracija s stotinami lastniških/odprtokodnih LLM-jev ducatov ponudnikov sklepanja in samostojnih rešitev, ki pokrivajo GPT, Mistral, Llama3 in vse modele, združljive z API-jem OpenAI. Celoten seznam podprtih ponudnikov modelov najdete [tukaj](https://docs.dify.ai/getting-started/readme/model-providers). + +![providers-v5](https://github.com/langgenius/dify/assets/13230914/5a17bdbe-097a-4100-8363-40255b70f6e3) + + +**3. Prompt IDE**: + intuitivni vmesnik za ustvarjanje pozivov, primerjavo zmogljivosti modela in dodajanje dodatnih funkcij, kot je pretvorba besedila v govor, aplikaciji, ki temelji na klepetu. + +**4. RAG Pipeline**: + E Obsežne zmogljivosti RAG, ki pokrivajo vse od vnosa dokumenta do priklica, s podporo za ekstrakcijo besedila iz datotek PDF, PPT in drugih običajnih formatov dokumentov. + +**5. Agent capabilities**: + definirate lahko agente, ki temeljijo na klicanju funkcij LLM ali ReAct, in dodate vnaprej izdelana orodja ali orodja po meri za agenta. Dify ponuja več kot 50 vgrajenih orodij za agente AI, kot so Google Search, DALL·E, Stable Diffusion in WolframAlpha. + +**6. LLMOps**: + Spremljajte in analizirajte dnevnike aplikacij in učinkovitost skozi čas. Pozive, nabore podatkov in modele lahko nenehno izboljšujete na podlagi proizvodnih podatkov in opomb. + +**7. Backend-as-a-Service**: + AVse ponudbe Difyja so opremljene z ustreznimi API-ji, tako da lahko Dify brez težav integrirate v svojo poslovno logiko. + + +## Uporaba Dify + +- **Cloud
** +Gostimo storitev Dify Cloud za vsakogar, ki jo lahko preizkusite brez nastavitev. Zagotavlja vse zmožnosti različice za samostojno namestitev in vključuje 200 brezplačnih klicev GPT-4 v načrtu peskovnika. + +- **Self-hosting Dify Community Edition
** +Hitro zaženite Dify v svojem okolju s tem [začetnim vodnikom](#quick-start) . Za dodatne reference in podrobnejša navodila uporabite našo [dokumentacijo](https://docs.dify.ai) . + + +- **Dify za podjetja/organizacije
** +Ponujamo dodatne funkcije, osredotočene na podjetja. Zabeležite svoja vprašanja prek tega klepetalnega robota ali nam pošljite e-pošto, da se pogovorimo o potrebah podjetja.
+ > Za novoustanovljena podjetja in mala podjetja, ki uporabljajo AWS, si oglejte Dify Premium na AWS Marketplace in ga z enim klikom uvedite v svoj AWS VPC. To je cenovno ugodna ponudba AMI z možnostjo ustvarjanja aplikacij z logotipom in blagovno znamko po meri. + + +## Staying ahead + +Star Dify on GitHub and be instantly notified of new releases. + +![star-us](https://github.com/langgenius/dify/assets/13230914/b823edc1-6388-4e25-ad45-2f6b187adbb4) + + +## Napredne nastavitve + +Če morate prilagoditi konfiguracijo, si oglejte komentarje v naši datoteki .env.example in posodobite ustrezne vrednosti v svoji .env datoteki. Poleg tega boste morda morali prilagoditi docker-compose.yamlsamo datoteko, na primer spremeniti različice slike, preslikave vrat ali namestitve nosilca, glede na vaše specifično okolje in zahteve za uvajanje. Po kakršnih koli spremembah ponovno zaženite docker-compose up -d. Celoten seznam razpoložljivih spremenljivk okolja najdete tukaj . + +Če želite konfigurirati visoko razpoložljivo nastavitev, so na voljo Helm Charts in datoteke YAML, ki jih prispeva skupnost, ki omogočajo uvedbo Difyja v Kubernetes. + +- [Helm Chart by @LeoQuote](https://github.com/douban/charts/tree/master/charts/dify) +- [Helm Chart by @BorisPolonsky](https://github.com/BorisPolonsky/dify-helm) +- [YAML file by @Winson-030](https://github.com/Winson-030/dify-kubernetes) + +#### Uporaba Terraform za uvajanje + +namestite Dify v Cloud Platform z enim klikom z uporabo [terraform](https://www.terraform.io/) + +##### Azure Global +- [Azure Terraform by @nikawang](https://github.com/nikawang/dify-azure-terraform) + +##### Google Cloud +- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform) + +## Prispevam + +Za tiste, ki bi radi prispevali kodo, si oglejte naš vodnik za prispevke . Hkrati vas prosimo, da podprete Dify tako, da ga delite na družbenih medijih ter na dogodkih in konferencah. + + + +> Iščemo sodelavce za pomoč pri prevajanju Difyja v jezike, ki niso mandarinščina ali angleščina. Če želite pomagati, si oglejte i18n README za več informacij in nam pustite komentar v global-userskanalu našega strežnika skupnosti Discord . + +## Skupnost in stik + +* [Github Discussion](https://github.com/langgenius/dify/discussions). Najboljše za: izmenjavo povratnih informacij in postavljanje vprašanj. +* [GitHub Issues](https://github.com/langgenius/dify/issues). Najboljše za: hrošče, na katere naletite pri uporabi Dify.AI, in predloge funkcij. Oglejte si naš [vodnik za prispevke](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md). +* [Discord](https://discord.gg/FngNHpbcY7). Najboljše za: deljenje vaših aplikacij in druženje s skupnostjo. +* [X(Twitter)](https://twitter.com/dify_ai). Najboljše za: deljenje vaših aplikacij in druženje s skupnostjo. + +**Contributors** + + + + + +## Star history + +[![Star History Chart](https://api.star-history.com/svg?repos=langgenius/dify&type=Date)](https://star-history.com/#langgenius/dify&Date) + + +## Varnostno razkritje + +Zaradi zaščite vaše zasebnosti se izogibajte objavljanju varnostnih vprašanj na GitHub. Namesto tega pošljite vprašanja na security@dify.ai in zagotovili vam bomo podrobnejši odgovor. + +## Licenca + +To skladišče je na voljo pod [odprtokodno licenco Dify](LICENSE) , ki je v bistvu Apache 2.0 z nekaj dodatnimi omejitvami. \ No newline at end of file diff --git a/README_TR.md b/README_TR.md index a75889e5760634..38fada34e9a1db 100644 --- a/README_TR.md +++ b/README_TR.md @@ -15,6 +15,9 @@ Discord'da sohbet et + + Follow Reddit X(Twitter)'da takip et diff --git a/README_VI.md b/README_VI.md index 8d49e4976626b6..6f296e508ce030 100644 --- a/README_VI.md +++ b/README_VI.md @@ -15,6 +15,9 @@ chat trên Discord + + Follow Reddit theo dõi trên X(Twitter) @@ -235,4 +238,4 @@ Triển khai Dify lên nền tảng đám mây với một cú nhấp chuột b ## Giấy phép -Kho lưu trữ này có sẵn theo [Giấy phép Mã nguồn Mở Dify](LICENSE), về cơ bản là Apache 2.0 với một vài hạn chế bổ sung. \ No newline at end of file +Kho lưu trữ này có sẵn theo [Giấy phép Mã nguồn Mở Dify](LICENSE), về cơ bản là Apache 2.0 với một vài hạn chế bổ sung. diff --git a/api/Dockerfile b/api/Dockerfile index 51e2a10506474e..175535b188df17 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -55,7 +55,7 @@ RUN apt-get update \ && echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list \ && apt-get update \ # For Security - && apt-get install -y --no-install-recommends expat=2.6.3-2 libldap-2.5-0=2.5.18+dfsg-3+b1 perl=5.40.0-6 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \ + && apt-get install -y --no-install-recommends expat=2.6.4-1 libldap-2.5-0=2.5.18+dfsg-3+b1 perl=5.40.0-7 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \ # install a chinese font to support the use of tools like matplotlib && apt-get install -y fonts-noto-cjk \ && apt-get autoremove -y \ diff --git a/api/app.py b/api/app.py index 60cd622ef4d0a8..a667a84fd683b6 100644 --- a/api/app.py +++ b/api/app.py @@ -1,4 +1,5 @@ import os +import sys from configs import dify_config @@ -29,6 +30,9 @@ # DO NOT REMOVE ABOVE +if sys.version_info[:2] == (3, 10): + print("Warning: Python 3.10 will not be supported in the next version.") + warnings.simplefilter("ignore", ResourceWarning) @@ -49,7 +53,6 @@ @app.after_request def after_request(response): """Add Version headers to the response.""" - response.set_cookie("remember_token", "", expires=0) response.headers.add("X-Version", dify_config.CURRENT_VERSION) response.headers.add("X-Env", dify_config.DEPLOY_ENV) return response diff --git a/api/commands.py b/api/commands.py index 10122ceb3dea2b..23787f38bf0e10 100644 --- a/api/commands.py +++ b/api/commands.py @@ -589,7 +589,7 @@ def upgrade_db(): click.echo(click.style("Database migration successful!", fg="green")) except Exception as e: - logging.exception(f"Database migration failed: {e}") + logging.exception("Failed to execute database migration") finally: lock.release() else: @@ -633,7 +633,7 @@ def fix_app_site_missing(): except Exception as e: failed_app_ids.append(app_id) click.echo(click.style("Failed to fix missing site for app {}".format(app_id), fg="red")) - logging.exception(f"Fix app related site missing issue failed, error: {e}") + logging.exception(f"Failed to fix app related site missing issue, app_id: {app_id}") continue if not processed_count: diff --git a/api/configs/packaging/__init__.py b/api/configs/packaging/__init__.py index b5cb1f06d951f0..65065efbc09329 100644 --- a/api/configs/packaging/__init__.py +++ b/api/configs/packaging/__init__.py @@ -9,7 +9,7 @@ class PackagingInfo(BaseSettings): CURRENT_VERSION: str = Field( description="Dify version", - default="0.11.0", + default="0.11.1", ) COMMIT_SHA: str = Field( diff --git a/api/constants/languages.py b/api/constants/languages.py index 524dc61b5790a4..a6394da81923ab 100644 --- a/api/constants/languages.py +++ b/api/constants/languages.py @@ -17,6 +17,7 @@ "hi-IN": "Asia/Kolkata", "tr-TR": "Europe/Istanbul", "fa-IR": "Asia/Tehran", + "sl-SI": "Europe/Ljubljana", } languages = list(language_timezone_mapping.keys()) diff --git a/api/controllers/console/app/app.py b/api/controllers/console/app/app.py index 36338cbd8a4c59..5a4cd7684f9562 100644 --- a/api/controllers/console/app/app.py +++ b/api/controllers/console/app/app.py @@ -9,6 +9,7 @@ from controllers.console.wraps import ( account_initialization_required, cloud_edition_billing_resource_check, + enterprise_license_required, setup_required, ) from core.ops.ops_trace_manager import OpsTraceManager @@ -28,6 +29,7 @@ class AppListApi(Resource): @setup_required @login_required @account_initialization_required + @enterprise_license_required def get(self): """Get app list""" @@ -149,6 +151,7 @@ class AppApi(Resource): @setup_required @login_required @account_initialization_required + @enterprise_license_required @get_app_model @marshal_with(app_detail_fields_with_site) def get(self, app_model): diff --git a/api/controllers/console/app/audio.py b/api/controllers/console/app/audio.py index 112446613feaac..695b8890e30f5c 100644 --- a/api/controllers/console/app/audio.py +++ b/api/controllers/console/app/audio.py @@ -70,7 +70,7 @@ def post(self, app_model): except ValueError as e: raise e except Exception as e: - logging.exception(f"internal server error, {str(e)}.") + logging.exception("Failed to handle post request to ChatMessageAudioApi") raise InternalServerError() @@ -128,7 +128,7 @@ def post(self, app_model): except ValueError as e: raise e except Exception as e: - logging.exception(f"internal server error, {str(e)}.") + logging.exception("Failed to handle post request to ChatMessageTextApi") raise InternalServerError() @@ -170,7 +170,7 @@ def get(self, app_model): except ValueError as e: raise e except Exception as e: - logging.exception(f"internal server error, {str(e)}.") + logging.exception("Failed to handle get request to TextModesApi") raise InternalServerError() diff --git a/api/controllers/console/datasets/datasets.py b/api/controllers/console/datasets/datasets.py index 82163a32eebd4d..95d4013e3a8f27 100644 --- a/api/controllers/console/datasets/datasets.py +++ b/api/controllers/console/datasets/datasets.py @@ -10,7 +10,7 @@ from controllers.console.apikey import api_key_fields, api_key_list from controllers.console.app.error import ProviderNotInitializeError from controllers.console.datasets.error import DatasetInUseError, DatasetNameDuplicateError, IndexingEstimateError -from controllers.console.wraps import account_initialization_required, setup_required +from controllers.console.wraps import account_initialization_required, enterprise_license_required, setup_required from core.errors.error import LLMBadRequestError, ProviderTokenNotInitError from core.indexing_runner import IndexingRunner from core.model_runtime.entities.model_entities import ModelType @@ -44,6 +44,7 @@ class DatasetListApi(Resource): @setup_required @login_required @account_initialization_required + @enterprise_license_required def get(self): page = request.args.get("page", default=1, type=int) limit = request.args.get("limit", default=20, type=int) diff --git a/api/controllers/console/datasets/datasets_document.py b/api/controllers/console/datasets/datasets_document.py index 60848039c5282c..f38408525aed6f 100644 --- a/api/controllers/console/datasets/datasets_document.py +++ b/api/controllers/console/datasets/datasets_document.py @@ -948,7 +948,7 @@ def post(self, dataset_id): raise DocumentAlreadyFinishedError() retry_documents.append(document) except Exception as e: - logging.exception(f"Document {document_id} retry failed: {str(e)}") + logging.exception(f"Failed to retry document, document id: {document_id}") continue # retry document DocumentService.retry_document(dataset_id, retry_documents) diff --git a/api/controllers/console/error.py b/api/controllers/console/error.py index e0630ca66cc7c0..61561d56c8cbf7 100644 --- a/api/controllers/console/error.py +++ b/api/controllers/console/error.py @@ -86,3 +86,9 @@ class NoFileUploadedError(BaseHTTPException): error_code = "no_file_uploaded" description = "Please upload your file." code = 400 + + +class UnauthorizedAndForceLogout(BaseHTTPException): + error_code = "unauthorized_and_force_logout" + description = "Unauthorized and force logout." + code = 401 diff --git a/api/controllers/console/workspace/account.py b/api/controllers/console/workspace/account.py index aabc4177595d67..750f65168f5f89 100644 --- a/api/controllers/console/workspace/account.py +++ b/api/controllers/console/workspace/account.py @@ -14,7 +14,7 @@ InvalidInvitationCodeError, RepeatPasswordNotMatchError, ) -from controllers.console.wraps import account_initialization_required, setup_required +from controllers.console.wraps import account_initialization_required, enterprise_license_required, setup_required from extensions.ext_database import db from fields.member_fields import account_fields from libs.helper import TimestampField, timezone @@ -79,6 +79,7 @@ class AccountProfileApi(Resource): @login_required @account_initialization_required @marshal_with(account_fields) + @enterprise_license_required def get(self): return current_user diff --git a/api/controllers/console/workspace/models.py b/api/controllers/console/workspace/models.py index 57443cc3b350d0..f804285f008120 100644 --- a/api/controllers/console/workspace/models.py +++ b/api/controllers/console/workspace/models.py @@ -72,7 +72,10 @@ def post(self): model=model_setting["model"], ) except Exception as ex: - logging.exception(f"{model_setting['model_type']} save error: {ex}") + logging.exception( + f"Failed to update default model, model type: {model_setting['model_type']}," + f" model:{model_setting.get('model')}" + ) raise ex return {"result": "success"} @@ -156,7 +159,10 @@ def post(self, provider: str): credentials=args["credentials"], ) except CredentialsValidateFailedError as ex: - logging.exception(f"save model credentials error: {ex}") + logging.exception( + f"Failed to save model credentials, tenant_id: {tenant_id}," + f" model: {args.get('model')}, model_type: {args.get('model_type')}" + ) raise ValueError(str(ex)) return {"result": "success"}, 200 diff --git a/api/controllers/console/workspace/tool_providers.py b/api/controllers/console/workspace/tool_providers.py index daadb85d84e2fa..9ecda2126d4b42 100644 --- a/api/controllers/console/workspace/tool_providers.py +++ b/api/controllers/console/workspace/tool_providers.py @@ -7,7 +7,7 @@ from configs import dify_config from controllers.console import api -from controllers.console.wraps import account_initialization_required, setup_required +from controllers.console.wraps import account_initialization_required, enterprise_license_required, setup_required from core.model_runtime.utils.encoders import jsonable_encoder from libs.helper import alphanumeric, uuid_value from libs.login import login_required @@ -549,6 +549,7 @@ class ToolLabelsApi(Resource): @setup_required @login_required @account_initialization_required + @enterprise_license_required def get(self): return jsonable_encoder(ToolLabelsService.list_tool_labels()) diff --git a/api/controllers/console/wraps.py b/api/controllers/console/wraps.py index 9f294cb93c9bc0..d0df296c240686 100644 --- a/api/controllers/console/wraps.py +++ b/api/controllers/console/wraps.py @@ -8,10 +8,10 @@ from configs import dify_config from controllers.console.workspace.error import AccountNotInitializedError from models.model import DifySetup -from services.feature_service import FeatureService +from services.feature_service import FeatureService, LicenseStatus from services.operation_service import OperationService -from .error import NotInitValidateError, NotSetupError +from .error import NotInitValidateError, NotSetupError, UnauthorizedAndForceLogout def account_initialization_required(view): @@ -142,3 +142,15 @@ def decorated(*args, **kwargs): return view(*args, **kwargs) return decorated + + +def enterprise_license_required(view): + @wraps(view) + def decorated(*args, **kwargs): + settings = FeatureService.get_system_features() + if settings.license.status in [LicenseStatus.INACTIVE, LicenseStatus.EXPIRED, LicenseStatus.LOST]: + raise UnauthorizedAndForceLogout("Your license is invalid. Please contact your administrator.") + + return view(*args, **kwargs) + + return decorated diff --git a/api/controllers/web/audio.py b/api/controllers/web/audio.py index 23550efe2e2768..e8521307ad357a 100644 --- a/api/controllers/web/audio.py +++ b/api/controllers/web/audio.py @@ -59,7 +59,7 @@ def post(self, app_model: App, end_user): except ValueError as e: raise e except Exception as e: - logging.exception(f"internal server error: {str(e)}") + logging.exception("Failed to handle post request to AudioApi") raise InternalServerError() @@ -117,7 +117,7 @@ def post(self, app_model: App, end_user): except ValueError as e: raise e except Exception as e: - logging.exception(f"internal server error: {str(e)}") + logging.exception("Failed to handle post request to TextApi") raise InternalServerError() diff --git a/api/core/app/apps/advanced_chat/app_generator.py b/api/core/app/apps/advanced_chat/app_generator.py index 0b883450610030..00e5a747329bfb 100644 --- a/api/core/app/apps/advanced_chat/app_generator.py +++ b/api/core/app/apps/advanced_chat/app_generator.py @@ -362,5 +362,5 @@ def _handle_advanced_chat_response( if e.args[0] == "I/O operation on closed file.": # ignore this error raise GenerateTaskStoppedError() else: - logger.exception(e) + logger.exception(f"Failed to process generate task pipeline, conversation_id: {conversation.id}") raise e diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py index 1d4c0ea0fa6f4d..e1798957b92653 100644 --- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py +++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py @@ -242,7 +242,7 @@ def _wrapper_process_stream_response( start_listener_time = time.time() yield MessageAudioStreamResponse(audio=audio_trunk.audio, task_id=task_id) except Exception as e: - logger.exception(e) + logger.exception(f"Failed to listen audio message, task_id: {task_id}") break if tts_publisher: yield MessageAudioEndStreamResponse(audio="", task_id=task_id) diff --git a/api/core/app/apps/base_app_generator.py b/api/core/app/apps/base_app_generator.py index 6e6da954014958..3325e300881bd6 100644 --- a/api/core/app/apps/base_app_generator.py +++ b/api/core/app/apps/base_app_generator.py @@ -91,6 +91,9 @@ def _validate_inputs( ) if variable_entity.type == VariableEntityType.NUMBER and isinstance(value, str): + # handle empty string case + if not value.strip(): + return None # may raise ValueError if user_input_value is not a valid number try: if "." in value: diff --git a/api/core/app/apps/message_based_app_generator.py b/api/core/app/apps/message_based_app_generator.py index bae64368e3f384..da206f01e7c2c1 100644 --- a/api/core/app/apps/message_based_app_generator.py +++ b/api/core/app/apps/message_based_app_generator.py @@ -80,7 +80,7 @@ def _handle_response( if e.args[0] == "I/O operation on closed file.": # ignore this error raise GenerateTaskStoppedError() else: - logger.exception(e) + logger.exception(f"Failed to handle response, conversation_id: {conversation.id}") raise e def _get_conversation_by_user( diff --git a/api/core/app/apps/workflow/app_generator.py b/api/core/app/apps/workflow/app_generator.py index a0080ece2016a5..65da39b220a7a7 100644 --- a/api/core/app/apps/workflow/app_generator.py +++ b/api/core/app/apps/workflow/app_generator.py @@ -298,5 +298,7 @@ def _handle_response( if e.args[0] == "I/O operation on closed file.": # ignore this error raise GenerateTaskStoppedError() else: - logger.exception(e) + logger.exception( + f"Fails to process generate task pipeline, task_id: {application_generate_entity.task_id}" + ) raise e diff --git a/api/core/app/apps/workflow/generate_task_pipeline.py b/api/core/app/apps/workflow/generate_task_pipeline.py index aaa4824fe8421c..9e4921d6a22c5a 100644 --- a/api/core/app/apps/workflow/generate_task_pipeline.py +++ b/api/core/app/apps/workflow/generate_task_pipeline.py @@ -216,7 +216,7 @@ def _wrapper_process_stream_response( else: yield MessageAudioStreamResponse(audio=audio_trunk.audio, task_id=task_id) except Exception as e: - logger.exception(e) + logger.exception(f"Fails to get audio trunk, task_id: {task_id}") break if tts_publisher: yield MessageAudioEndStreamResponse(audio="", task_id=task_id) diff --git a/api/core/app/apps/workflow_app_runner.py b/api/core/app/apps/workflow_app_runner.py index 9a01e8a253f97b..2872390d4662db 100644 --- a/api/core/app/apps/workflow_app_runner.py +++ b/api/core/app/apps/workflow_app_runner.py @@ -361,6 +361,7 @@ def _handle_event(self, workflow_entry: WorkflowEntry, event: GraphEngineEvent) node_run_index=workflow_entry.graph_engine.graph_runtime_state.node_run_steps, output=event.pre_iteration_output, parallel_mode_run_id=event.parallel_mode_run_id, + duration=event.duration, ) ) elif isinstance(event, (IterationRunSucceededEvent | IterationRunFailedEvent)): diff --git a/api/core/app/entities/queue_entities.py b/api/core/app/entities/queue_entities.py index f1542ec5d8c578..69bc0d7f9ec102 100644 --- a/api/core/app/entities/queue_entities.py +++ b/api/core/app/entities/queue_entities.py @@ -111,6 +111,7 @@ class QueueIterationNextEvent(AppQueueEvent): """iteratoin run in parallel mode run id""" node_run_index: int output: Optional[Any] = None # output for the current iteration + duration: Optional[float] = None @field_validator("output", mode="before") @classmethod @@ -307,6 +308,8 @@ class QueueNodeSucceededEvent(AppQueueEvent): execution_metadata: Optional[dict[NodeRunMetadataKey, Any]] = None error: Optional[str] = None + """single iteration duration map""" + iteration_duration_map: Optional[dict[str, float]] = None class QueueNodeInIterationFailedEvent(AppQueueEvent): diff --git a/api/core/app/entities/task_entities.py b/api/core/app/entities/task_entities.py index 7e9aad54be57e4..03cc6941a84623 100644 --- a/api/core/app/entities/task_entities.py +++ b/api/core/app/entities/task_entities.py @@ -434,6 +434,7 @@ class Data(BaseModel): parallel_id: Optional[str] = None parallel_start_node_id: Optional[str] = None parallel_mode_run_id: Optional[str] = None + duration: Optional[float] = None event: StreamEvent = StreamEvent.ITERATION_NEXT workflow_run_id: str diff --git a/api/core/app/task_pipeline/message_cycle_manage.py b/api/core/app/task_pipeline/message_cycle_manage.py index 236eebf0b85ff6..e818a090ed7d0f 100644 --- a/api/core/app/task_pipeline/message_cycle_manage.py +++ b/api/core/app/task_pipeline/message_cycle_manage.py @@ -86,7 +86,7 @@ def _generate_conversation_name_worker(self, flask_app: Flask, conversation_id: conversation.name = name except Exception as e: if dify_config.DEBUG: - logging.exception(f"generate conversation name failed: {e}") + logging.exception(f"generate conversation name failed, conversation_id: {conversation_id}") pass db.session.merge(conversation) diff --git a/api/core/app/task_pipeline/workflow_cycle_manage.py b/api/core/app/task_pipeline/workflow_cycle_manage.py index b89edf9079f043..042339969fb8ad 100644 --- a/api/core/app/task_pipeline/workflow_cycle_manage.py +++ b/api/core/app/task_pipeline/workflow_cycle_manage.py @@ -624,6 +624,7 @@ def _workflow_iteration_next_to_stream_response( parallel_id=event.parallel_id, parallel_start_node_id=event.parallel_start_node_id, parallel_mode_run_id=event.parallel_mode_run_id, + duration=event.duration, ), ) diff --git a/api/core/helper/code_executor/__init__.py b/api/core/helper/code_executor/__init__.py index e69de29bb2d1d6..ec885c221879cb 100644 --- a/api/core/helper/code_executor/__init__.py +++ b/api/core/helper/code_executor/__init__.py @@ -0,0 +1,3 @@ +from .code_executor import CodeExecutor, CodeLanguage + +__all__ = ["CodeExecutor", "CodeLanguage"] diff --git a/api/core/helper/code_executor/code_executor.py b/api/core/helper/code_executor/code_executor.py index 4932284540738a..03c4b8d49dc6d7 100644 --- a/api/core/helper/code_executor/code_executor.py +++ b/api/core/helper/code_executor/code_executor.py @@ -1,7 +1,8 @@ import logging +from collections.abc import Mapping from enum import Enum from threading import Lock -from typing import Optional +from typing import Any, Optional from httpx import Timeout, post from pydantic import BaseModel @@ -117,7 +118,7 @@ def execute_code(cls, language: CodeLanguage, preload: str, code: str) -> str: return response.data.stdout or "" @classmethod - def execute_workflow_code_template(cls, language: CodeLanguage, code: str, inputs: dict) -> dict: + def execute_workflow_code_template(cls, language: CodeLanguage, code: str, inputs: Mapping[str, Any]) -> dict: """ Execute code :param language: code language diff --git a/api/core/helper/code_executor/template_transformer.py b/api/core/helper/code_executor/template_transformer.py index 6f016f27bc874d..b7a07b21e1d784 100644 --- a/api/core/helper/code_executor/template_transformer.py +++ b/api/core/helper/code_executor/template_transformer.py @@ -2,6 +2,8 @@ import re from abc import ABC, abstractmethod from base64 import b64encode +from collections.abc import Mapping +from typing import Any class TemplateTransformer(ABC): @@ -10,7 +12,7 @@ class TemplateTransformer(ABC): _result_tag: str = "<>" @classmethod - def transform_caller(cls, code: str, inputs: dict) -> tuple[str, str]: + def transform_caller(cls, code: str, inputs: Mapping[str, Any]) -> tuple[str, str]: """ Transform code to python runner :param code: code @@ -48,13 +50,13 @@ def get_runner_script(cls) -> str: pass @classmethod - def serialize_inputs(cls, inputs: dict) -> str: + def serialize_inputs(cls, inputs: Mapping[str, Any]) -> str: inputs_json_str = json.dumps(inputs, ensure_ascii=False).encode() input_base64_encoded = b64encode(inputs_json_str).decode("utf-8") return input_base64_encoded @classmethod - def assemble_runner_script(cls, code: str, inputs: dict) -> str: + def assemble_runner_script(cls, code: str, inputs: Mapping[str, Any]) -> str: # assemble runner script script = cls.get_runner_script() script = script.replace(cls._code_placeholder, code) diff --git a/api/core/helper/moderation.py b/api/core/helper/moderation.py index b880590de28476..da0fd0031cc6dc 100644 --- a/api/core/helper/moderation.py +++ b/api/core/helper/moderation.py @@ -41,7 +41,7 @@ def check_moderation(model_config: ModelConfigWithCredentialsEntity, text: str) if moderation_result is True: return True except Exception as ex: - logger.exception(ex) + logger.exception(f"Fails to check moderation, provider_name: {provider_name}") raise InvokeBadRequestError("Rate limit exceeded, please try again later.") return False diff --git a/api/core/helper/module_import_helper.py b/api/core/helper/module_import_helper.py index e6e149154870da..1e2fefce88b632 100644 --- a/api/core/helper/module_import_helper.py +++ b/api/core/helper/module_import_helper.py @@ -29,7 +29,7 @@ def import_module_from_source(*, module_name: str, py_file_path: AnyStr, use_laz spec.loader.exec_module(module) return module except Exception as e: - logging.exception(f"Failed to load module {module_name} from {py_file_path}: {str(e)}") + logging.exception(f"Failed to load module {module_name} from script file '{py_file_path}'") raise e diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py index e2a94073cf4c14..b4aee2621a4af8 100644 --- a/api/core/indexing_runner.py +++ b/api/core/indexing_runner.py @@ -554,7 +554,7 @@ def format_qa_document(self, flask_app: Flask, tenant_id: str, document_node, al qa_documents.append(qa_document) format_documents.extend(qa_documents) except Exception as e: - logging.exception(e) + logging.exception("Failed to format qa document") all_qa_documents.extend(format_documents) diff --git a/api/core/llm_generator/llm_generator.py b/api/core/llm_generator/llm_generator.py index 9cf9ed75c04101..3a92c8d9d22562 100644 --- a/api/core/llm_generator/llm_generator.py +++ b/api/core/llm_generator/llm_generator.py @@ -102,7 +102,7 @@ def generate_suggested_questions_after_answer(cls, tenant_id: str, histories: st except InvokeError: questions = [] except Exception as e: - logging.exception(e) + logging.exception("Failed to generate suggested questions after answer") questions = [] return questions @@ -148,7 +148,7 @@ def generate_rule_config( error = str(e) error_step = "generate rule config" except Exception as e: - logging.exception(e) + logging.exception(f"Failed to generate rule config, model: {model_config.get('name')}") rule_config["error"] = str(e) rule_config["error"] = f"Failed to {error_step}. Error: {error}" if error else "" @@ -234,7 +234,7 @@ def generate_rule_config( error_step = "generate conversation opener" except Exception as e: - logging.exception(e) + logging.exception(f"Failed to generate rule config, model: {model_config.get('name')}") rule_config["error"] = str(e) rule_config["error"] = f"Failed to {error_step}. Error: {error}" if error else "" @@ -286,7 +286,9 @@ def generate_code( error = str(e) return {"code": "", "language": code_language, "error": f"Failed to generate code. Error: {error}"} except Exception as e: - logging.exception(e) + logging.exception( + f"Failed to invoke LLM model, model: {model_config.get('name')}, language: {code_language}" + ) return {"code": "", "language": code_language, "error": f"An unexpected error occurred: {str(e)}"} @classmethod diff --git a/api/core/model_runtime/model_providers/azure_ai_studio/rerank/rerank.py b/api/core/model_runtime/model_providers/azure_ai_studio/rerank/rerank.py index 84672520e07e57..9b75285e4022bc 100644 --- a/api/core/model_runtime/model_providers/azure_ai_studio/rerank/rerank.py +++ b/api/core/model_runtime/model_providers/azure_ai_studio/rerank/rerank.py @@ -103,7 +103,7 @@ def _invoke( return RerankResult(model=model, docs=rerank_documents) except Exception as e: - logger.exception(f"Exception in Azure rerank: {e}") + logger.exception(f"Failed to invoke rerank model, model: {model}") raise def validate_credentials(self, model: str, credentials: dict) -> None: diff --git a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py index 1cd4823e131401..95c8f36271e5d7 100644 --- a/api/core/model_runtime/model_providers/azure_openai/llm/llm.py +++ b/api/core/model_runtime/model_providers/azure_openai/llm/llm.py @@ -113,7 +113,7 @@ def validate_credentials(self, model: str, credentials: dict) -> None: try: client = AzureOpenAI(**self._to_credential_kwargs(credentials)) - if model.startswith("o1"): + if "o1" in model: client.chat.completions.create( messages=[{"role": "user", "content": "ping"}], model=model, @@ -311,7 +311,7 @@ def _chat_generate( prompt_messages = self._clear_illegal_prompt_messages(model, prompt_messages) block_as_stream = False - if model.startswith("o1"): + if "o1" in model: if stream: block_as_stream = True stream = False @@ -404,7 +404,7 @@ def _clear_illegal_prompt_messages(self, model: str, prompt_messages: list[Promp ] ) - if model.startswith("o1"): + if "o1" in model: system_message_count = len([m for m in prompt_messages if isinstance(m, SystemPromptMessage)]) if system_message_count > 0: new_prompt_messages = [] @@ -653,7 +653,7 @@ def _num_tokens_from_messages( tokens_per_message = 4 # if there's a name, the role is omitted tokens_per_name = -1 - elif model.startswith("gpt-35-turbo") or model.startswith("gpt-4") or model.startswith("o1"): + elif model.startswith("gpt-35-turbo") or model.startswith("gpt-4") or "o1" in model: tokens_per_message = 3 tokens_per_name = 1 else: diff --git a/api/core/model_runtime/model_providers/bedrock/llm/anthropic.claude-3-sonnet-v2.yaml b/api/core/model_runtime/model_providers/bedrock/llm/anthropic.claude-3-sonnet-v2.yaml index b1e56983751fdb..d30dd5d6cfda3f 100644 --- a/api/core/model_runtime/model_providers/bedrock/llm/anthropic.claude-3-sonnet-v2.yaml +++ b/api/core/model_runtime/model_providers/bedrock/llm/anthropic.claude-3-sonnet-v2.yaml @@ -16,9 +16,9 @@ parameter_rules: use_template: max_tokens required: true type: int - default: 4096 + default: 8192 min: 1 - max: 4096 + max: 8192 help: zh_Hans: 停止前生成的最大令牌数。请注意,Anthropic Claude 模型可能会在达到 max_tokens 的值之前停止生成令牌。不同的 Anthropic Claude 模型对此参数具有不同的最大值。 en_US: The maximum number of tokens to generate before stopping. Note that Anthropic Claude models might stop generating tokens before reaching the value of max_tokens. Different Anthropic Claude models have different maximum values for this parameter. diff --git a/api/core/model_runtime/model_providers/gitee_ai/llm/Qwen2.5-72B-Instruct.yaml b/api/core/model_runtime/model_providers/gitee_ai/llm/Qwen2.5-72B-Instruct.yaml new file mode 100644 index 00000000000000..cb300e5ddfc6ca --- /dev/null +++ b/api/core/model_runtime/model_providers/gitee_ai/llm/Qwen2.5-72B-Instruct.yaml @@ -0,0 +1,95 @@ +model: Qwen2.5-72B-Instruct +label: + zh_Hans: Qwen2.5-72B-Instruct + en_US: Qwen2.5-72B-Instruct +model_type: llm +features: + - agent-thought + - tool-call + - stream-tool-call +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: max_tokens + use_template: max_tokens + label: + en_US: "Max Tokens" + zh_Hans: "最大Token数" + type: int + default: 512 + min: 1 + required: true + help: + en_US: "The maximum number of tokens that can be generated by the model varies depending on the model." + zh_Hans: "模型可生成的最大 token 个数,不同模型上限不同。" + + - name: temperature + use_template: temperature + label: + en_US: "Temperature" + zh_Hans: "采样温度" + type: float + default: 0.7 + min: 0.0 + max: 1.0 + precision: 1 + required: true + help: + en_US: "The randomness of the sampling temperature control output. The temperature value is within the range of [0.0, 1.0]. The higher the value, the more random and creative the output; the lower the value, the more stable it is. It is recommended to adjust either top_p or temperature parameters according to your needs to avoid adjusting both at the same time." + zh_Hans: "采样温度控制输出的随机性。温度值在 [0.0, 1.0] 范围内,值越高,输出越随机和创造性;值越低,输出越稳定。建议根据需求调整 top_p 或 temperature 参数,避免同时调整两者。" + + - name: top_p + use_template: top_p + label: + en_US: "Top P" + zh_Hans: "Top P" + type: float + default: 0.7 + min: 0.0 + max: 1.0 + precision: 1 + required: true + help: + en_US: "The value range of the sampling method is [0.0, 1.0]. The top_p value determines that the model selects tokens from the top p% of candidate words with the highest probability; when top_p is 0, this parameter is invalid. It is recommended to adjust either top_p or temperature parameters according to your needs to avoid adjusting both at the same time." + zh_Hans: "采样方法的取值范围为 [0.0,1.0]。top_p 值确定模型从概率最高的前p%的候选词中选取 tokens;当 top_p 为 0 时,此参数无效。建议根据需求调整 top_p 或 temperature 参数,避免同时调整两者。" + + - name: top_k + use_template: top_k + label: + en_US: "Top K" + zh_Hans: "Top K" + type: int + default: 50 + min: 0 + max: 100 + required: true + help: + en_US: "The value range is [0,100], which limits the model to only select from the top k words with the highest probability when choosing the next word at each step. The larger the value, the more diverse text generation will be." + zh_Hans: "取值范围为 [0,100],限制模型在每一步选择下一个词时,只从概率最高的前 k 个词中选取。数值越大,文本生成越多样。" + + - name: frequency_penalty + use_template: frequency_penalty + label: + en_US: "Frequency Penalty" + zh_Hans: "频率惩罚" + type: float + default: 0 + min: -1.0 + max: 1.0 + precision: 1 + required: false + help: + en_US: "Used to adjust the frequency of repeated content in automatically generated text. Positive numbers reduce repetition, while negative numbers increase repetition. After setting this parameter, if a word has already appeared in the text, the model will decrease the probability of choosing that word for subsequent generation." + zh_Hans: "用于调整自动生成文本中重复内容的频率。正数减少重复,负数增加重复。设置此参数后,如果一个词在文本中已经出现过,模型在后续生成中选择该词的概率会降低。" + + - name: user + use_template: text + label: + en_US: "User" + zh_Hans: "用户" + type: string + required: false + help: + en_US: "Used to track and differentiate conversation requests from different users." + zh_Hans: "用于追踪和区分不同用户的对话请求。" diff --git a/api/core/model_runtime/model_providers/gitee_ai/llm/_position.yaml b/api/core/model_runtime/model_providers/gitee_ai/llm/_position.yaml index 21f6120742b1a1..13c31ad02b2bc4 100644 --- a/api/core/model_runtime/model_providers/gitee_ai/llm/_position.yaml +++ b/api/core/model_runtime/model_providers/gitee_ai/llm/_position.yaml @@ -1,3 +1,4 @@ +- Qwen2.5-72B-Instruct - Qwen2-7B-Instruct - Qwen2-72B-Instruct - Yi-1.5-34B-Chat diff --git a/api/core/model_runtime/model_providers/gitee_ai/llm/llm.py b/api/core/model_runtime/model_providers/gitee_ai/llm/llm.py index b65db6f6658221..1b85b7fcedf694 100644 --- a/api/core/model_runtime/model_providers/gitee_ai/llm/llm.py +++ b/api/core/model_runtime/model_providers/gitee_ai/llm/llm.py @@ -6,6 +6,7 @@ PromptMessage, PromptMessageTool, ) +from core.model_runtime.entities.model_entities import ModelFeature from core.model_runtime.model_providers.openai_api_compatible.llm.llm import OAIAPICompatLargeLanguageModel @@ -28,14 +29,13 @@ def _invoke( user: Optional[str] = None, ) -> Union[LLMResult, Generator]: self._add_custom_parameters(credentials, model, model_parameters) - return super()._invoke(model, credentials, prompt_messages, model_parameters, tools, stop, stream) + return super()._invoke(model, credentials, prompt_messages, model_parameters, tools, stop, stream, user) def validate_credentials(self, model: str, credentials: dict) -> None: self._add_custom_parameters(credentials, model, None) super().validate_credentials(model, credentials) - @staticmethod - def _add_custom_parameters(credentials: dict, model: str, model_parameters: dict) -> None: + def _add_custom_parameters(self, credentials: dict, model: str, model_parameters: dict) -> None: if model is None: model = "bge-large-zh-v1.5" @@ -45,3 +45,7 @@ def _add_custom_parameters(credentials: dict, model: str, model_parameters: dict credentials["mode"] = LLMMode.COMPLETION.value else: credentials["mode"] = LLMMode.CHAT.value + + schema = self.get_model_schema(model, credentials) + if ModelFeature.TOOL_CALL in schema.features or ModelFeature.MULTI_TOOL_CALL in schema.features: + credentials["function_calling_type"] = "tool_call" diff --git a/api/core/model_runtime/model_providers/jina/rerank/rerank.py b/api/core/model_runtime/model_providers/jina/rerank/rerank.py index 03502076517f70..aacc8e75d3ad07 100644 --- a/api/core/model_runtime/model_providers/jina/rerank/rerank.py +++ b/api/core/model_runtime/model_providers/jina/rerank/rerank.py @@ -55,6 +55,7 @@ def _invoke( base_url + "/rerank", json={"model": model, "query": query, "documents": docs, "top_n": top_n}, headers={"Authorization": f"Bearer {credentials.get('api_key')}"}, + timeout=20, ) response.raise_for_status() results = response.json() diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab7-chat-preview.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab7-chat-preview.yaml new file mode 100644 index 00000000000000..bb9899d580d5d8 --- /dev/null +++ b/api/core/model_runtime/model_providers/minimax/llm/abab7-chat-preview.yaml @@ -0,0 +1,46 @@ +model: abab7-chat-preview +label: + en_US: Abab7-chat-preview +model_type: llm +features: + - agent-thought + - tool-call + - stream-tool-call +model_properties: + mode: chat + context_size: 245760 +parameter_rules: + - name: temperature + use_template: temperature + min: 0.01 + max: 1 + default: 0.1 + - name: top_p + use_template: top_p + min: 0.01 + max: 1 + default: 0.95 + - name: max_tokens + use_template: max_tokens + required: true + default: 2048 + min: 1 + max: 245760 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. + - name: presence_penalty + use_template: presence_penalty + - name: frequency_penalty + use_template: frequency_penalty +pricing: + input: '0.1' + output: '0.1' + unit: '0.001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/minimax/llm/llm.py b/api/core/model_runtime/model_providers/minimax/llm/llm.py index 4250c40cfb94b1..ce7c00f7dab84a 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/llm.py +++ b/api/core/model_runtime/model_providers/minimax/llm/llm.py @@ -34,6 +34,7 @@ class MinimaxLargeLanguageModel(LargeLanguageModel): model_apis = { + "abab7-chat-preview": MinimaxChatCompletionPro, "abab6.5s-chat": MinimaxChatCompletionPro, "abab6.5-chat": MinimaxChatCompletionPro, "abab6-chat": MinimaxChatCompletionPro, diff --git a/api/core/model_runtime/model_providers/openai/llm/llm.py b/api/core/model_runtime/model_providers/openai/llm/llm.py index 922e5e131417ee..68317d71796189 100644 --- a/api/core/model_runtime/model_providers/openai/llm/llm.py +++ b/api/core/model_runtime/model_providers/openai/llm/llm.py @@ -617,6 +617,10 @@ def _chat_generate( # o1 compatibility block_as_stream = False if model.startswith("o1"): + if "max_tokens" in model_parameters: + model_parameters["max_completion_tokens"] = model_parameters["max_tokens"] + del model_parameters["max_tokens"] + if stream: block_as_stream = True stream = False diff --git a/api/core/model_runtime/model_providers/sagemaker/rerank/rerank.py b/api/core/model_runtime/model_providers/sagemaker/rerank/rerank.py index 49c3fa5921b6c4..df797bae265825 100644 --- a/api/core/model_runtime/model_providers/sagemaker/rerank/rerank.py +++ b/api/core/model_runtime/model_providers/sagemaker/rerank/rerank.py @@ -113,7 +113,7 @@ def _invoke( return RerankResult(model=model, docs=rerank_documents) except Exception as e: - logger.exception(f"Exception {e}, line : {line}") + logger.exception(f"Failed to invoke rerank model, model: {model}") def validate_credentials(self, model: str, credentials: dict) -> None: """ diff --git a/api/core/model_runtime/model_providers/sagemaker/speech2text/speech2text.py b/api/core/model_runtime/model_providers/sagemaker/speech2text/speech2text.py index 8fdf68abe189a7..2d50e9c7b4c28a 100644 --- a/api/core/model_runtime/model_providers/sagemaker/speech2text/speech2text.py +++ b/api/core/model_runtime/model_providers/sagemaker/speech2text/speech2text.py @@ -78,7 +78,7 @@ def _invoke(self, model: str, credentials: dict, file: IO[bytes], user: Optional json_obj = json.loads(json_str) asr_text = json_obj["text"] except Exception as e: - logger.exception(f"failed to invoke speech2text model, {e}") + logger.exception(f"failed to invoke speech2text model, model: {model}") raise CredentialsValidateFailedError(str(e)) return asr_text diff --git a/api/core/model_runtime/model_providers/sagemaker/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/sagemaker/text_embedding/text_embedding.py index ececfda11a55da..ef4ddcd6a72847 100644 --- a/api/core/model_runtime/model_providers/sagemaker/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/sagemaker/text_embedding/text_embedding.py @@ -117,7 +117,7 @@ def _invoke( return TextEmbeddingResult(embeddings=all_embeddings, usage=usage, model=model) except Exception as e: - logger.exception(f"Exception {e}, line : {line}") + logger.exception(f"Failed to invoke text embedding model, model: {model}, line: {line}") def get_num_tokens(self, model: str, credentials: dict, texts: list[str]) -> int: """ diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-26b.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-26b.yaml new file mode 100644 index 00000000000000..f7b03e1254da2c --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-26b.yaml @@ -0,0 +1,84 @@ +model: OpenGVLab/InternVL2-26B +label: + en_US: OpenGVLab/InternVL2-26B +model_type: llm +features: + - vision +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-8b.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-8b.yaml new file mode 100644 index 00000000000000..1e858bb4beb77c --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/Internvl2-8b.yaml @@ -0,0 +1,84 @@ +model: Pro/OpenGVLab/InternVL2-8B +label: + en_US: Pro/OpenGVLab/InternVL2-8B +model_type: llm +features: + - vision +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/_position.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/_position.yaml index 8d1df82140b79f..f010e4c8265d47 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/_position.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/_position.yaml @@ -1,16 +1,18 @@ +- Tencent/Hunyuan-A52B-Instruct - Qwen/Qwen2.5-72B-Instruct - Qwen/Qwen2.5-32B-Instruct - Qwen/Qwen2.5-14B-Instruct - Qwen/Qwen2.5-7B-Instruct +- Qwen/Qwen2.5-Coder-32B-Instruct - Qwen/Qwen2.5-Coder-7B-Instruct - Qwen/Qwen2.5-Math-72B-Instruct -- Qwen/Qwen2-72B-Instruct -- Qwen/Qwen2-57B-A14B-Instruct -- Qwen/Qwen2-7B-Instruct +- Qwen/Qwen2-VL-72B-Instruct - Qwen/Qwen2-1.5B-Instruct +- Pro/Qwen/Qwen2-VL-7B-Instruct +- OpenGVLab/InternVL2-Llama3-76B +- OpenGVLab/InternVL2-26B +- Pro/OpenGVLab/InternVL2-8B - deepseek-ai/DeepSeek-V2.5 -- deepseek-ai/DeepSeek-V2-Chat -- deepseek-ai/DeepSeek-Coder-V2-Instruct - THUDM/glm-4-9b-chat - 01-ai/Yi-1.5-34B-Chat-16K - 01-ai/Yi-1.5-9B-Chat-16K @@ -20,9 +22,6 @@ - meta-llama/Meta-Llama-3.1-405B-Instruct - meta-llama/Meta-Llama-3.1-70B-Instruct - meta-llama/Meta-Llama-3.1-8B-Instruct -- meta-llama/Meta-Llama-3-70B-Instruct -- meta-llama/Meta-Llama-3-8B-Instruct - google/gemma-2-27b-it - google/gemma-2-9b-it -- mistralai/Mistral-7B-Instruct-v0.2 -- mistralai/Mixtral-8x7B-Instruct-v0.1 +- deepseek-ai/DeepSeek-V2-Chat diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/deepdeek-coder-v2-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/deepdeek-coder-v2-instruct.yaml index d5f23776ea2672..b13a2a751c1be9 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/deepdeek-coder-v2-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/deepdeek-coder-v2-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '1.33' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2-chat.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2-chat.yaml index 7aa684ef3813ad..00bdb0ddf57fc9 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2-chat.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2-chat.yaml @@ -37,3 +37,4 @@ pricing: output: '1.33' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2.5.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2.5.yaml index b30fa3e2d159c0..511cc1df9f0e19 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2.5.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/deepseek-v2.5.yaml @@ -4,6 +4,8 @@ label: model_type: llm features: - agent-thought + - tool-call + - stream-tool-call model_properties: mode: chat context_size: 32768 @@ -32,6 +34,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '1.33' output: '1.33' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-27b-it.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-27b-it.yaml index f2a1f64bfb524b..7fd7adb7532969 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-27b-it.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-27b-it.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '1.26' output: '1.26' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-9b-it.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-9b-it.yaml index b096b9b647c62e..ab548e4409a1c1 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-9b-it.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/gemma-2-9b-it.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/glm4-9b-chat.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/glm4-9b-chat.yaml index 87acc557b79dba..43c5b344a03a41 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/glm4-9b-chat.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/glm4-9b-chat.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/hunyuan-a52b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/hunyuan-a52b-instruct.yaml new file mode 100644 index 00000000000000..c5489554a60456 --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/hunyuan-a52b-instruct.yaml @@ -0,0 +1,84 @@ +model: Tencent/Hunyuan-A52B-Instruct +label: + en_US: Tencent/Hunyuan-A52B-Instruct +model_type: llm +features: + - agent-thought +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-20b-chat.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-20b-chat.yaml index 60157c2b46ab89..a5ae3674c98617 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-20b-chat.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-20b-chat.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '1' output: '1' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-7b-chat.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-7b-chat.yaml index faf4af7ea3f7e4..dec856ed2e55bb 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-7b-chat.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/internlm2_5-7b-chat.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/internvl2-llama3-76b.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/internvl2-llama3-76b.yaml new file mode 100644 index 00000000000000..65386d3175fa1c --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/internvl2-llama3-76b.yaml @@ -0,0 +1,84 @@ +model: OpenGVLab/InternVL2-Llama3-76B +label: + en_US: OpenGVLab/InternVL2-Llama3-76B +model_type: llm +features: + - vision +model_properties: + mode: chat + context_size: 8192 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/llm.py b/api/core/model_runtime/model_providers/siliconflow/llm/llm.py index 6015442c2b2405..e3a323a4965bc7 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/llm.py +++ b/api/core/model_runtime/model_providers/siliconflow/llm/llm.py @@ -29,6 +29,9 @@ def _invoke( user: Optional[str] = None, ) -> Union[LLMResult, Generator]: self._add_custom_parameters(credentials) + # {"response_format": "json_object"} need convert to {"response_format": {"type": "json_object"}} + if "response_format" in model_parameters: + model_parameters["response_format"] = {"type": model_parameters.get("response_format")} return super()._invoke(model, credentials, prompt_messages, model_parameters, tools, stop, stream) def validate_credentials(self, model: str, credentials: dict) -> None: diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-70b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-70b-instruct.yaml index d01770cb0106bb..98250907595206 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-70b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-70b-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '4.13' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-8b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-8b-instruct.yaml index 3cd75d89e8bc84..0133fd15d45c2e 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-8b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3-8b-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '0' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-405b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-405b-instruct.yaml index 3506a70bccf9ce..ceebbac5150f83 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-405b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-405b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '21' output: '21' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-70b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-70b-instruct.yaml index 994a754a82b83c..f1fbb74cbdea5f 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-70b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-70b-instruct.yaml @@ -6,7 +6,7 @@ features: - agent-thought model_properties: mode: chat - context_size: 32768 + context_size: 8192 parameter_rules: - name: temperature use_template: temperature @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '4.13' output: '4.13' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-8b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-8b-instruct.yaml index ebfa9aac9d9de0..a9a43545e88ae3 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-8b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/meta-mlama-3.1-8b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-57b-a14b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-57b-a14b-instruct.yaml index b2461335f84d6e..0f56d16d9b3d5a 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-57b-a14b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-57b-a14b-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '1.26' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-72b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-72b-instruct.yaml index e0f23bd89eb0e3..af65cfb8ed758e 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-72b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-72b-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '4.13' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-7b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-7b-instruct.yaml index 47a9da8119cf42..f0f10ae6252685 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-7b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-7b-instruct.yaml @@ -37,3 +37,4 @@ pricing: output: '0' unit: '0.000001' currency: RMB +deprecated: true diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-72b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-72b-instruct.yaml new file mode 100644 index 00000000000000..1866a684b55b60 --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-72b-instruct.yaml @@ -0,0 +1,84 @@ +model: Qwen/Qwen2-VL-72B-Instruct +label: + en_US: Qwen/Qwen2-VL-72B-Instruct +model_type: llm +features: + - vision +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-7b-Instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-7b-Instruct.yaml new file mode 100644 index 00000000000000..a50834468922f9 --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2-vl-7b-Instruct.yaml @@ -0,0 +1,84 @@ +model: Pro/Qwen/Qwen2-VL-7B-Instruct +label: + en_US: Pro/Qwen/Qwen2-VL-7B-Instruct +model_type: llm +features: + - vision +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 2000 + min: 1 + max: 2000 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '21' + output: '21' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-14b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-14b-instruct.yaml index 9cc5ac4c91d653..8a045b818aea53 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-14b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-14b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0.7' output: '0.7' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-32b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-32b-instruct.yaml index c7fb21e9e10c28..9c308d2ab48a2e 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-32b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-32b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '1.26' output: '1.26' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-72b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-72b-instruct.yaml index 03136c88a11fb1..c80cd45dd302cd 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-72b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-72b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '4.13' output: '4.13' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-7b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-7b-instruct.yaml index 99412adde7a209..bb85dbe948c9d7 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-7b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-7b-instruct.yaml @@ -32,6 +32,18 @@ parameter_rules: required: false - name: frequency_penalty use_template: frequency_penalty + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-32b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-32b-instruct.yaml new file mode 100644 index 00000000000000..de2224a67b1f57 --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-32b-instruct.yaml @@ -0,0 +1,84 @@ +model: Qwen/Qwen2.5-Coder-32B-Instruct +label: + en_US: Qwen/Qwen2.5-Coder-32B-Instruct +model_type: llm +features: + - agent-thought +model_properties: + mode: chat + context_size: 32768 +parameter_rules: + - name: temperature + use_template: temperature + type: float + default: 0.3 + min: 0.0 + max: 2.0 + help: + zh_Hans: 用于控制随机性和多样性的程度。具体来说,temperature值控制了生成文本时对每个候选词的概率分布进行平滑的程度。较高的temperature值会降低概率分布的峰值,使得更多的低概率词被选择,生成结果更加多样化;而较低的temperature值则会增强概率分布的峰值,使得高概率词更容易被选择,生成结果更加确定。 + en_US: Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected. , the generated results are more certain. + - name: max_tokens + use_template: max_tokens + type: int + default: 8192 + min: 1 + max: 8192 + help: + zh_Hans: 用于指定模型在生成内容时token的最大数量,它定义了生成的上限,但不保证每次都会生成到这个数量。 + en_US: It is used to specify the maximum number of tokens when the model generates content. It defines the upper limit of generation, but does not guarantee that this number will be generated every time. + - name: top_p + use_template: top_p + type: float + default: 0.8 + min: 0.1 + max: 0.9 + help: + zh_Hans: 生成过程中核采样方法概率阈值,例如,取值为0.8时,仅保留概率加起来大于等于0.8的最可能token的最小集合作为候选集。取值范围为(0,1.0),取值越大,生成的随机性越高;取值越低,生成的确定性越高。 + en_US: The probability threshold of the kernel sampling method during the generation process. For example, when the value is 0.8, only the smallest set of the most likely tokens with a sum of probabilities greater than or equal to 0.8 is retained as the candidate set. The value range is (0,1.0). The larger the value, the higher the randomness generated; the lower the value, the higher the certainty generated. + - name: top_k + type: int + min: 0 + max: 99 + label: + zh_Hans: 取样数量 + en_US: Top k + help: + zh_Hans: 生成时,采样候选集的大小。例如,取值为50时,仅将单次生成中得分最高的50个token组成随机采样的候选集。取值越大,生成的随机性越高;取值越小,生成的确定性越高。 + en_US: The size of the sample candidate set when generated. For example, when the value is 50, only the 50 highest-scoring tokens in a single generation form a randomly sampled candidate set. The larger the value, the higher the randomness generated; the smaller the value, the higher the certainty generated. + - name: seed + required: false + type: int + default: 1234 + label: + zh_Hans: 随机种子 + en_US: Random seed + help: + zh_Hans: 生成时使用的随机数种子,用户控制模型生成内容的随机性。支持无符号64位整数,默认值为 1234。在使用seed时,模型将尽可能生成相同或相似的结果,但目前不保证每次生成的结果完全相同。 + en_US: The random number seed used when generating, the user controls the randomness of the content generated by the model. Supports unsigned 64-bit integers, default value is 1234. When using seed, the model will try its best to generate the same or similar results, but there is currently no guarantee that the results will be exactly the same every time. + - name: repetition_penalty + required: false + type: float + default: 1.1 + label: + zh_Hans: 重复惩罚 + en_US: Repetition penalty + help: + zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 + en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. + - name: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object +pricing: + input: '1.26' + output: '1.26' + unit: '0.000001' + currency: RMB diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-7b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-7b-instruct.yaml index 76526200ccdccc..c31a338cdd898d 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-7b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-coder-7b-instruct.yaml @@ -66,7 +66,17 @@ parameter_rules: zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. - name: response_format - use_template: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '0' output: '0' diff --git a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-math-72b-instruct.yaml b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-math-72b-instruct.yaml index 90afa0cfd5b96a..1b6f2603f5eabe 100644 --- a/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-math-72b-instruct.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/llm/qwen2.5-math-72b-instruct.yaml @@ -66,7 +66,17 @@ parameter_rules: zh_Hans: 用于控制模型生成时的重复度。提高repetition_penalty时可以降低模型生成的重复度。1.0表示不做惩罚。 en_US: Used to control the repeatability when generating models. Increasing repetition_penalty can reduce the duplication of model generation. 1.0 means no punishment. - name: response_format - use_template: response_format + label: + zh_Hans: 回复格式 + en_US: Response Format + type: string + help: + zh_Hans: 指定模型必须输出的格式 + en_US: specifying the format that the model must output + required: false + options: + - text + - json_object pricing: input: '4.13' output: '4.13' diff --git a/api/core/model_runtime/model_providers/siliconflow/speech2text/funaudio-sense-voice-small.yaml b/api/core/model_runtime/model_providers/siliconflow/speech2text/funaudio-sense-voice-small.yaml new file mode 100644 index 00000000000000..d4bc33c68ea300 --- /dev/null +++ b/api/core/model_runtime/model_providers/siliconflow/speech2text/funaudio-sense-voice-small.yaml @@ -0,0 +1,5 @@ +model: FunAudioLLM/SenseVoiceSmall +model_type: speech2text +model_properties: + file_upload_limit: 1 + supported_file_extensions: mp3,wav diff --git a/api/core/model_runtime/model_providers/siliconflow/speech2text/sense-voice-small.yaml b/api/core/model_runtime/model_providers/siliconflow/speech2text/sense-voice-small.yaml index deceaf60f4f017..455b2ad4671c2f 100644 --- a/api/core/model_runtime/model_providers/siliconflow/speech2text/sense-voice-small.yaml +++ b/api/core/model_runtime/model_providers/siliconflow/speech2text/sense-voice-small.yaml @@ -3,3 +3,4 @@ model_type: speech2text model_properties: file_upload_limit: 1 supported_file_extensions: mp3,wav +deprecated: true diff --git a/api/core/model_runtime/model_providers/vertex_ai/llm/anthropic.claude-3.5-sonnet-v2.yaml b/api/core/model_runtime/model_providers/vertex_ai/llm/anthropic.claude-3.5-sonnet-v2.yaml index 0be3e26e7ad851..37b9f30cc3927a 100644 --- a/api/core/model_runtime/model_providers/vertex_ai/llm/anthropic.claude-3.5-sonnet-v2.yaml +++ b/api/core/model_runtime/model_providers/vertex_ai/llm/anthropic.claude-3.5-sonnet-v2.yaml @@ -13,9 +13,9 @@ parameter_rules: use_template: max_tokens required: true type: int - default: 4096 + default: 8192 min: 1 - max: 4096 + max: 8192 help: zh_Hans: 停止前生成的最大令牌数。请注意,Anthropic Claude 模型可能会在达到 max_tokens 的值之前停止生成令牌。不同的 Anthropic Claude 模型对此参数具有不同的最大值。 en_US: The maximum number of tokens to generate before stopping. Note that Anthropic Claude models might stop generating tokens before reaching the value of max_tokens. Different Anthropic Claude models have different maximum values for this parameter. diff --git a/api/core/model_runtime/model_providers/vessl_ai/vessl_ai.yaml b/api/core/model_runtime/model_providers/vessl_ai/vessl_ai.yaml index 6052756cae4887..2138b281b98107 100644 --- a/api/core/model_runtime/model_providers/vessl_ai/vessl_ai.yaml +++ b/api/core/model_runtime/model_providers/vessl_ai/vessl_ai.yaml @@ -1,6 +1,6 @@ provider: vessl_ai label: - en_US: vessl_ai + en_US: VESSL AI icon_small: en_US: icon_s_en.svg icon_large: @@ -20,28 +20,28 @@ model_credential_schema: label: en_US: Model Name placeholder: - en_US: Enter your model name + en_US: Enter model name credential_form_schemas: - variable: endpoint_url label: - en_US: endpoint url + en_US: Endpoint Url type: text-input required: true placeholder: - en_US: Enter the url of your endpoint url + en_US: Enter VESSL AI service endpoint url - variable: api_key required: true label: en_US: API Key type: secret-input placeholder: - en_US: Enter your VESSL AI secret key + en_US: Enter VESSL AI secret key - variable: mode show_on: - variable: __model_type value: llm label: - en_US: Completion mode + en_US: Completion Mode type: select required: false default: chat diff --git a/api/core/model_runtime/model_providers/volcengine_maas/legacy/volc_sdk/common.py b/api/core/model_runtime/model_providers/volcengine_maas/legacy/volc_sdk/common.py index 3825fd65741ef5..0bfb18cda6d9f7 100644 --- a/api/core/model_runtime/model_providers/volcengine_maas/legacy/volc_sdk/common.py +++ b/api/core/model_runtime/model_providers/volcengine_maas/legacy/volc_sdk/common.py @@ -1,5 +1,6 @@ import json import random +from collections import UserDict from datetime import datetime @@ -10,9 +11,9 @@ class ChatRole: FUNCTION = "function" -class _Dict(dict): - __setattr__ = dict.__setitem__ - __getattr__ = dict.__getitem__ +class _Dict(UserDict): + __setattr__ = UserDict.__setitem__ + __getattr__ = UserDict.__getitem__ def __missing__(self, key): return None diff --git a/api/core/moderation/output_moderation.py b/api/core/moderation/output_moderation.py index 83f4d2d57d128e..4635bd9c251851 100644 --- a/api/core/moderation/output_moderation.py +++ b/api/core/moderation/output_moderation.py @@ -126,6 +126,6 @@ def moderation(self, tenant_id: str, app_id: str, moderation_buffer: str) -> Opt result: ModerationOutputsResult = moderation_factory.moderation_for_outputs(moderation_buffer) return result except Exception as e: - logger.exception("Moderation Output error: %s", e) + logger.exception(f"Moderation Output error, app_id: {app_id}") return None diff --git a/api/core/ops/ops_trace_manager.py b/api/core/ops/ops_trace_manager.py index 79704c115f1d0a..1069889abda965 100644 --- a/api/core/ops/ops_trace_manager.py +++ b/api/core/ops/ops_trace_manager.py @@ -711,7 +711,7 @@ def add_trace_task(self, trace_task: TraceTask): trace_task.app_id = self.app_id trace_manager_queue.put(trace_task) except Exception as e: - logging.exception(f"Error adding trace task: {e}") + logging.exception(f"Error adding trace task, trace_type {trace_task.trace_type}") finally: self.start_timer() @@ -730,7 +730,7 @@ def run(self): if tasks: self.send_to_celery(tasks) except Exception as e: - logging.exception(f"Error processing trace tasks: {e}") + logging.exception("Error processing trace tasks") def start_timer(self): global trace_manager_timer diff --git a/api/core/rag/datasource/vdb/couchbase/couchbase_vector.py b/api/core/rag/datasource/vdb/couchbase/couchbase_vector.py index 98da5e3d5e91a4..d26726e86438bd 100644 --- a/api/core/rag/datasource/vdb/couchbase/couchbase_vector.py +++ b/api/core/rag/datasource/vdb/couchbase/couchbase_vector.py @@ -242,7 +242,7 @@ def delete_by_ids(self, ids: list[str]) -> None: try: self._cluster.query(query, named_parameters={"doc_ids": ids}).execute() except Exception as e: - logger.exception(e) + logger.exception(f"Failed to delete documents, ids: {ids}") def delete_by_document_id(self, document_id: str): query = f""" diff --git a/api/core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py b/api/core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py index c62042af8071d1..b08811a02181d2 100644 --- a/api/core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py +++ b/api/core/rag/datasource/vdb/elasticsearch/elasticsearch_vector.py @@ -178,6 +178,7 @@ def create_collection( Field.VECTOR.value: { # Make sure the dimension is correct here "type": "dense_vector", "dims": dim, + "index": True, "similarity": "cosine", }, Field.METADATA_KEY.value: { diff --git a/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py b/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py index 30d7f09ec20ccf..60a1a89f1a0b1e 100644 --- a/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py +++ b/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py @@ -79,7 +79,7 @@ def __fetch_existing_ids(batch_ids: list[str]) -> set[str]: existing_docs = self._client.mget(index=self._collection_name, body={"ids": batch_ids}, _source=False) return {doc["_id"] for doc in existing_docs["docs"] if doc["found"]} except Exception as e: - logger.exception(f"Error fetching batch {batch_ids}: {e}") + logger.exception(f"Error fetching batch {batch_ids}") return set() @retry(stop=stop_after_attempt(3), wait=wait_fixed(60)) @@ -96,7 +96,7 @@ def __fetch_existing_routing_ids(batch_ids: list[str], route_ids: list[str]) -> ) return {doc["_id"] for doc in existing_docs["docs"] if doc["found"]} except Exception as e: - logger.exception(f"Error fetching batch {batch_ids}: {e}") + logger.exception(f"Error fetching batch ids: {batch_ids}") return set() if ids is None: @@ -177,7 +177,7 @@ def delete(self) -> None: else: logger.warning(f"Index '{self._collection_name}' does not exist. No deletion performed.") except Exception as e: - logger.exception(f"Error occurred while deleting the index: {e}") + logger.exception(f"Error occurred while deleting the index: {self._collection_name}") raise e def text_exists(self, id: str) -> bool: @@ -201,7 +201,7 @@ def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Doc try: response = self._client.search(index=self._collection_name, body=query) except Exception as e: - logger.exception(f"Error executing search: {e}") + logger.exception(f"Error executing vector search, query: {query}") raise docs_and_scores = [] diff --git a/api/core/rag/datasource/vdb/myscale/myscale_vector.py b/api/core/rag/datasource/vdb/myscale/myscale_vector.py index 2610b60a7799da..b7b6b803ad20af 100644 --- a/api/core/rag/datasource/vdb/myscale/myscale_vector.py +++ b/api/core/rag/datasource/vdb/myscale/myscale_vector.py @@ -142,7 +142,7 @@ def _search(self, dist: str, order: SortOrder, **kwargs: Any) -> list[Document]: for r in self._client.query(sql).named_results() ] except Exception as e: - logging.exception(f"\033[91m\033[1m{type(e)}\033[0m \033[95m{str(e)}\033[0m") + logging.exception(f"\033[91m\033[1m{type(e)}\033[0m \033[95m{str(e)}\033[0m") # noqa:TRY401 return [] def delete(self) -> None: diff --git a/api/core/rag/datasource/vdb/opensearch/opensearch_vector.py b/api/core/rag/datasource/vdb/opensearch/opensearch_vector.py index 49eb00f14009ef..7a976d7c3c8955 100644 --- a/api/core/rag/datasource/vdb/opensearch/opensearch_vector.py +++ b/api/core/rag/datasource/vdb/opensearch/opensearch_vector.py @@ -158,7 +158,7 @@ def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Doc try: response = self._client.search(index=self._collection_name.lower(), body=query) except Exception as e: - logger.exception(f"Error executing search: {e}") + logger.exception(f"Error executing vector search, query: {query}") raise docs = [] diff --git a/api/core/rag/embedding/cached_embedding.py b/api/core/rag/embedding/cached_embedding.py index 3ac65b88bb70de..1157c5c8e44a53 100644 --- a/api/core/rag/embedding/cached_embedding.py +++ b/api/core/rag/embedding/cached_embedding.py @@ -69,7 +69,7 @@ def embed_documents(self, texts: list[str]) -> list[list[float]]: except IntegrityError: db.session.rollback() except Exception as e: - logging.exception("Failed transform embedding: %s", e) + logging.exception("Failed transform embedding") cache_embeddings = [] try: for i, embedding in zip(embedding_queue_indices, embedding_queue_embeddings): @@ -89,7 +89,7 @@ def embed_documents(self, texts: list[str]) -> list[list[float]]: db.session.rollback() except Exception as ex: db.session.rollback() - logger.exception("Failed to embed documents: %s", ex) + logger.exception("Failed to embed documents: %s") raise ex return text_embeddings @@ -112,7 +112,7 @@ def embed_query(self, text: str) -> list[float]: embedding_results = (embedding_results / np.linalg.norm(embedding_results)).tolist() except Exception as ex: if dify_config.DEBUG: - logging.exception(f"Failed to embed query text: {ex}") + logging.exception(f"Failed to embed query text '{text[:10]}...({len(text)} chars)'") raise ex try: @@ -126,7 +126,7 @@ def embed_query(self, text: str) -> list[float]: redis_client.setex(embedding_cache_key, 600, encoded_str) except Exception as ex: if dify_config.DEBUG: - logging.exception("Failed to add embedding to redis %s", ex) + logging.exception(f"Failed to add embedding to redis for the text '{text[:10]}...({len(text)} chars)'") raise ex return embedding_results diff --git a/api/core/rag/extractor/word_extractor.py b/api/core/rag/extractor/word_extractor.py index b59e7f94fd5013..313bdce48b0a31 100644 --- a/api/core/rag/extractor/word_extractor.py +++ b/api/core/rag/extractor/word_extractor.py @@ -50,9 +50,9 @@ def __init__(self, file_path: str, tenant_id: str, user_id: str): self.web_path = self.file_path # TODO: use a better way to handle the file - with tempfile.NamedTemporaryFile(delete=False) as self.temp_file: - self.temp_file.write(r.content) - self.file_path = self.temp_file.name + self.temp_file = tempfile.NamedTemporaryFile() # noqa: SIM115 + self.temp_file.write(r.content) + self.file_path = self.temp_file.name elif not os.path.isfile(self.file_path): raise ValueError(f"File path {self.file_path} is not a valid file or url") @@ -229,7 +229,7 @@ def parse_docx(self, docx_path, image_folder): for i in url_pattern.findall(x.text): hyperlinks_url = str(i) except Exception as e: - logger.exception(e) + logger.exception("Failed to parse HYPERLINK xml") def parse_paragraph(paragraph): paragraph_content = [] diff --git a/api/core/rag/index_processor/processor/qa_index_processor.py b/api/core/rag/index_processor/processor/qa_index_processor.py index 1dbc473281daf6..48e6cf7df7f30a 100644 --- a/api/core/rag/index_processor/processor/qa_index_processor.py +++ b/api/core/rag/index_processor/processor/qa_index_processor.py @@ -159,7 +159,7 @@ def _format_qa_document(self, flask_app: Flask, tenant_id: str, document_node, a qa_documents.append(qa_document) format_documents.extend(qa_documents) except Exception as e: - logging.exception(e) + logging.exception("Failed to format qa document") all_qa_documents.extend(format_documents) diff --git a/api/core/tools/entities/api_entities.py b/api/core/tools/entities/api_entities.py index b1db5594414470..ddb1481276df67 100644 --- a/api/core/tools/entities/api_entities.py +++ b/api/core/tools/entities/api_entities.py @@ -1,6 +1,6 @@ from typing import Literal, Optional -from pydantic import BaseModel +from pydantic import BaseModel, Field, field_validator from core.model_runtime.utils.encoders import jsonable_encoder from core.tools.entities.common_entities import I18nObject @@ -32,9 +32,14 @@ class UserToolProvider(BaseModel): original_credentials: Optional[dict] = None is_team_authorization: bool = False allow_delete: bool = True - tools: list[UserTool] | None = None + tools: list[UserTool] = Field(default_factory=list) labels: list[str] | None = None + @field_validator("tools", mode="before") + @classmethod + def convert_none_to_empty_list(cls, v): + return v if v is not None else [] + def to_dict(self) -> dict: # ------------- # overwrite tool parameter types for temp fix diff --git a/api/core/tools/provider/_position.yaml b/api/core/tools/provider/_position.yaml index d80974486dfcfd..937fb40774cbac 100644 --- a/api/core/tools/provider/_position.yaml +++ b/api/core/tools/provider/_position.yaml @@ -78,3 +78,4 @@ - regex - trello - vanna +- fal diff --git a/api/core/tools/provider/builtin/audio/_assets/icon.svg b/api/core/tools/provider/builtin/audio/_assets/icon.svg new file mode 100644 index 00000000000000..08cc4ede66b90e --- /dev/null +++ b/api/core/tools/provider/builtin/audio/_assets/icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/api/core/tools/provider/builtin/audio/audio.py b/api/core/tools/provider/builtin/audio/audio.py new file mode 100644 index 00000000000000..1f15386f78a058 --- /dev/null +++ b/api/core/tools/provider/builtin/audio/audio.py @@ -0,0 +1,6 @@ +from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController + + +class AudioToolProvider(BuiltinToolProviderController): + def _validate_credentials(self, credentials: dict) -> None: + pass diff --git a/api/core/tools/provider/builtin/audio/audio.yaml b/api/core/tools/provider/builtin/audio/audio.yaml new file mode 100644 index 00000000000000..07db268dacc446 --- /dev/null +++ b/api/core/tools/provider/builtin/audio/audio.yaml @@ -0,0 +1,11 @@ +identity: + author: hjlarry + name: audio + label: + en_US: Audio + description: + en_US: A tool for tts and asr. + zh_Hans: 一个用于文本转语音和语音转文本的工具。 + icon: icon.svg + tags: + - utilities diff --git a/api/core/tools/provider/builtin/audio/tools/asr.py b/api/core/tools/provider/builtin/audio/tools/asr.py new file mode 100644 index 00000000000000..2aa409cd1ac082 --- /dev/null +++ b/api/core/tools/provider/builtin/audio/tools/asr.py @@ -0,0 +1,69 @@ +import io +from typing import Any + +from core.file.enums import FileType +from core.file.file_manager import download +from core.model_manager import ModelManager +from core.model_runtime.entities.model_entities import ModelType +from core.tools.entities.common_entities import I18nObject +from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter, ToolParameterOption +from core.tools.tool.builtin_tool import BuiltinTool +from services.model_provider_service import ModelProviderService + + +class ASRTool(BuiltinTool): + def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> list[ToolInvokeMessage]: + file = tool_parameters.get("audio_file") + if file.type != FileType.AUDIO: + return [self.create_text_message("not a valid audio file")] + audio_binary = io.BytesIO(download(file)) + audio_binary.name = "temp.mp3" + provider, model = tool_parameters.get("model").split("#") + model_manager = ModelManager() + model_instance = model_manager.get_model_instance( + tenant_id=self.runtime.tenant_id, + provider=provider, + model_type=ModelType.SPEECH2TEXT, + model=model, + ) + text = model_instance.invoke_speech2text( + file=audio_binary, + user=user_id, + ) + return [self.create_text_message(text)] + + def get_available_models(self) -> list[tuple[str, str]]: + model_provider_service = ModelProviderService() + models = model_provider_service.get_models_by_model_type( + tenant_id=self.runtime.tenant_id, model_type="speech2text" + ) + items = [] + for provider_model in models: + provider = provider_model.provider + for model in provider_model.models: + items.append((provider, model.model)) + return items + + def get_runtime_parameters(self) -> list[ToolParameter]: + parameters = [] + + options = [] + for provider, model in self.get_available_models(): + option = ToolParameterOption(value=f"{provider}#{model}", label=I18nObject(en_US=f"{model}({provider})")) + options.append(option) + + parameters.append( + ToolParameter( + name="model", + label=I18nObject(en_US="Model", zh_Hans="Model"), + human_description=I18nObject( + en_US="All available ASR models. You can config model in the Model Provider of Settings.", + zh_Hans="所有可用的 ASR 模型。你可以在设置中的模型供应商里配置。", + ), + type=ToolParameter.ToolParameterType.SELECT, + form=ToolParameter.ToolParameterForm.FORM, + required=True, + options=options, + ) + ) + return parameters diff --git a/api/core/tools/provider/builtin/audio/tools/asr.yaml b/api/core/tools/provider/builtin/audio/tools/asr.yaml new file mode 100644 index 00000000000000..b2c82f8086379d --- /dev/null +++ b/api/core/tools/provider/builtin/audio/tools/asr.yaml @@ -0,0 +1,22 @@ +identity: + name: asr + author: hjlarry + label: + en_US: Speech To Text +description: + human: + en_US: Convert audio file to text. + zh_Hans: 将音频文件转换为文本。 + llm: Convert audio file to text. +parameters: + - name: audio_file + type: file + required: true + label: + en_US: Audio File + zh_Hans: 音频文件 + human_description: + en_US: The audio file to be converted. + zh_Hans: 要转换的音频文件。 + llm_description: The audio file to be converted. + form: llm diff --git a/api/core/tools/provider/builtin/audio/tools/tts.py b/api/core/tools/provider/builtin/audio/tools/tts.py new file mode 100644 index 00000000000000..f83a64d041faab --- /dev/null +++ b/api/core/tools/provider/builtin/audio/tools/tts.py @@ -0,0 +1,89 @@ +import io +from typing import Any + +from core.model_manager import ModelManager +from core.model_runtime.entities.model_entities import ModelPropertyKey, ModelType +from core.tools.entities.common_entities import I18nObject +from core.tools.entities.tool_entities import ToolInvokeMessage, ToolParameter, ToolParameterOption +from core.tools.tool.builtin_tool import BuiltinTool +from services.model_provider_service import ModelProviderService + + +class TTSTool(BuiltinTool): + def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> list[ToolInvokeMessage]: + provider, model = tool_parameters.get("model").split("#") + voice = tool_parameters.get(f"voice#{provider}#{model}") + model_manager = ModelManager() + model_instance = model_manager.get_model_instance( + tenant_id=self.runtime.tenant_id, + provider=provider, + model_type=ModelType.TTS, + model=model, + ) + tts = model_instance.invoke_tts( + content_text=tool_parameters.get("text"), + user=user_id, + tenant_id=self.runtime.tenant_id, + voice=voice, + ) + buffer = io.BytesIO() + for chunk in tts: + buffer.write(chunk) + + wav_bytes = buffer.getvalue() + return [ + self.create_text_message("Audio generated successfully"), + self.create_blob_message( + blob=wav_bytes, + meta={"mime_type": "audio/x-wav"}, + save_as=self.VariableKey.AUDIO, + ), + ] + + def get_available_models(self) -> list[tuple[str, str, list[Any]]]: + model_provider_service = ModelProviderService() + models = model_provider_service.get_models_by_model_type(tenant_id=self.runtime.tenant_id, model_type="tts") + items = [] + for provider_model in models: + provider = provider_model.provider + for model in provider_model.models: + voices = model.model_properties.get(ModelPropertyKey.VOICES, []) + items.append((provider, model.model, voices)) + return items + + def get_runtime_parameters(self) -> list[ToolParameter]: + parameters = [] + + options = [] + for provider, model, voices in self.get_available_models(): + option = ToolParameterOption(value=f"{provider}#{model}", label=I18nObject(en_US=f"{model}({provider})")) + options.append(option) + parameters.append( + ToolParameter( + name=f"voice#{provider}#{model}", + label=I18nObject(en_US=f"Voice of {model}({provider})"), + type=ToolParameter.ToolParameterType.SELECT, + form=ToolParameter.ToolParameterForm.FORM, + options=[ + ToolParameterOption(value=voice.get("mode"), label=I18nObject(en_US=voice.get("name"))) + for voice in voices + ], + ) + ) + + parameters.insert( + 0, + ToolParameter( + name="model", + label=I18nObject(en_US="Model", zh_Hans="Model"), + human_description=I18nObject( + en_US="All available TTS models. You can config model in the Model Provider of Settings.", + zh_Hans="所有可用的 TTS 模型。你可以在设置中的模型供应商里配置。", + ), + type=ToolParameter.ToolParameterType.SELECT, + form=ToolParameter.ToolParameterForm.FORM, + required=True, + options=options, + ), + ) + return parameters diff --git a/api/core/tools/provider/builtin/audio/tools/tts.yaml b/api/core/tools/provider/builtin/audio/tools/tts.yaml new file mode 100644 index 00000000000000..36f42bd689fc71 --- /dev/null +++ b/api/core/tools/provider/builtin/audio/tools/tts.yaml @@ -0,0 +1,22 @@ +identity: + name: tts + author: hjlarry + label: + en_US: Text To Speech +description: + human: + en_US: Convert text to audio file. + zh_Hans: 将文本转换为音频文件。 + llm: Convert text to audio file. +parameters: + - name: text + type: string + required: true + label: + en_US: Text + zh_Hans: 文本 + human_description: + en_US: The text to be converted. + zh_Hans: 要转换的文本。 + llm_description: The text to be converted. + form: llm diff --git a/api/core/tools/provider/builtin/email/_assets/icon.svg b/api/core/tools/provider/builtin/email/_assets/icon.svg new file mode 100644 index 00000000000000..b34f333890bc1a --- /dev/null +++ b/api/core/tools/provider/builtin/email/_assets/icon.svg @@ -0,0 +1 @@ + diff --git a/api/core/tools/provider/builtin/email/email.py b/api/core/tools/provider/builtin/email/email.py new file mode 100644 index 00000000000000..182d8dac28efea --- /dev/null +++ b/api/core/tools/provider/builtin/email/email.py @@ -0,0 +1,7 @@ +from core.tools.provider.builtin.email.tools.send_mail import SendMailTool +from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController + + +class SmtpProvider(BuiltinToolProviderController): + def _validate_credentials(self, credentials: dict) -> None: + SendMailTool() diff --git a/api/core/tools/provider/builtin/email/email.yaml b/api/core/tools/provider/builtin/email/email.yaml new file mode 100644 index 00000000000000..bb1bb7f6f3e972 --- /dev/null +++ b/api/core/tools/provider/builtin/email/email.yaml @@ -0,0 +1,83 @@ +identity: + author: wakaka6 + name: email + label: + en_US: email + zh_Hans: 电子邮件 + description: + en_US: send email through smtp protocol + zh_Hans: 通过smtp协议发送电子邮件 + icon: icon.svg + tags: + - utilities +credentials_for_provider: + email_account: + type: text-input + required: true + label: + en_US: email account + zh_Hans: 邮件账号 + placeholder: + en_US: input you email account + zh_Hans: 输入你的邮箱账号 + help: + en_US: email account + zh_Hans: 邮件账号 + email_password: + type: secret-input + required: true + label: + en_US: email password + zh_Hans: 邮件密码 + placeholder: + en_US: email password + zh_Hans: 邮件密码 + help: + en_US: email password + zh_Hans: 邮件密码 + smtp_server: + type: text-input + required: true + label: + en_US: smtp server + zh_Hans: 发信smtp服务器地址 + placeholder: + en_US: smtp server + zh_Hans: 发信smtp服务器地址 + help: + en_US: smtp server + zh_Hans: 发信smtp服务器地址 + smtp_port: + type: text-input + required: true + label: + en_US: smtp server port + zh_Hans: 发信smtp服务器端口 + placeholder: + en_US: smtp server port + zh_Hans: 发信smtp服务器端口 + help: + en_US: smtp server port + zh_Hans: 发信smtp服务器端口 + encrypt_method: + type: select + required: true + options: + - value: NONE + label: + en_US: NONE + zh_Hans: 无加密 + - value: SSL + label: + en_US: SSL + zh_Hans: SSL加密 + - value: TLS + label: + en_US: START TLS + zh_Hans: START TLS加密 + label: + en_US: encrypt method + zh_Hans: 加密方式 + help: + en_US: smtp server encrypt method + zh_Hans: 发信smtp服务器加密方式 diff --git a/api/core/tools/provider/builtin/email/tools/send.py b/api/core/tools/provider/builtin/email/tools/send.py new file mode 100644 index 00000000000000..bf9e63e1ef5506 --- /dev/null +++ b/api/core/tools/provider/builtin/email/tools/send.py @@ -0,0 +1,53 @@ +import logging +import smtplib +import ssl +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText + +from pydantic import BaseModel + + +class SendEmailToolParameters(BaseModel): + smtp_server: str + smtp_port: int + + email_account: str + email_password: str + + sender_to: str + subject: str + email_content: str + encrypt_method: str + + +def send_mail(parmas: SendEmailToolParameters): + timeout = 60 + msg = MIMEMultipart("alternative") + msg["From"] = parmas.email_account + msg["To"] = parmas.sender_to + msg["Subject"] = parmas.subject + msg.attach(MIMEText(parmas.email_content, "plain")) + msg.attach(MIMEText(parmas.email_content, "html")) + + ctx = ssl.create_default_context() + + if parmas.encrypt_method.upper() == "SSL": + try: + with smtplib.SMTP_SSL(parmas.smtp_server, parmas.smtp_port, context=ctx, timeout=timeout) as server: + server.login(parmas.email_account, parmas.email_password) + server.sendmail(parmas.email_account, parmas.sender_to, msg.as_string()) + return True + except Exception as e: + logging.exception("send email failed") + return False + else: # NONE or TLS + try: + with smtplib.SMTP(parmas.smtp_server, parmas.smtp_port, timeout=timeout) as server: + if parmas.encrypt_method.upper() == "TLS": + server.starttls(context=ctx) + server.login(parmas.email_account, parmas.email_password) + server.sendmail(parmas.email_account, parmas.sender_to, msg.as_string()) + return True + except Exception as e: + logging.exception("send email failed") + return False diff --git a/api/core/tools/provider/builtin/email/tools/send_mail.py b/api/core/tools/provider/builtin/email/tools/send_mail.py new file mode 100644 index 00000000000000..d51d5439b78671 --- /dev/null +++ b/api/core/tools/provider/builtin/email/tools/send_mail.py @@ -0,0 +1,66 @@ +import re +from typing import Any, Union + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.provider.builtin.email.tools.send import ( + SendEmailToolParameters, + send_mail, +) +from core.tools.tool.builtin_tool import BuiltinTool + + +class SendMailTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + """ + invoke tools + """ + sender = self.runtime.credentials.get("email_account", "") + email_rgx = re.compile(r"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$") + password = self.runtime.credentials.get("email_password", "") + smtp_server = self.runtime.credentials.get("smtp_server", "") + if not smtp_server: + return self.create_text_message("please input smtp server") + smtp_port = self.runtime.credentials.get("smtp_port", "") + try: + smtp_port = int(smtp_port) + except ValueError: + return self.create_text_message("Invalid parameter smtp_port(should be int)") + + if not sender: + return self.create_text_message("please input sender") + if not email_rgx.match(sender): + return self.create_text_message("Invalid parameter userid, the sender is not a mailbox") + + receiver_email = tool_parameters["send_to"] + if not receiver_email: + return self.create_text_message("please input receiver email") + if not email_rgx.match(receiver_email): + return self.create_text_message("Invalid parameter receiver email, the receiver email is not a mailbox") + email_content = tool_parameters.get("email_content", "") + + if not email_content: + return self.create_text_message("please input email content") + + subject = tool_parameters.get("subject", "") + if not subject: + return self.create_text_message("please input email subject") + + encrypt_method = self.runtime.credentials.get("encrypt_method", "") + if not encrypt_method: + return self.create_text_message("please input encrypt method") + + send_email_params = SendEmailToolParameters( + smtp_server=smtp_server, + smtp_port=smtp_port, + email_account=sender, + email_password=password, + sender_to=receiver_email, + subject=subject, + email_content=email_content, + encrypt_method=encrypt_method, + ) + if send_mail(send_email_params): + return self.create_text_message("send email success") + return self.create_text_message("send email failed") diff --git a/api/core/tools/provider/builtin/email/tools/send_mail.yaml b/api/core/tools/provider/builtin/email/tools/send_mail.yaml new file mode 100644 index 00000000000000..f54880bf3e9e22 --- /dev/null +++ b/api/core/tools/provider/builtin/email/tools/send_mail.yaml @@ -0,0 +1,46 @@ +identity: + name: send_mail + author: wakaka6 + label: + en_US: send email + zh_Hans: 发送邮件 + icon: icon.svg +description: + human: + en_US: A tool for sending email + zh_Hans: 用于发送邮件 + llm: A tool for sending email +parameters: + - name: send_to + type: string + required: true + label: + en_US: Recipient email account + zh_Hans: 收件人邮箱账号 + human_description: + en_US: Recipient email account + zh_Hans: 收件人邮箱账号 + llm_description: Recipient email account + form: llm + - name: subject + type: string + required: true + label: + en_US: email subject + zh_Hans: 邮件主题 + human_description: + en_US: email subject + zh_Hans: 邮件主题 + llm_description: email subject + form: llm + - name: email_content + type: string + required: true + label: + en_US: email content + zh_Hans: 邮件内容 + human_description: + en_US: email content + zh_Hans: 邮件内容 + llm_description: email content + form: llm diff --git a/api/core/tools/provider/builtin/email/tools/send_mail_batch.py b/api/core/tools/provider/builtin/email/tools/send_mail_batch.py new file mode 100644 index 00000000000000..ff7e176990156b --- /dev/null +++ b/api/core/tools/provider/builtin/email/tools/send_mail_batch.py @@ -0,0 +1,75 @@ +import json +import re +from typing import Any, Union + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.provider.builtin.email.tools.send import ( + SendEmailToolParameters, + send_mail, +) +from core.tools.tool.builtin_tool import BuiltinTool + + +class SendMailTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + """ + invoke tools + """ + sender = self.runtime.credentials.get("email_account", "") + email_rgx = re.compile(r"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$") + password = self.runtime.credentials.get("email_password", "") + smtp_server = self.runtime.credentials.get("smtp_server", "") + if not smtp_server: + return self.create_text_message("please input smtp server") + smtp_port = self.runtime.credentials.get("smtp_port", "") + try: + smtp_port = int(smtp_port) + except ValueError: + return self.create_text_message("Invalid parameter smtp_port(should be int)") + + if not sender: + return self.create_text_message("please input sender") + if not email_rgx.match(sender): + return self.create_text_message("Invalid parameter userid, the sender is not a mailbox") + + receivers_email = tool_parameters["send_to"] + if not receivers_email: + return self.create_text_message("please input receiver email") + receivers_email = json.loads(receivers_email) + for receiver in receivers_email: + if not email_rgx.match(receiver): + return self.create_text_message( + f"Invalid parameter receiver email, the receiver email({receiver}) is not a mailbox" + ) + email_content = tool_parameters.get("email_content", "") + + if not email_content: + return self.create_text_message("please input email content") + + subject = tool_parameters.get("subject", "") + if not subject: + return self.create_text_message("please input email subject") + + encrypt_method = self.runtime.credentials.get("encrypt_method", "") + if not encrypt_method: + return self.create_text_message("please input encrypt method") + + msg = {} + for receiver in receivers_email: + send_email_params = SendEmailToolParameters( + smtp_server=smtp_server, + smtp_port=smtp_port, + email_account=sender, + email_password=password, + sender_to=receiver, + subject=subject, + email_content=email_content, + encrypt_method=encrypt_method, + ) + if send_mail(send_email_params): + msg[receiver] = "send email success" + else: + msg[receiver] = "send email failed" + return self.create_text_message(json.dumps(msg)) diff --git a/api/core/tools/provider/builtin/email/tools/send_mail_batch.yaml b/api/core/tools/provider/builtin/email/tools/send_mail_batch.yaml new file mode 100644 index 00000000000000..6e4aa785cb946e --- /dev/null +++ b/api/core/tools/provider/builtin/email/tools/send_mail_batch.yaml @@ -0,0 +1,46 @@ +identity: + name: send_mail_batch + author: wakaka6 + label: + en_US: send email to multiple recipients + zh_Hans: 发送邮件给多个收件人 + icon: icon.svg +description: + human: + en_US: A tool for sending email to multiple recipients + zh_Hans: 用于发送邮件给多个收件人的工具 + llm: A tool for sending email to multiple recipients +parameters: + - name: send_to + type: string + required: true + label: + en_US: Recipient email account(json list) + zh_Hans: 收件人邮箱账号(json list) + human_description: + en_US: Recipient email account + zh_Hans: 收件人邮箱账号 + llm_description: A list of recipient email account(json format) + form: llm + - name: subject + type: string + required: true + label: + en_US: email subject + zh_Hans: 邮件主题 + human_description: + en_US: email subject + zh_Hans: 邮件主题 + llm_description: email subject + form: llm + - name: email_content + type: string + required: true + label: + en_US: email content + zh_Hans: 邮件内容 + human_description: + en_US: email content + zh_Hans: 邮件内容 + llm_description: email content + form: llm diff --git a/api/core/tools/provider/builtin/fal/_assets/icon.svg b/api/core/tools/provider/builtin/fal/_assets/icon.svg new file mode 100644 index 00000000000000..bfb270774dd14c --- /dev/null +++ b/api/core/tools/provider/builtin/fal/_assets/icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/api/core/tools/provider/builtin/fal/fal.py b/api/core/tools/provider/builtin/fal/fal.py new file mode 100644 index 00000000000000..c68e2021331082 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/fal.py @@ -0,0 +1,20 @@ +import requests + +from core.tools.errors import ToolProviderCredentialValidationError +from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController + + +class FalProvider(BuiltinToolProviderController): + def _validate_credentials(self, credentials: dict) -> None: + url = "https://fal.run/fal-ai/flux/dev" + headers = { + "Authorization": f"Key {credentials.get('fal_api_key')}", + "Content-Type": "application/json", + } + data = {"prompt": "Cat"} + + response = requests.post(url, json=data, headers=headers) + if response.status_code == 401: + raise ToolProviderCredentialValidationError("FAL API key is invalid") + elif response.status_code != 200: + raise ToolProviderCredentialValidationError(f"FAL API key validation failed: {response.text}") diff --git a/api/core/tools/provider/builtin/fal/fal.yaml b/api/core/tools/provider/builtin/fal/fal.yaml new file mode 100644 index 00000000000000..050a73f62660f6 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/fal.yaml @@ -0,0 +1,21 @@ +identity: + author: Kalo Chin + name: fal + label: + en_US: FAL + zh_CN: FAL + description: + en_US: The image generation API provided by FAL. + zh_CN: FAL 提供的图像生成 API。 + icon: icon.svg + tags: + - image +credentials_for_provider: + fal_api_key: + type: secret-input + required: true + label: + en_US: FAL API Key + placeholder: + en_US: Please input your FAL API key + url: https://fal.ai/dashboard/keys diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.py b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.py new file mode 100644 index 00000000000000..7b5f10a64d4cdd --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.py @@ -0,0 +1,46 @@ +from typing import Any, Union + +import requests + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.tool.builtin_tool import BuiltinTool + + +class Flux11ProTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + headers = { + "Authorization": f"Key {self.runtime.credentials['fal_api_key']}", + "Content-Type": "application/json", + } + + prompt = tool_parameters.get("prompt", "") + sanitized_prompt = prompt.replace("\\", "") # Remove backslashes from the prompt which may cause errors + + payload = { + "prompt": sanitized_prompt, + "image_size": tool_parameters.get("image_size", "landscape_4_3"), + "seed": tool_parameters.get("seed"), + "sync_mode": tool_parameters.get("sync_mode", False), + "num_images": tool_parameters.get("num_images", 1), + "enable_safety_checker": tool_parameters.get("enable_safety_checker", True), + "safety_tolerance": tool_parameters.get("safety_tolerance", "2"), + } + + url = "https://fal.run/fal-ai/flux-pro/v1.1" + + response = requests.post(url, json=payload, headers=headers) + + if response.status_code != 200: + return self.create_text_message(f"Got Error Response: {response.text}") + + res = response.json() + result = [self.create_json_message(res)] + + for image_info in res.get("images", []): + image_url = image_info.get("url") + if image_url: + result.append(self.create_image_message(image=image_url, save_as=self.VariableKey.IMAGE.value)) + + return result diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.yaml b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.yaml new file mode 100644 index 00000000000000..237ee9937f925b --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro.yaml @@ -0,0 +1,147 @@ +identity: + name: flux_1_1_pro + author: Kalo Chin + label: + en_US: FLUX 1.1 [pro] + zh_Hans: FLUX 1.1 [pro] + icon: icon.svg +description: + human: + en_US: FLUX 1.1 [pro] is an enhanced version of FLUX.1 [pro], improved image generation capabilities, delivering superior composition, detail, and artistic fidelity compared to its predecessor. + zh_Hans: FLUX 1.1 [pro] 是 FLUX.1 [pro] 的增强版,改进了图像生成能力,与其前身相比,提供了更出色的构图、细节和艺术保真度。 + llm: This tool generates images from prompts using FAL's FLUX 1.1 [pro] model. +parameters: + - name: prompt + type: string + required: true + label: + en_US: Prompt + zh_Hans: 提示词 + human_description: + en_US: The text prompt used to generate the image. + zh_Hans: 用于生成图片的文字提示词。 + llm_description: This prompt text will be used to generate the image. + form: llm + - name: image_size + type: select + required: false + options: + - value: square_hd + label: + en_US: Square HD + zh_Hans: 方形高清 + - value: square + label: + en_US: Square + zh_Hans: 方形 + - value: portrait_4_3 + label: + en_US: Portrait 4:3 + zh_Hans: 竖屏 4:3 + - value: portrait_16_9 + label: + en_US: Portrait 16:9 + zh_Hans: 竖屏 16:9 + - value: landscape_4_3 + label: + en_US: Landscape 4:3 + zh_Hans: 横屏 4:3 + - value: landscape_16_9 + label: + en_US: Landscape 16:9 + zh_Hans: 横屏 16:9 + default: landscape_4_3 + label: + en_US: Image Size + zh_Hans: 图片大小 + human_description: + en_US: The size of the generated image. + zh_Hans: 生成图像的尺寸。 + form: form + - name: num_images + type: number + required: false + default: 1 + min: 1 + max: 1 + label: + en_US: Number of Images + zh_Hans: 图片数量 + human_description: + en_US: The number of images to generate. + zh_Hans: 要生成的图片数量。 + form: form + - name: safety_tolerance + type: select + required: false + options: + - value: "1" + label: + en_US: "1 (Most strict)" + zh_Hans: "1(最严格)" + - value: "2" + label: + en_US: "2" + zh_Hans: "2" + - value: "3" + label: + en_US: "3" + zh_Hans: "3" + - value: "4" + label: + en_US: "4" + zh_Hans: "4" + - value: "5" + label: + en_US: "5" + zh_Hans: "5" + - value: "6" + label: + en_US: "6 (Most permissive)" + zh_Hans: "6(最宽松)" + default: "2" + label: + en_US: Safety Tolerance + zh_Hans: 安全容忍度 + human_description: + en_US: The safety tolerance level for the generated image. 1 being the most strict and 6 being the most permissive. + zh_Hans: 生成图像的安全容忍级别,1 为最严格,6 为最宽松。 + form: form + - name: seed + type: number + required: false + min: 0 + max: 9999999999 + label: + en_US: Seed + zh_Hans: 种子 + human_description: + en_US: The same seed and prompt can produce similar images. + zh_Hans: 相同的种子和提示词可以产生相似的图像。 + form: form + - name: enable_safety_checker + type: boolean + required: false + default: true + label: + en_US: Enable Safety Checker + zh_Hans: 启用安全检查器 + human_description: + en_US: Enable or disable the safety checker. + zh_Hans: 启用或禁用安全检查器。 + form: form + - name: sync_mode + type: boolean + required: false + default: false + label: + en_US: Sync Mode + zh_Hans: 同步模式 + human_description: + en_US: > + If set to true, the function will wait for the image to be generated and uploaded before returning the response. + This will increase the latency but allows you to get the image directly in the response without going through the CDN. + zh_Hans: > + 如果设置为 true,函数将在生成并上传图像后再返回响应。 + 这将增加函数的延迟,但可以让您直接在响应中获取图像,而无需通过 CDN。 + form: form diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.py b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.py new file mode 100644 index 00000000000000..2fb1565e7cd1b2 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.py @@ -0,0 +1,47 @@ +from typing import Any, Union + +import requests + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.tool.builtin_tool import BuiltinTool + + +class Flux11ProUltraTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + headers = { + "Authorization": f"Key {self.runtime.credentials['fal_api_key']}", + "Content-Type": "application/json", + } + + prompt = tool_parameters.get("prompt", "") + sanitized_prompt = prompt.replace("\\", "") # Remove backslashes from the prompt which may cause errors + + payload = { + "prompt": sanitized_prompt, + "seed": tool_parameters.get("seed"), + "sync_mode": tool_parameters.get("sync_mode", False), + "num_images": tool_parameters.get("num_images", 1), + "enable_safety_checker": tool_parameters.get("enable_safety_checker", True), + "safety_tolerance": str(tool_parameters.get("safety_tolerance", "2")), + "aspect_ratio": tool_parameters.get("aspect_ratio", "16:9"), + "raw": tool_parameters.get("raw", False), + } + + url = "https://fal.run/fal-ai/flux-pro/v1.1-ultra" + + response = requests.post(url, json=payload, headers=headers) + + if response.status_code != 200: + return self.create_text_message(f"Got Error Response: {response.text}") + + res = response.json() + result = [self.create_json_message(res)] + + for image_info in res.get("images", []): + image_url = image_info.get("url") + if image_url: + result.append(self.create_image_message(image=image_url, save_as=self.VariableKey.IMAGE.value)) + + return result diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.yaml b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.yaml new file mode 100644 index 00000000000000..d518e5192935b9 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_1_pro_ultra.yaml @@ -0,0 +1,162 @@ +identity: + name: flux_1_1_pro_ultra + author: Kalo Chin + label: + en_US: FLUX 1.1 [pro] ultra + zh_Hans: FLUX 1.1 [pro] ultra + icon: icon.svg +description: + human: + en_US: FLUX 1.1 [pro] ultra is the newest version of FLUX 1.1 [pro], maintaining professional-grade image quality while delivering up to 2K resolution with improved photo realism. + zh_Hans: FLUX 1.1 [pro] ultra 是 FLUX 1.1 [pro] 的最新版本,保持了专业级的图像质量,同时以改进的照片真实感提供高达 2K 的分辨率。 + llm: This tool generates images from prompts using FAL's FLUX 1.1 [pro] ultra model. +parameters: + - name: prompt + type: string + required: true + label: + en_US: Prompt + zh_Hans: 提示词 + human_description: + en_US: The text prompt used to generate the image. + zh_Hans: 用于生成图像的文本提示。 + llm_description: This prompt text will be used to generate the image. + form: llm + - name: aspect_ratio + type: select + required: false + options: + - value: '21:9' + label: + en_US: '21:9' + zh_Hans: '21:9' + - value: '16:9' + label: + en_US: '16:9' + zh_Hans: '16:9' + - value: '4:3' + label: + en_US: '4:3' + zh_Hans: '4:3' + - value: '1:1' + label: + en_US: '1:1' + zh_Hans: '1:1' + - value: '3:4' + label: + en_US: '3:4' + zh_Hans: '3:4' + - value: '9:16' + label: + en_US: '9:16' + zh_Hans: '9:16' + - value: '9:21' + label: + en_US: '9:21' + zh_Hans: '9:21' + default: '16:9' + label: + en_US: Aspect Ratio + zh_Hans: 纵横比 + human_description: + en_US: The aspect ratio of the generated image. + zh_Hans: 生成图像的宽高比。 + form: form + - name: num_images + type: number + required: false + default: 1 + min: 1 + max: 1 + label: + en_US: Number of Images + zh_Hans: 图片数量 + human_description: + en_US: The number of images to generate. + zh_Hans: 要生成的图像数量。 + form: form + - name: safety_tolerance + type: select + required: false + options: + - value: "1" + label: + en_US: "1 (Most strict)" + zh_Hans: "1(最严格)" + - value: "2" + label: + en_US: "2" + zh_Hans: "2" + - value: "3" + label: + en_US: "3" + zh_Hans: "3" + - value: "4" + label: + en_US: "4" + zh_Hans: "4" + - value: "5" + label: + en_US: "5" + zh_Hans: "5" + - value: "6" + label: + en_US: "6 (Most permissive)" + zh_Hans: "6(最宽松)" + default: '2' + label: + en_US: Safety Tolerance + zh_Hans: 安全容忍度 + human_description: + en_US: The safety tolerance level for the generated image. 1 being the most strict and 6 being the most permissive. + zh_Hans: 生成图像的安全容忍级别,1 为最严格,6 为最宽松。 + form: form + - name: seed + type: number + required: false + min: 0 + max: 9999999999 + label: + en_US: Seed + zh_Hans: 种子 + human_description: + en_US: The same seed and prompt can produce similar images. + zh_Hans: 相同的种子和提示词可以生成相似的图像。 + form: form + - name: raw + type: boolean + required: false + default: false + label: + en_US: Raw Mode + zh_Hans: 原始模式 + human_description: + en_US: Generate less processed, more natural-looking images. + zh_Hans: 生成较少处理、更自然的图像。 + form: form + - name: enable_safety_checker + type: boolean + required: false + default: true + label: + en_US: Enable Safety Checker + zh_Hans: 启用安全检查器 + human_description: + en_US: Enable or disable the safety checker. + zh_Hans: 启用或禁用安全检查器。 + form: form + - name: sync_mode + type: boolean + required: false + default: false + label: + en_US: Sync Mode + zh_Hans: 同步模式 + human_description: + en_US: > + If set to true, the function will wait for the image to be generated and uploaded before returning the response. + This will increase the latency but allows you to get the image directly in the response without going through the CDN. + zh_Hans: > + 如果设置为 true,函数将在生成并上传图像后才返回响应。 + 这将增加延迟,但允许您直接在响应中获取图像,而无需通过 CDN。 + form: form diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_dev.py b/api/core/tools/provider/builtin/fal/tools/flux_1_dev.py new file mode 100644 index 00000000000000..b44d9fe752ed5a --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_dev.py @@ -0,0 +1,47 @@ +from typing import Any, Union + +import requests + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.tool.builtin_tool import BuiltinTool + + +class Flux1DevTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + headers = { + "Authorization": f"Key {self.runtime.credentials['fal_api_key']}", + "Content-Type": "application/json", + } + + prompt = tool_parameters.get("prompt", "") + sanitized_prompt = prompt.replace("\\", "") # Remove backslashes from the prompt which may cause errors + + payload = { + "prompt": sanitized_prompt, + "image_size": tool_parameters.get("image_size", "landscape_4_3"), + "num_inference_steps": tool_parameters.get("num_inference_steps", 28), + "guidance_scale": tool_parameters.get("guidance_scale", 3.5), + "seed": tool_parameters.get("seed"), + "num_images": tool_parameters.get("num_images", 1), + "enable_safety_checker": tool_parameters.get("enable_safety_checker", True), + "sync_mode": tool_parameters.get("sync_mode", False), + } + + url = "https://fal.run/fal-ai/flux/dev" + + response = requests.post(url, json=payload, headers=headers) + + if response.status_code != 200: + return self.create_text_message(f"Got Error Response: {response.text}") + + res = response.json() + result = [self.create_json_message(res)] + + for image_info in res.get("images", []): + image_url = image_info.get("url") + if image_url: + result.append(self.create_image_message(image=image_url, save_as=self.VariableKey.IMAGE.value)) + + return result diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_dev.yaml b/api/core/tools/provider/builtin/fal/tools/flux_1_dev.yaml new file mode 100644 index 00000000000000..3b22af941fc60a --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_dev.yaml @@ -0,0 +1,137 @@ +identity: + name: flux_1_dev + author: Kalo Chin + label: + en_US: FLUX.1 [dev] + zh_Hans: FLUX.1 [dev] + icon: icon.svg +description: + human: + en_US: FLUX.1 [dev] is a 12 billion parameter flow transformer that generates high-quality images from text. It is suitable for personal and commercial use. + zh_Hans: FLUX.1 [dev] 是一个拥有120亿参数的流动变换模型,可以从文本生成高质量的图像。适用于个人和商业用途。 + llm: This tool generates images from prompts using FAL's FLUX.1 [dev] model. +parameters: + - name: prompt + type: string + required: true + label: + en_US: Prompt + zh_Hans: 提示词 + human_description: + en_US: The text prompt used to generate the image. + zh_Hans: 用于生成图片的文字提示词。 + llm_description: This prompt text will be used to generate the image. + form: llm + - name: image_size + type: select + required: false + options: + - value: square_hd + label: + en_US: Square HD + zh_Hans: 方形高清 + - value: square + label: + en_US: Square + zh_Hans: 方形 + - value: portrait_4_3 + label: + en_US: Portrait 4:3 + zh_Hans: 竖屏 4:3 + - value: portrait_16_9 + label: + en_US: Portrait 16:9 + zh_Hans: 竖屏 16:9 + - value: landscape_4_3 + label: + en_US: Landscape 4:3 + zh_Hans: 横屏 4:3 + - value: landscape_16_9 + label: + en_US: Landscape 16:9 + zh_Hans: 横屏 16:9 + default: landscape_4_3 + label: + en_US: Image Size + zh_Hans: 图片大小 + human_description: + en_US: The size of the generated image. + zh_Hans: 生成图像的尺寸。 + form: form + - name: num_images + type: number + required: false + default: 1 + min: 1 + max: 4 + label: + en_US: Number of Images + zh_Hans: 图片数量 + human_description: + en_US: The number of images to generate. + zh_Hans: 要生成的图片数量。 + form: form + - name: num_inference_steps + type: number + required: false + default: 28 + min: 1 + max: 50 + label: + en_US: Num Inference Steps + zh_Hans: 推理步数 + human_description: + en_US: The number of inference steps to perform. More steps produce higher quality but take longer. + zh_Hans: 执行的推理步骤数量。更多的步骤可以产生更高质量的结果,但需要更长的时间。 + form: form + - name: guidance_scale + type: number + required: false + default: 3.5 + min: 0 + max: 20 + label: + en_US: Guidance Scale + zh_Hans: 指导强度 + human_description: + en_US: How closely the model should follow the prompt. + zh_Hans: 模型对提示词的遵循程度。 + form: form + - name: seed + type: number + required: false + min: 0 + max: 9999999999 + label: + en_US: Seed + zh_Hans: 种子 + human_description: + en_US: The same seed and prompt can produce similar images. + zh_Hans: 相同的种子和提示可以产生相似的图像。 + form: form + - name: enable_safety_checker + type: boolean + required: false + default: true + label: + en_US: Enable Safety Checker + zh_Hans: 启用安全检查器 + human_description: + en_US: Enable or disable the safety checker. + zh_Hans: 启用或禁用安全检查器。 + form: form + - name: sync_mode + type: boolean + required: false + default: false + label: + en_US: Sync Mode + zh_Hans: 同步模式 + human_description: + en_US: > + If set to true, the function will wait for the image to be generated and uploaded before returning the response. + This will increase the latency but allows you to get the image directly in the response without going through the CDN. + zh_Hans: > + 如果设置为 true,函数将在生成并上传图像后再返回响应。 + 这将增加函数的延迟,但可以让您直接在响应中获取图像,而无需通过 CDN。 + form: form diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.py b/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.py new file mode 100644 index 00000000000000..be60366155dbe3 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.py @@ -0,0 +1,47 @@ +from typing import Any, Union + +import requests + +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.tool.builtin_tool import BuiltinTool + + +class Flux1ProNewTool(BuiltinTool): + def _invoke( + self, user_id: str, tool_parameters: dict[str, Any] + ) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]: + headers = { + "Authorization": f"Key {self.runtime.credentials['fal_api_key']}", + "Content-Type": "application/json", + } + + prompt = tool_parameters.get("prompt", "") + sanitized_prompt = prompt.replace("\\", "") # Remove backslashes that may cause errors + + payload = { + "prompt": sanitized_prompt, + "image_size": tool_parameters.get("image_size", "landscape_4_3"), + "num_inference_steps": tool_parameters.get("num_inference_steps", 28), + "guidance_scale": tool_parameters.get("guidance_scale", 3.5), + "seed": tool_parameters.get("seed"), + "num_images": tool_parameters.get("num_images", 1), + "safety_tolerance": tool_parameters.get("safety_tolerance", "2"), + "sync_mode": tool_parameters.get("sync_mode", False), + } + + url = "https://fal.run/fal-ai/flux-pro/new" + + response = requests.post(url, json=payload, headers=headers) + + if response.status_code != 200: + return self.create_text_message(f"Got Error Response: {response.text}") + + res = response.json() + result = [self.create_json_message(res)] + + for image_info in res.get("images", []): + image_url = image_info.get("url") + if image_url: + result.append(self.create_image_message(image=image_url, save_as=self.VariableKey.IMAGE.value)) + + return result diff --git a/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.yaml b/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.yaml new file mode 100644 index 00000000000000..6f8dbb3a54e9ec --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/flux_1_pro_new.yaml @@ -0,0 +1,164 @@ +identity: + name: flux_1_pro_new + author: Kalo Chin + label: + en_US: FLUX.1 [pro] new + zh_Hans: FLUX.1 [pro] new + icon: icon.svg +description: + human: + en_US: FLUX.1 [pro] new is an accelerated version of FLUX.1 [pro], maintaining professional-grade image quality while delivering significantly faster generation speeds. + zh_Hans: FLUX.1 [pro] new 是 FLUX.1 [pro] 的加速版本,在保持专业级图像质量的同时,大大提高了生成速度。 + llm: This tool generates images from prompts using FAL's FLUX.1 [pro] new model. +parameters: + - name: prompt + type: string + required: true + label: + en_US: Prompt + zh_Hans: 提示词 + human_description: + en_US: The text prompt used to generate the image. + zh_Hans: 用于生成图像的文本提示。 + llm_description: This prompt text will be used to generate the image. + form: llm + - name: image_size + type: select + required: false + options: + - value: square_hd + label: + en_US: Square HD + zh_Hans: 正方形高清 + - value: square + label: + en_US: Square + zh_Hans: 正方形 + - value: portrait_4_3 + label: + en_US: Portrait 4:3 + zh_Hans: 竖屏 4:3 + - value: portrait_16_9 + label: + en_US: Portrait 16:9 + zh_Hans: 竖屏 16:9 + - value: landscape_4_3 + label: + en_US: Landscape 4:3 + zh_Hans: 横屏 4:3 + - value: landscape_16_9 + label: + en_US: Landscape 16:9 + zh_Hans: 横屏 16:9 + default: landscape_4_3 + label: + en_US: Image Size + zh_Hans: 图像尺寸 + human_description: + en_US: The size of the generated image. + zh_Hans: 生成图像的尺寸。 + form: form + - name: num_images + type: number + required: false + default: 1 + min: 1 + max: 1 + label: + en_US: Number of Images + zh_Hans: 图像数量 + human_description: + en_US: The number of images to generate. + zh_Hans: 要生成的图像数量。 + form: form + - name: num_inference_steps + type: number + required: false + default: 28 + min: 1 + max: 50 + label: + en_US: Num Inference Steps + zh_Hans: 推理步数 + human_description: + en_US: The number of inference steps to perform. More steps produce higher quality but take longer. + zh_Hans: 执行的推理步数。步数越多,质量越高,但所需时间也更长。 + form: form + - name: guidance_scale + type: number + required: false + default: 3.5 + min: 0 + max: 20 + label: + en_US: Guidance Scale + zh_Hans: 指导强度 + human_description: + en_US: How closely the model should follow the prompt. + zh_Hans: 模型对提示词的遵循程度。 + form: form + - name: safety_tolerance + type: select + required: false + options: + - value: "1" + label: + en_US: "1 (Most strict)" + zh_Hans: "1(最严格)" + - value: "2" + label: + en_US: "2" + zh_Hans: "2" + - value: "3" + label: + en_US: "3" + zh_Hans: "3" + - value: "4" + label: + en_US: "4" + zh_Hans: "4" + - value: "5" + label: + en_US: "5" + zh_Hans: "5" + - value: "6" + label: + en_US: "6 (Most permissive)" + zh_Hans: "6(最宽松)" + default: "2" + label: + en_US: Safety Tolerance + zh_Hans: 安全容忍度 + human_description: + en_US: > + The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. + zh_Hans: > + 生成图像的安全容忍级别。1 是最严格,6 是最宽松。 + form: form + - name: seed + type: number + required: false + min: 0 + max: 9999999999 + label: + en_US: Seed + zh_Hans: 种子 + human_description: + en_US: The same seed and prompt can produce similar images. + zh_Hans: 相同的种子和提示词可以生成相似的图像。 + form: form + - name: sync_mode + type: boolean + required: false + default: false + label: + en_US: Sync Mode + zh_Hans: 同步模式 + human_description: + en_US: > + If set to true, the function will wait for the image to be generated and uploaded before returning the response. + This will increase the latency but allows you to get the image directly in the response without going through the CDN. + zh_Hans: > + 如果设置为 true,函数将在生成并上传图像后才返回响应。 + 这将增加延迟,但允许您直接在响应中获取图像,而无需通过 CDN。 + form: form diff --git a/api/core/tools/provider/builtin/fal/tools/wizper.py b/api/core/tools/provider/builtin/fal/tools/wizper.py new file mode 100644 index 00000000000000..67a5e451189484 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/wizper.py @@ -0,0 +1,52 @@ +import io +import os +from typing import Any + +import fal_client + +from core.file.enums import FileAttribute, FileType +from core.file.file_manager import download, get_attr +from core.tools.entities.tool_entities import ToolInvokeMessage +from core.tools.tool.builtin_tool import BuiltinTool + + +class WizperTool(BuiltinTool): + def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> ToolInvokeMessage: + audio_file = tool_parameters.get("audio_file") + task = tool_parameters.get("task", "transcribe") + language = tool_parameters.get("language", "en") + chunk_level = tool_parameters.get("chunk_level", "segment") + version = tool_parameters.get("version", "3") + + if audio_file.type != FileType.AUDIO: + return [self.create_text_message("Not a valid audio file.")] + + api_key = self.runtime.credentials["fal_api_key"] + + os.environ["FAL_KEY"] = api_key + + audio_binary = io.BytesIO(download(audio_file)) + mime_type = get_attr(file=audio_file, attr=FileAttribute.MIME_TYPE) + file_data = audio_binary.getvalue() + + try: + audio_url = fal_client.upload(file_data, mime_type) + + except Exception as e: + return [self.create_text_message(f"Error uploading audio file: {str(e)}")] + + arguments = { + "audio_url": audio_url, + "task": task, + "language": language, + "chunk_level": chunk_level, + "version": version, + } + + result = fal_client.subscribe( + "fal-ai/wizper", + arguments=arguments, + with_logs=False, + ) + + return self.create_json_message(result) diff --git a/api/core/tools/provider/builtin/fal/tools/wizper.yaml b/api/core/tools/provider/builtin/fal/tools/wizper.yaml new file mode 100644 index 00000000000000..5742efcc1b4002 --- /dev/null +++ b/api/core/tools/provider/builtin/fal/tools/wizper.yaml @@ -0,0 +1,489 @@ +identity: + name: wizper + author: Kalo Chin + label: + en_US: Wizper + zh_Hans: Wizper +description: + human: + en_US: Transcribe an audio file using the Whisper model. + zh_Hans: 使用 Whisper 模型转录音频文件。 + llm: Transcribe an audio file using the Whisper model. +parameters: + - name: audio_file + type: file + required: true + label: + en_US: Audio File + zh_Hans: 音频文件 + human_description: + en_US: "Upload an audio file to transcribe. Supports mp3, mp4, mpeg, mpga, m4a, wav, or webm formats." + zh_Hans: "上传要转录的音频文件。支持 mp3、mp4、mpeg、mpga、m4a、wav 或 webm 格式。" + llm_description: "Audio file to transcribe. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm." + form: llm + - name: task + type: select + required: true + label: + en_US: Task + zh_Hans: 任务 + human_description: + en_US: "Choose whether to transcribe the audio in its original language or translate it to English" + zh_Hans: "选择是以原始语言转录音频还是将其翻译成英语" + llm_description: "Task to perform on the audio file. Either transcribe or translate. Default value: 'transcribe'. If 'translate' is selected as the task, the audio will be translated to English, regardless of the language selected." + form: form + default: transcribe + options: + - value: transcribe + label: + en_US: Transcribe + zh_Hans: 转录 + - value: translate + label: + en_US: Translate + zh_Hans: 翻译 + - name: language + type: select + required: true + label: + en_US: Language + zh_Hans: 语言 + human_description: + en_US: "Select the primary language spoken in the audio file" + zh_Hans: "选择音频文件中使用的主要语言" + llm_description: "Language of the audio file." + form: form + default: en + options: + - value: af + label: + en_US: Afrikaans + zh_Hans: 南非语 + - value: am + label: + en_US: Amharic + zh_Hans: 阿姆哈拉语 + - value: ar + label: + en_US: Arabic + zh_Hans: 阿拉伯语 + - value: as + label: + en_US: Assamese + zh_Hans: 阿萨姆语 + - value: az + label: + en_US: Azerbaijani + zh_Hans: 阿塞拜疆语 + - value: ba + label: + en_US: Bashkir + zh_Hans: 巴什基尔语 + - value: be + label: + en_US: Belarusian + zh_Hans: 白俄罗斯语 + - value: bg + label: + en_US: Bulgarian + zh_Hans: 保加利亚语 + - value: bn + label: + en_US: Bengali + zh_Hans: 孟加拉语 + - value: bo + label: + en_US: Tibetan + zh_Hans: 藏语 + - value: br + label: + en_US: Breton + zh_Hans: 布列塔尼语 + - value: bs + label: + en_US: Bosnian + zh_Hans: 波斯尼亚语 + - value: ca + label: + en_US: Catalan + zh_Hans: 加泰罗尼亚语 + - value: cs + label: + en_US: Czech + zh_Hans: 捷克语 + - value: cy + label: + en_US: Welsh + zh_Hans: 威尔士语 + - value: da + label: + en_US: Danish + zh_Hans: 丹麦语 + - value: de + label: + en_US: German + zh_Hans: 德语 + - value: el + label: + en_US: Greek + zh_Hans: 希腊语 + - value: en + label: + en_US: English + zh_Hans: 英语 + - value: es + label: + en_US: Spanish + zh_Hans: 西班牙语 + - value: et + label: + en_US: Estonian + zh_Hans: 爱沙尼亚语 + - value: eu + label: + en_US: Basque + zh_Hans: 巴斯克语 + - value: fa + label: + en_US: Persian + zh_Hans: 波斯语 + - value: fi + label: + en_US: Finnish + zh_Hans: 芬兰语 + - value: fo + label: + en_US: Faroese + zh_Hans: 法罗语 + - value: fr + label: + en_US: French + zh_Hans: 法语 + - value: gl + label: + en_US: Galician + zh_Hans: 加利西亚语 + - value: gu + label: + en_US: Gujarati + zh_Hans: 古吉拉特语 + - value: ha + label: + en_US: Hausa + zh_Hans: 毫萨语 + - value: haw + label: + en_US: Hawaiian + zh_Hans: 夏威夷语 + - value: he + label: + en_US: Hebrew + zh_Hans: 希伯来语 + - value: hi + label: + en_US: Hindi + zh_Hans: 印地语 + - value: hr + label: + en_US: Croatian + zh_Hans: 克罗地亚语 + - value: ht + label: + en_US: Haitian Creole + zh_Hans: 海地克里奥尔语 + - value: hu + label: + en_US: Hungarian + zh_Hans: 匈牙利语 + - value: hy + label: + en_US: Armenian + zh_Hans: 亚美尼亚语 + - value: id + label: + en_US: Indonesian + zh_Hans: 印度尼西亚语 + - value: is + label: + en_US: Icelandic + zh_Hans: 冰岛语 + - value: it + label: + en_US: Italian + zh_Hans: 意大利语 + - value: ja + label: + en_US: Japanese + zh_Hans: 日语 + - value: jw + label: + en_US: Javanese + zh_Hans: 爪哇语 + - value: ka + label: + en_US: Georgian + zh_Hans: 格鲁吉亚语 + - value: kk + label: + en_US: Kazakh + zh_Hans: 哈萨克语 + - value: km + label: + en_US: Khmer + zh_Hans: 高棉语 + - value: kn + label: + en_US: Kannada + zh_Hans: 卡纳达语 + - value: ko + label: + en_US: Korean + zh_Hans: 韩语 + - value: la + label: + en_US: Latin + zh_Hans: 拉丁语 + - value: lb + label: + en_US: Luxembourgish + zh_Hans: 卢森堡语 + - value: ln + label: + en_US: Lingala + zh_Hans: 林加拉语 + - value: lo + label: + en_US: Lao + zh_Hans: 老挝语 + - value: lt + label: + en_US: Lithuanian + zh_Hans: 立陶宛语 + - value: lv + label: + en_US: Latvian + zh_Hans: 拉脱维亚语 + - value: mg + label: + en_US: Malagasy + zh_Hans: 马尔加什语 + - value: mi + label: + en_US: Maori + zh_Hans: 毛利语 + - value: mk + label: + en_US: Macedonian + zh_Hans: 马其顿语 + - value: ml + label: + en_US: Malayalam + zh_Hans: 马拉雅拉姆语 + - value: mn + label: + en_US: Mongolian + zh_Hans: 蒙古语 + - value: mr + label: + en_US: Marathi + zh_Hans: 马拉地语 + - value: ms + label: + en_US: Malay + zh_Hans: 马来语 + - value: mt + label: + en_US: Maltese + zh_Hans: 马耳他语 + - value: my + label: + en_US: Burmese + zh_Hans: 缅甸语 + - value: ne + label: + en_US: Nepali + zh_Hans: 尼泊尔语 + - value: nl + label: + en_US: Dutch + zh_Hans: 荷兰语 + - value: nn + label: + en_US: Norwegian Nynorsk + zh_Hans: 新挪威语 + - value: no + label: + en_US: Norwegian + zh_Hans: 挪威语 + - value: oc + label: + en_US: Occitan + zh_Hans: 奥克语 + - value: pa + label: + en_US: Punjabi + zh_Hans: 旁遮普语 + - value: pl + label: + en_US: Polish + zh_Hans: 波兰语 + - value: ps + label: + en_US: Pashto + zh_Hans: 普什图语 + - value: pt + label: + en_US: Portuguese + zh_Hans: 葡萄牙语 + - value: ro + label: + en_US: Romanian + zh_Hans: 罗马尼亚语 + - value: ru + label: + en_US: Russian + zh_Hans: 俄语 + - value: sa + label: + en_US: Sanskrit + zh_Hans: 梵语 + - value: sd + label: + en_US: Sindhi + zh_Hans: 信德语 + - value: si + label: + en_US: Sinhala + zh_Hans: 僧伽罗语 + - value: sk + label: + en_US: Slovak + zh_Hans: 斯洛伐克语 + - value: sl + label: + en_US: Slovenian + zh_Hans: 斯洛文尼亚语 + - value: sn + label: + en_US: Shona + zh_Hans: 修纳语 + - value: so + label: + en_US: Somali + zh_Hans: 索马里语 + - value: sq + label: + en_US: Albanian + zh_Hans: 阿尔巴尼亚语 + - value: sr + label: + en_US: Serbian + zh_Hans: 塞尔维亚语 + - value: su + label: + en_US: Sundanese + zh_Hans: 巽他语 + - value: sv + label: + en_US: Swedish + zh_Hans: 瑞典语 + - value: sw + label: + en_US: Swahili + zh_Hans: 斯瓦希里语 + - value: ta + label: + en_US: Tamil + zh_Hans: 泰米尔语 + - value: te + label: + en_US: Telugu + zh_Hans: 泰卢固语 + - value: tg + label: + en_US: Tajik + zh_Hans: 塔吉克语 + - value: th + label: + en_US: Thai + zh_Hans: 泰语 + - value: tk + label: + en_US: Turkmen + zh_Hans: 土库曼语 + - value: tl + label: + en_US: Tagalog + zh_Hans: 他加禄语 + - value: tr + label: + en_US: Turkish + zh_Hans: 土耳其语 + - value: tt + label: + en_US: Tatar + zh_Hans: 鞑靼语 + - value: uk + label: + en_US: Ukrainian + zh_Hans: 乌克兰语 + - value: ur + label: + en_US: Urdu + zh_Hans: 乌尔都语 + - value: uz + label: + en_US: Uzbek + zh_Hans: 乌兹别克语 + - value: vi + label: + en_US: Vietnamese + zh_Hans: 越南语 + - value: yi + label: + en_US: Yiddish + zh_Hans: 意第绪语 + - value: yo + label: + en_US: Yoruba + zh_Hans: 约鲁巴语 + - value: yue + label: + en_US: Cantonese + zh_Hans: 粤语 + - value: zh + label: + en_US: Chinese + zh_Hans: 中文 + - name: chunk_level + type: select + label: + en_US: Chunk Level + zh_Hans: 分块级别 + human_description: + en_US: "Choose how the transcription should be divided into chunks" + zh_Hans: "选择如何将转录内容分成块" + llm_description: "Level of the chunks to return." + form: form + default: segment + options: + - value: segment + label: + en_US: Segment + zh_Hans: 段 + - name: version + type: select + label: + en_US: Version + zh_Hans: 版本 + human_description: + en_US: "Select which version of the Whisper large model to use" + zh_Hans: "选择要使用的 Whisper large 模型版本" + llm_description: "Version of the model to use. All of the models are the Whisper large variant." + form: form + default: "3" + options: + - value: "3" + label: + en_US: Version 3 + zh_Hans: 版本 3 diff --git a/api/core/tools/provider/builtin/gitee_ai/gitee_ai.yaml b/api/core/tools/provider/builtin/gitee_ai/gitee_ai.yaml index 2e18f8a7fca56a..d0475665dd7ac7 100644 --- a/api/core/tools/provider/builtin/gitee_ai/gitee_ai.yaml +++ b/api/core/tools/provider/builtin/gitee_ai/gitee_ai.yaml @@ -5,7 +5,7 @@ identity: en_US: Gitee AI zh_Hans: Gitee AI description: - en_US: 快速体验大模型,领先探索 AI 开源世界 + en_US: Quickly experience large models and explore the leading AI open source world zh_Hans: 快速体验大模型,领先探索 AI 开源世界 icon: icon.svg tags: diff --git a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.py b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.py index 0b9c025834d6f9..a7f7ad2e78b9b0 100644 --- a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.py +++ b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.py @@ -1,6 +1,7 @@ from typing import Any import openai +from yarl import URL from core.tools.errors import ToolProviderCredentialValidationError from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController @@ -10,6 +11,7 @@ class PodcastGeneratorProvider(BuiltinToolProviderController): def _validate_credentials(self, credentials: dict[str, Any]) -> None: tts_service = credentials.get("tts_service") api_key = credentials.get("api_key") + base_url = credentials.get("openai_base_url") if not tts_service: raise ToolProviderCredentialValidationError("TTS service is not specified") @@ -17,13 +19,16 @@ def _validate_credentials(self, credentials: dict[str, Any]) -> None: if not api_key: raise ToolProviderCredentialValidationError("API key is missing") + if base_url: + base_url = str(URL(base_url) / "v1") + if tts_service == "openai": - self._validate_openai_credentials(api_key) + self._validate_openai_credentials(api_key, base_url) else: raise ToolProviderCredentialValidationError(f"Unsupported TTS service: {tts_service}") - def _validate_openai_credentials(self, api_key: str) -> None: - client = openai.OpenAI(api_key=api_key) + def _validate_openai_credentials(self, api_key: str, base_url: str | None) -> None: + client = openai.OpenAI(api_key=api_key, base_url=base_url) try: # We're using a simple API call to validate the credentials client.models.list() diff --git a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml index bd02b32020a85e..d4edb17b28638e 100644 --- a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml +++ b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml @@ -32,3 +32,15 @@ credentials_for_provider: placeholder: en_US: Enter your TTS service API key zh_Hans: 输入您的 TTS 服务 API 密钥 + openai_base_url: + type: text-input + required: false + label: + en_US: OpenAI base URL + zh_Hans: OpenAI base URL + help: + en_US: Please input your OpenAI base URL + zh_Hans: 请输入你的 OpenAI base URL + placeholder: + en_US: Please input your OpenAI base URL + zh_Hans: 请输入你的 OpenAI base URL diff --git a/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py b/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py index 476e2d01e1d107..165e93956eff38 100644 --- a/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py +++ b/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py @@ -5,6 +5,7 @@ from typing import Any, Literal, Optional, Union import openai +from yarl import URL from core.tools.entities.tool_entities import ToolInvokeMessage from core.tools.errors import ToolParameterValidationError, ToolProviderCredentialValidationError @@ -53,15 +54,24 @@ def _invoke( if not host1_voice or not host2_voice: raise ToolParameterValidationError("Host voices are required") - # Get OpenAI API key from credentials + # Ensure runtime and credentials if not self.runtime or not self.runtime.credentials: raise ToolProviderCredentialValidationError("Tool runtime or credentials are missing") + + # Get OpenAI API key from credentials api_key = self.runtime.credentials.get("api_key") if not api_key: raise ToolProviderCredentialValidationError("OpenAI API key is missing") + # Get OpenAI base URL + openai_base_url = self.runtime.credentials.get("openai_base_url", None) + openai_base_url = str(URL(openai_base_url) / "v1") if openai_base_url else None + # Initialize OpenAI client - client = openai.OpenAI(api_key=api_key) + client = openai.OpenAI( + api_key=api_key, + base_url=openai_base_url, + ) # Create a thread pool max_workers = 5 diff --git a/api/core/tools/provider/builtin/vanna/tools/vanna.yaml b/api/core/tools/provider/builtin/vanna/tools/vanna.yaml index 12ca8a862e966f..309681321b1f3f 100644 --- a/api/core/tools/provider/builtin/vanna/tools/vanna.yaml +++ b/api/core/tools/provider/builtin/vanna/tools/vanna.yaml @@ -32,7 +32,7 @@ parameters: en_US: RAG Model for your database DDL zh_Hans: 存储数据库训练数据的RAG模型 llm_description: RAG Model for generating SQL - form: form + form: llm - name: db_type type: select required: true @@ -136,7 +136,7 @@ parameters: human_description: en_US: DDL statements for training data zh_Hans: 用于训练RAG Model的建表语句 - form: form + form: llm - name: question type: string required: false @@ -146,7 +146,7 @@ parameters: human_description: en_US: Question-SQL Pairs zh_Hans: Question-SQL中的问题 - form: form + form: llm - name: sql type: string required: false @@ -156,7 +156,7 @@ parameters: human_description: en_US: SQL queries to your training data zh_Hans: 用于训练RAG Model的SQL语句 - form: form + form: llm - name: memos type: string required: false @@ -166,7 +166,7 @@ parameters: human_description: en_US: Sometimes you may want to add documentation about your business terminology or definitions zh_Hans: 添加更多关于数据库的业务说明 - form: form + form: llm - name: enable_training type: boolean required: false diff --git a/api/core/tools/tool/workflow_tool.py b/api/core/tools/tool/workflow_tool.py index 2ab72213ff90dc..721fa06c543e86 100644 --- a/api/core/tools/tool/workflow_tool.py +++ b/api/core/tools/tool/workflow_tool.py @@ -175,7 +175,7 @@ def _transform_args(self, tool_parameters: dict) -> tuple[dict, list[dict]]: files.append(file_dict) except Exception as e: - logger.exception(e) + logger.exception(f"Failed to transform file {file}") else: parameters_result[parameter.name] = tool_parameters.get(parameter.name) diff --git a/api/core/tools/tool_file_manager.py b/api/core/tools/tool_file_manager.py index ff56e20e8758ea..5052f0897a2958 100644 --- a/api/core/tools/tool_file_manager.py +++ b/api/core/tools/tool_file_manager.py @@ -98,7 +98,7 @@ def create_file_by_url( response.raise_for_status() blob = response.content except Exception as e: - logger.exception(f"Failed to download file from {file_url}: {e}") + logger.exception(f"Failed to download file from {file_url}") raise mimetype = guess_type(file_url)[0] or "octet/stream" diff --git a/api/core/tools/tool_manager.py b/api/core/tools/tool_manager.py index bf2ad13620b629..ac333162b6bb1c 100644 --- a/api/core/tools/tool_manager.py +++ b/api/core/tools/tool_manager.py @@ -388,7 +388,7 @@ def _list_builtin_providers(cls) -> Generator[BuiltinToolProviderController, Non yield provider except Exception as e: - logger.exception(f"load builtin provider {provider} error: {e}") + logger.exception(f"load builtin provider {provider}") continue # set builtin providers loaded cls._builtin_providers_loaded = True @@ -555,6 +555,7 @@ def user_get_api_provider(cls, provider: str, tenant_id: str) -> dict: """ get tool provider """ + provider_name = provider provider: ApiToolProvider = ( db.session.query(ApiToolProvider) .filter( @@ -565,7 +566,7 @@ def user_get_api_provider(cls, provider: str, tenant_id: str) -> dict: ) if provider is None: - raise ValueError(f"you have not added provider {provider}") + raise ValueError(f"you have not added provider {provider_name}") try: credentials = json.loads(provider.credentials_str) or {} diff --git a/api/core/tools/utils/message_transformer.py b/api/core/tools/utils/message_transformer.py index 1812d245712189..e30c903a4b1146 100644 --- a/api/core/tools/utils/message_transformer.py +++ b/api/core/tools/utils/message_transformer.py @@ -40,7 +40,7 @@ def transform_tool_invoke_messages( ) ) except Exception as e: - logger.exception(e) + logger.exception(f"Failed to download image from {url}") result.append( ToolInvokeMessage( type=ToolInvokeMessage.MessageType.TEXT, diff --git a/api/core/tools/utils/web_reader_tool.py b/api/core/tools/utils/web_reader_tool.py index 5807d61b9409a6..3aae31e93a1304 100644 --- a/api/core/tools/utils/web_reader_tool.py +++ b/api/core/tools/utils/web_reader_tool.py @@ -356,3 +356,19 @@ def content_digest(element): digest.update(child.encode("utf-8")) digest = digest.hexdigest() return digest + + +def get_image_upload_file_ids(content): + pattern = r"!\[image\]\((http?://.*?(file-preview|image-preview))\)" + matches = re.findall(pattern, content) + image_upload_file_ids = [] + for match in matches: + if match[1] == "file-preview": + content_pattern = r"files/([^/]+)/file-preview" + else: + content_pattern = r"files/([^/]+)/image-preview" + content_match = re.search(content_pattern, match[0]) + if content_match: + image_upload_file_id = content_match.group(1) + image_upload_file_ids.append(image_upload_file_id) + return image_upload_file_ids diff --git a/api/core/variables/__init__.py b/api/core/variables/__init__.py index 87f9e3ed45c7cb..144c1b899fb397 100644 --- a/api/core/variables/__init__.py +++ b/api/core/variables/__init__.py @@ -17,6 +17,7 @@ from .types import SegmentType from .variables import ( ArrayAnyVariable, + ArrayFileVariable, ArrayNumberVariable, ArrayObjectVariable, ArrayStringVariable, @@ -58,4 +59,5 @@ "ArrayStringSegment", "FileSegment", "FileVariable", + "ArrayFileVariable", ] diff --git a/api/core/variables/variables.py b/api/core/variables/variables.py index ddc69141928c83..c902303eef54d4 100644 --- a/api/core/variables/variables.py +++ b/api/core/variables/variables.py @@ -1,9 +1,13 @@ +from collections.abc import Sequence +from uuid import uuid4 + from pydantic import Field from core.helper import encrypter from .segments import ( ArrayAnySegment, + ArrayFileSegment, ArrayNumberSegment, ArrayObjectSegment, ArrayStringSegment, @@ -24,11 +28,12 @@ class Variable(Segment): """ id: str = Field( - default="", - description="Unique identity for variable. It's only used by environment variables now.", + default=lambda _: str(uuid4()), + description="Unique identity for variable.", ) name: str description: str = Field(default="", description="Description of the variable.") + selector: Sequence[str] = Field(default_factory=list) class StringVariable(StringSegment, Variable): @@ -78,3 +83,7 @@ class NoneVariable(NoneSegment, Variable): class FileVariable(FileSegment, Variable): pass + + +class ArrayFileVariable(ArrayFileSegment, Variable): + pass diff --git a/api/core/workflow/entities/node_entities.py b/api/core/workflow/entities/node_entities.py index 7e10cddc712baa..a7472666614fab 100644 --- a/api/core/workflow/entities/node_entities.py +++ b/api/core/workflow/entities/node_entities.py @@ -24,6 +24,7 @@ class NodeRunMetadataKey(str, Enum): PARENT_PARALLEL_ID = "parent_parallel_id" PARENT_PARALLEL_START_NODE_ID = "parent_parallel_start_node_id" PARALLEL_MODE_RUN_ID = "parallel_mode_run_id" + ITERATION_DURATION_MAP = "iteration_duration_map" # single iteration duration if iteration node runs class NodeRunResult(BaseModel): diff --git a/api/core/workflow/entities/variable_pool.py b/api/core/workflow/entities/variable_pool.py index 3dc3395da1e3af..844b46f3528d42 100644 --- a/api/core/workflow/entities/variable_pool.py +++ b/api/core/workflow/entities/variable_pool.py @@ -95,13 +95,16 @@ def add(self, selector: Sequence[str], value: Any, /) -> None: if len(selector) < 2: raise ValueError("Invalid selector") + if isinstance(value, Variable): + variable = value if isinstance(value, Segment): - v = value + variable = variable_factory.segment_to_variable(segment=value, selector=selector) else: - v = variable_factory.build_segment(value) + segment = variable_factory.build_segment(value) + variable = variable_factory.segment_to_variable(segment=segment, selector=selector) hash_key = hash(tuple(selector[1:])) - self.variable_dictionary[selector[0]][hash_key] = v + self.variable_dictionary[selector[0]][hash_key] = variable def get(self, selector: Sequence[str], /) -> Segment | None: """ diff --git a/api/core/workflow/graph_engine/entities/event.py b/api/core/workflow/graph_engine/entities/event.py index bacea191dd866c..3736e632c3f1eb 100644 --- a/api/core/workflow/graph_engine/entities/event.py +++ b/api/core/workflow/graph_engine/entities/event.py @@ -148,6 +148,7 @@ class IterationRunStartedEvent(BaseIterationEvent): class IterationRunNextEvent(BaseIterationEvent): index: int = Field(..., description="index") pre_iteration_output: Optional[Any] = Field(None, description="pre iteration output") + duration: Optional[float] = Field(None, description="duration") class IterationRunSucceededEvent(BaseIterationEvent): @@ -156,6 +157,7 @@ class IterationRunSucceededEvent(BaseIterationEvent): outputs: Optional[dict[str, Any]] = None metadata: Optional[dict[str, Any]] = None steps: int = 0 + iteration_duration_map: Optional[dict[str, float]] = None class IterationRunFailedEvent(BaseIterationEvent): diff --git a/api/core/workflow/graph_engine/graph_engine.py b/api/core/workflow/graph_engine/graph_engine.py index f07ad4de11bdfe..60a5901b21390f 100644 --- a/api/core/workflow/graph_engine/graph_engine.py +++ b/api/core/workflow/graph_engine/graph_engine.py @@ -172,7 +172,7 @@ def run(self) -> Generator[GraphEngineEvent, None, None]: "answer" ].strip() except Exception as e: - logger.exception(f"Graph run failed: {str(e)}") + logger.exception("Graph run failed") yield GraphRunFailedEvent(error=str(e)) return @@ -692,7 +692,7 @@ def _run_node( ) return except Exception as e: - logger.exception(f"Node {node_instance.node_data.title} run failed: {str(e)}") + logger.exception(f"Node {node_instance.node_data.title} run failed") raise e finally: db.session.close() diff --git a/api/core/workflow/nodes/base/node.py b/api/core/workflow/nodes/base/node.py index 1433c8eaed6d4d..1871fff6181c42 100644 --- a/api/core/workflow/nodes/base/node.py +++ b/api/core/workflow/nodes/base/node.py @@ -69,7 +69,7 @@ def run(self) -> Generator[Union[NodeEvent, "InNodeEvent"], None, None]: try: result = self._run() except Exception as e: - logger.exception(f"Node {self.node_id} failed to run: {e}") + logger.exception(f"Node {self.node_id} failed to run") result = NodeRunResult( status=WorkflowNodeExecutionStatus.FAILED, error=str(e), diff --git a/api/core/workflow/nodes/document_extractor/node.py b/api/core/workflow/nodes/document_extractor/node.py index c90017d5e15cec..c3cacdab7f85be 100644 --- a/api/core/workflow/nodes/document_extractor/node.py +++ b/api/core/workflow/nodes/document_extractor/node.py @@ -143,14 +143,14 @@ def _extract_text_by_file_extension(*, file_content: bytes, file_extension: str) def _extract_text_from_plain_text(file_content: bytes) -> str: try: - return file_content.decode("utf-8") + return file_content.decode("utf-8", "ignore") except UnicodeDecodeError as e: raise TextExtractionError("Failed to decode plain text file") from e def _extract_text_from_json(file_content: bytes) -> str: try: - json_data = json.loads(file_content.decode("utf-8")) + json_data = json.loads(file_content.decode("utf-8", "ignore")) return json.dumps(json_data, indent=2, ensure_ascii=False) except (UnicodeDecodeError, json.JSONDecodeError) as e: raise TextExtractionError(f"Failed to decode or parse JSON file: {e}") from e @@ -159,7 +159,7 @@ def _extract_text_from_json(file_content: bytes) -> str: def _extract_text_from_yaml(file_content: bytes) -> str: """Extract the content from yaml file""" try: - yaml_data = yaml.safe_load_all(file_content.decode("utf-8")) + yaml_data = yaml.safe_load_all(file_content.decode("utf-8", "ignore")) return yaml.dump_all(yaml_data, allow_unicode=True, sort_keys=False) except (UnicodeDecodeError, yaml.YAMLError) as e: raise TextExtractionError(f"Failed to decode or parse YAML file: {e}") from e @@ -217,7 +217,7 @@ def _extract_text_from_file(file: File): def _extract_text_from_csv(file_content: bytes) -> str: try: - csv_file = io.StringIO(file_content.decode("utf-8")) + csv_file = io.StringIO(file_content.decode("utf-8", "ignore")) csv_reader = csv.reader(csv_file) rows = list(csv_reader) diff --git a/api/core/workflow/nodes/iteration/iteration_node.py b/api/core/workflow/nodes/iteration/iteration_node.py index e5863d771b0431..d5428f02868b76 100644 --- a/api/core/workflow/nodes/iteration/iteration_node.py +++ b/api/core/workflow/nodes/iteration/iteration_node.py @@ -156,6 +156,7 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]: index=0, pre_iteration_output=None, ) + iter_run_map: dict[str, float] = {} outputs: list[Any] = [None] * len(iterator_list_value) try: if self.node_data.is_parallel: @@ -175,6 +176,7 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]: iteration_graph, index, item, + iter_run_map, ) future.add_done_callback(thread_pool.task_done_callback) futures.append(future) @@ -213,6 +215,7 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]: start_at, graph_engine, iteration_graph, + iter_run_map, ) if self.node_data.error_handle_mode == ErrorHandleMode.REMOVE_ABNORMAL_OUTPUT: outputs = [output for output in outputs if output is not None] @@ -230,7 +233,9 @@ def _run(self) -> Generator[NodeEvent | InNodeEvent, None, None]: yield RunCompletedEvent( run_result=NodeRunResult( - status=WorkflowNodeExecutionStatus.SUCCEEDED, outputs={"output": jsonable_encoder(outputs)} + status=WorkflowNodeExecutionStatus.SUCCEEDED, + outputs={"output": jsonable_encoder(outputs)}, + metadata={NodeRunMetadataKey.ITERATION_DURATION_MAP: iter_run_map}, ) ) except IterationNodeError as e: @@ -356,15 +361,19 @@ def _run_single_iter( start_at: datetime, graph_engine: "GraphEngine", iteration_graph: Graph, + iter_run_map: dict[str, float], parallel_mode_run_id: Optional[str] = None, ) -> Generator[NodeEvent | InNodeEvent, None, None]: """ run single iteration """ + iter_start_at = datetime.now(timezone.utc).replace(tzinfo=None) + try: rst = graph_engine.run() # get current iteration index current_index = variable_pool.get([self.node_id, "index"]).value + iteration_run_id = parallel_mode_run_id if parallel_mode_run_id is not None else f"{current_index}" next_index = int(current_index) + 1 if current_index is None: @@ -431,6 +440,8 @@ def _run_single_iter( variable_pool.add([self.node_id, "index"], next_index) if next_index < len(iterator_list_value): variable_pool.add([self.node_id, "item"], iterator_list_value[next_index]) + duration = (datetime.now(timezone.utc).replace(tzinfo=None) - iter_start_at).total_seconds() + iter_run_map[iteration_run_id] = duration yield IterationRunNextEvent( iteration_id=self.id, iteration_node_id=self.node_id, @@ -439,6 +450,7 @@ def _run_single_iter( index=next_index, parallel_mode_run_id=parallel_mode_run_id, pre_iteration_output=None, + duration=duration, ) return elif self.node_data.error_handle_mode == ErrorHandleMode.REMOVE_ABNORMAL_OUTPUT: @@ -449,6 +461,8 @@ def _run_single_iter( if next_index < len(iterator_list_value): variable_pool.add([self.node_id, "item"], iterator_list_value[next_index]) + duration = (datetime.now(timezone.utc).replace(tzinfo=None) - iter_start_at).total_seconds() + iter_run_map[iteration_run_id] = duration yield IterationRunNextEvent( iteration_id=self.id, iteration_node_id=self.node_id, @@ -457,6 +471,7 @@ def _run_single_iter( index=next_index, parallel_mode_run_id=parallel_mode_run_id, pre_iteration_output=None, + duration=duration, ) return elif self.node_data.error_handle_mode == ErrorHandleMode.TERMINATED: @@ -474,7 +489,10 @@ def _run_single_iter( ) yield metadata_event - current_iteration_output = variable_pool.get(self.node_data.output_selector).value + current_output_segment = variable_pool.get(self.node_data.output_selector) + if current_output_segment is None: + raise IterationNodeError("iteration output selector not found") + current_iteration_output = current_output_segment.value outputs[current_index] = current_iteration_output # remove all nodes outputs from variable pool for node_id in iteration_graph.node_ids: @@ -485,6 +503,8 @@ def _run_single_iter( if next_index < len(iterator_list_value): variable_pool.add([self.node_id, "item"], iterator_list_value[next_index]) + duration = (datetime.now(timezone.utc).replace(tzinfo=None) - iter_start_at).total_seconds() + iter_run_map[iteration_run_id] = duration yield IterationRunNextEvent( iteration_id=self.id, iteration_node_id=self.node_id, @@ -493,6 +513,7 @@ def _run_single_iter( index=next_index, parallel_mode_run_id=parallel_mode_run_id, pre_iteration_output=jsonable_encoder(current_iteration_output) if current_iteration_output else None, + duration=duration, ) except IterationNodeError as e: @@ -528,6 +549,7 @@ def _run_single_iter_parallel( iteration_graph: Graph, index: int, item: Any, + iter_run_map: dict[str, float], ) -> Generator[NodeEvent | InNodeEvent, None, None]: """ run single iteration in parallel mode @@ -546,6 +568,7 @@ def _run_single_iter_parallel( start_at=start_at, graph_engine=graph_engine_copy, iteration_graph=iteration_graph, + iter_run_map=iter_run_map, parallel_mode_run_id=parallel_mode_run_id, ): q.put(event) diff --git a/api/core/workflow/nodes/list_operator/entities.py b/api/core/workflow/nodes/list_operator/entities.py index 79cef1c27ab718..75df784a922226 100644 --- a/api/core/workflow/nodes/list_operator/entities.py +++ b/api/core/workflow/nodes/list_operator/entities.py @@ -49,8 +49,14 @@ class Limit(BaseModel): size: int = -1 +class ExtractConfig(BaseModel): + enabled: bool = False + serial: str = "1" + + class ListOperatorNodeData(BaseNodeData): variable: Sequence[str] = Field(default_factory=list) filter_by: FilterBy order_by: OrderBy limit: Limit + extract_by: ExtractConfig = Field(default_factory=ExtractConfig) diff --git a/api/core/workflow/nodes/list_operator/node.py b/api/core/workflow/nodes/list_operator/node.py index 49e7ca85fd5fc8..79066cece4f93c 100644 --- a/api/core/workflow/nodes/list_operator/node.py +++ b/api/core/workflow/nodes/list_operator/node.py @@ -58,6 +58,10 @@ def _run(self): if self.node_data.filter_by.enabled: variable = self._apply_filter(variable) + # Extract + if self.node_data.extract_by.enabled: + variable = self._extract_slice(variable) + # Order if self.node_data.order_by.enabled: variable = self._apply_order(variable) @@ -140,6 +144,16 @@ def _apply_slice( result = variable.value[: self.node_data.limit.size] return variable.model_copy(update={"value": result}) + def _extract_slice( + self, variable: Union[ArrayFileSegment, ArrayNumberSegment, ArrayStringSegment] + ) -> Union[ArrayFileSegment, ArrayNumberSegment, ArrayStringSegment]: + value = int(self.graph_runtime_state.variable_pool.convert_template(self.node_data.extract_by.serial).text) - 1 + if len(variable.value) > int(value): + result = variable.value[value] + else: + result = "" + return variable.model_copy(update={"value": [result]}) + def _get_file_extract_number_func(*, key: str) -> Callable[[File], int]: match key: diff --git a/api/core/workflow/nodes/tool/tool_node.py b/api/core/workflow/nodes/tool/tool_node.py index 6870b7467d11a4..5560f2645674ab 100644 --- a/api/core/workflow/nodes/tool/tool_node.py +++ b/api/core/workflow/nodes/tool/tool_node.py @@ -1,5 +1,4 @@ from collections.abc import Mapping, Sequence -from os import path from typing import Any from sqlalchemy import select @@ -180,7 +179,6 @@ def _extract_tool_response_binary(self, tool_response: list[ToolInvokeMessage]) for response in tool_response: if response.type in {ToolInvokeMessage.MessageType.IMAGE_LINK, ToolInvokeMessage.MessageType.IMAGE}: url = str(response.message) if response.message else None - ext = path.splitext(url)[1] if url else ".bin" tool_file_id = str(url).split("/")[-1].split(".")[0] transfer_method = response.meta.get("transfer_method", FileTransferMethod.TOOL_FILE) @@ -202,7 +200,6 @@ def _extract_tool_response_binary(self, tool_response: list[ToolInvokeMessage]) ) result.append(file) elif response.type == ToolInvokeMessage.MessageType.BLOB: - # get tool file id tool_file_id = str(response.message).split("/")[-1].split(".")[0] with Session(db.engine) as session: stmt = select(ToolFile).where(ToolFile.id == tool_file_id) @@ -211,7 +208,6 @@ def _extract_tool_response_binary(self, tool_response: list[ToolInvokeMessage]) raise ValueError(f"tool file {tool_file_id} not exists") mapping = { "tool_file_id": tool_file_id, - "type": FileType.IMAGE, "transfer_method": FileTransferMethod.TOOL_FILE, } file = file_factory.build_from_mapping( @@ -228,13 +224,8 @@ def _extract_tool_response_binary(self, tool_response: list[ToolInvokeMessage]) tool_file = session.scalar(stmt) if tool_file is None: raise ToolFileError(f"Tool file {tool_file_id} does not exist") - if "." in url: - extension = "." + url.split("/")[-1].split(".")[1] - else: - extension = ".bin" mapping = { "tool_file_id": tool_file_id, - "type": FileType.IMAGE, "transfer_method": transfer_method, "url": url, } diff --git a/api/docker/entrypoint.sh b/api/docker/entrypoint.sh index 1edc558676747a..2b6a8dd3d0570d 100755 --- a/api/docker/entrypoint.sh +++ b/api/docker/entrypoint.sh @@ -21,7 +21,7 @@ if [[ "${MODE}" == "worker" ]]; then fi exec celery -A app.celery worker -P ${CELERY_WORKER_CLASS:-gevent} $CONCURRENCY_OPTION --loglevel ${LOG_LEVEL} \ - -Q ${CELERY_QUEUES:-dataset,generation,mail,ops_trace,app_deletion} + -Q ${CELERY_QUEUES:-dataset,mail,ops_trace,app_deletion} elif [[ "${MODE}" == "beat" ]]; then exec celery -A app.celery beat --loglevel ${LOG_LEVEL} diff --git a/api/extensions/ext_celery.py b/api/extensions/ext_celery.py index c5de7395b8cd29..42012eee8e6b12 100644 --- a/api/extensions/ext_celery.py +++ b/api/extensions/ext_celery.py @@ -46,7 +46,6 @@ def __call__(self, *args: object, **kwargs: object) -> object: broker_connection_retry_on_startup=True, worker_log_format=dify_config.LOG_FORMAT, worker_task_log_format=dify_config.LOG_FORMAT, - worker_logfile=dify_config.LOG_FILE, worker_hijack_root_logger=False, timezone=pytz.timezone(dify_config.LOG_TZ), ) @@ -56,6 +55,11 @@ def __call__(self, *args: object, **kwargs: object) -> object: broker_use_ssl=ssl_options, # Add the SSL options to the broker configuration ) + if dify_config.LOG_FILE: + celery_app.conf.update( + worker_logfile=dify_config.LOG_FILE, + ) + celery_app.set_default() app.extensions["celery"] = celery_app diff --git a/api/extensions/ext_logging.py b/api/extensions/ext_logging.py index 56b1d6bd28ba90..a15c73bd71786d 100644 --- a/api/extensions/ext_logging.py +++ b/api/extensions/ext_logging.py @@ -9,19 +9,21 @@ def init_app(app: Flask): - log_handlers = None + log_handlers = [] log_file = dify_config.LOG_FILE if log_file: log_dir = os.path.dirname(log_file) os.makedirs(log_dir, exist_ok=True) - log_handlers = [ + log_handlers.append( RotatingFileHandler( filename=log_file, maxBytes=dify_config.LOG_FILE_MAX_SIZE * 1024 * 1024, backupCount=dify_config.LOG_FILE_BACKUP_COUNT, - ), - logging.StreamHandler(sys.stdout), - ] + ) + ) + + # Always add StreamHandler to log to console + log_handlers.append(logging.StreamHandler(sys.stdout)) logging.basicConfig( level=dify_config.LOG_LEVEL, diff --git a/api/extensions/ext_storage.py b/api/extensions/ext_storage.py index 86fadf23d787f3..fa88da68b79e5f 100644 --- a/api/extensions/ext_storage.py +++ b/api/extensions/ext_storage.py @@ -70,7 +70,7 @@ def save(self, filename, data): try: self.storage_runner.save(filename, data) except Exception as e: - logging.exception("Failed to save file: %s", e) + logging.exception(f"Failed to save file {filename}") raise e def load(self, filename: str, /, *, stream: bool = False) -> Union[bytes, Generator]: @@ -80,42 +80,42 @@ def load(self, filename: str, /, *, stream: bool = False) -> Union[bytes, Genera else: return self.load_once(filename) except Exception as e: - logging.exception("Failed to load file: %s", e) + logging.exception(f"Failed to load file {filename}") raise e def load_once(self, filename: str) -> bytes: try: return self.storage_runner.load_once(filename) except Exception as e: - logging.exception("Failed to load_once file: %s", e) + logging.exception(f"Failed to load_once file {filename}") raise e def load_stream(self, filename: str) -> Generator: try: return self.storage_runner.load_stream(filename) except Exception as e: - logging.exception("Failed to load_stream file: %s", e) + logging.exception(f"Failed to load_stream file {filename}") raise e def download(self, filename, target_filepath): try: self.storage_runner.download(filename, target_filepath) except Exception as e: - logging.exception("Failed to download file: %s", e) + logging.exception(f"Failed to download file {filename}") raise e def exists(self, filename): try: return self.storage_runner.exists(filename) except Exception as e: - logging.exception("Failed to check file exists: %s", e) + logging.exception(f"Failed to check file exists {filename}") raise e def delete(self, filename): try: return self.storage_runner.delete(filename) except Exception as e: - logging.exception("Failed to delete file: %s", e) + logging.exception(f"Failed to delete file {filename}") raise e diff --git a/api/factories/file_factory.py b/api/factories/file_factory.py index 738b2b3478f46a..15e9d7f34f79c6 100644 --- a/api/factories/file_factory.py +++ b/api/factories/file_factory.py @@ -180,6 +180,20 @@ def _get_remote_file_info(url: str): return mime_type, filename, file_size +def _get_file_type_by_mimetype(mime_type: str) -> FileType: + if "image" in mime_type: + file_type = FileType.IMAGE + elif "video" in mime_type: + file_type = FileType.VIDEO + elif "audio" in mime_type: + file_type = FileType.AUDIO + elif "text" in mime_type or "pdf" in mime_type: + file_type = FileType.DOCUMENT + else: + file_type = FileType.CUSTOM + return file_type + + def _build_from_tool_file( *, mapping: Mapping[str, Any], @@ -199,12 +213,13 @@ def _build_from_tool_file( raise ValueError(f"ToolFile {mapping.get('tool_file_id')} not found") extension = "." + tool_file.file_key.split(".")[-1] if "." in tool_file.file_key else ".bin" + file_type = mapping.get("type", _get_file_type_by_mimetype(tool_file.mimetype)) return File( id=mapping.get("id"), tenant_id=tenant_id, filename=tool_file.name, - type=FileType.value_of(mapping.get("type")), + type=file_type, transfer_method=transfer_method, remote_url=tool_file.original_url, related_id=tool_file.id, diff --git a/api/factories/variable_factory.py b/api/factories/variable_factory.py index 0191102b902cc9..5b004405b4a7a0 100644 --- a/api/factories/variable_factory.py +++ b/api/factories/variable_factory.py @@ -1,34 +1,65 @@ -from collections.abc import Mapping +from collections.abc import Mapping, Sequence from typing import Any +from uuid import uuid4 from configs import dify_config from core.file import File -from core.variables import ( +from core.variables.exc import VariableError +from core.variables.segments import ( ArrayAnySegment, ArrayFileSegment, ArrayNumberSegment, - ArrayNumberVariable, ArrayObjectSegment, - ArrayObjectVariable, ArraySegment, ArrayStringSegment, - ArrayStringVariable, FileSegment, FloatSegment, - FloatVariable, IntegerSegment, - IntegerVariable, NoneSegment, ObjectSegment, - ObjectVariable, - SecretVariable, Segment, - SegmentType, StringSegment, +) +from core.variables.types import SegmentType +from core.variables.variables import ( + ArrayAnyVariable, + ArrayFileVariable, + ArrayNumberVariable, + ArrayObjectVariable, + ArrayStringVariable, + FileVariable, + FloatVariable, + IntegerVariable, + NoneVariable, + ObjectVariable, + SecretVariable, StringVariable, Variable, ) -from core.variables.exc import VariableError + + +class InvalidSelectorError(ValueError): + pass + + +class UnsupportedSegmentTypeError(Exception): + pass + + +# Define the constant +SEGMENT_TO_VARIABLE_MAP = { + StringSegment: StringVariable, + IntegerSegment: IntegerVariable, + FloatSegment: FloatVariable, + ObjectSegment: ObjectVariable, + FileSegment: FileVariable, + ArrayStringSegment: ArrayStringVariable, + ArrayNumberSegment: ArrayNumberVariable, + ArrayObjectSegment: ArrayObjectVariable, + ArrayFileSegment: ArrayFileVariable, + ArrayAnySegment: ArrayAnyVariable, + NoneSegment: NoneVariable, +} def build_variable_from_mapping(mapping: Mapping[str, Any], /) -> Variable: @@ -96,3 +127,30 @@ def build_segment(value: Any, /) -> Segment: case _: raise ValueError(f"not supported value {value}") raise ValueError(f"not supported value {value}") + + +def segment_to_variable( + *, + segment: Segment, + selector: Sequence[str], + id: str | None = None, + name: str | None = None, + description: str = "", +) -> Variable: + if isinstance(segment, Variable): + return segment + name = name or selector[-1] + id = id or str(uuid4()) + + segment_type = type(segment) + if segment_type not in SEGMENT_TO_VARIABLE_MAP: + raise UnsupportedSegmentTypeError(f"not supported segment type {segment_type}") + + variable_class = SEGMENT_TO_VARIABLE_MAP[segment_type] + return variable_class( + id=id, + name=name, + description=description, + value=segment.value, + selector=selector, + ) diff --git a/api/libs/smtp.py b/api/libs/smtp.py index d57d99f3b72217..2325d69a413d4a 100644 --- a/api/libs/smtp.py +++ b/api/libs/smtp.py @@ -39,13 +39,13 @@ def send(self, mail: dict): smtp.sendmail(self._from, mail["to"], msg.as_string()) except smtplib.SMTPException as e: - logging.exception(f"SMTP error occurred: {str(e)}") + logging.exception("SMTP error occurred") raise except TimeoutError as e: - logging.exception(f"Timeout occurred while sending email: {str(e)}") + logging.exception("Timeout occurred while sending email") raise except Exception as e: - logging.exception(f"Unexpected error occurred while sending email: {str(e)}") + logging.exception(f"Unexpected error occurred while sending email to {mail['to']}") raise finally: if smtp: diff --git a/api/models/dataset.py b/api/models/dataset.py index a1a626d7e46b2c..a8b2c419d1ee0a 100644 --- a/api/models/dataset.py +++ b/api/models/dataset.py @@ -679,7 +679,7 @@ def object_hook(self, dct): return json.loads(keyword_table_text.decode("utf-8"), cls=SetDecoder) return None except Exception as e: - logging.exception(str(e)) + logging.exception(f"Failed to load keyword table from file: {file_key}") return None diff --git a/api/poetry.lock b/api/poetry.lock index 259ede68980a40..74c2ef5dc6fab8 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -932,6 +932,10 @@ files = [ {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"}, {file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"}, {file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"}, {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"}, @@ -944,8 +948,14 @@ files = [ {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"}, {file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"}, {file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"}, {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"}, @@ -956,8 +966,24 @@ files = [ {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"}, {file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"}, {file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"}, + {file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"}, + {file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"}, {file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"}, @@ -967,6 +993,10 @@ files = [ {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"}, {file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"}, {file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"}, {file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"}, @@ -978,6 +1008,10 @@ files = [ {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"}, {file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"}, {file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"}, {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"}, @@ -990,6 +1024,10 @@ files = [ {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"}, {file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"}, {file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"}, {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"}, @@ -1002,6 +1040,10 @@ files = [ {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"}, {file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"}, {file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"}, {file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"}, @@ -2411,6 +2453,26 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "fal-client" +version = "0.5.6" +description = "Python client for fal.ai" +optional = false +python-versions = ">=3.8" +files = [ + {file = "fal_client-0.5.6-py3-none-any.whl", hash = "sha256:631fd857a3c44753ee46a2eea1e7276471453aca58faac9c3702f744c7c84050"}, + {file = "fal_client-0.5.6.tar.gz", hash = "sha256:d3afc4b6250023d0ee8437ec504558231d3b106d7aabc12cda8c39883faddecb"}, +] + +[package.dependencies] +httpx = ">=0.21.0,<1" +httpx-sse = ">=0.4.0,<0.5" + +[package.extras] +dev = ["fal-client[docs,test]"] +docs = ["sphinx", "sphinx-autodoc-typehints", "sphinx-rtd-theme"] +test = ["pillow", "pytest", "pytest-asyncio"] + [[package]] name = "fastapi" version = "0.115.4" @@ -4049,6 +4111,17 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] zstd = ["zstandard (>=0.18.0)"] +[[package]] +name = "httpx-sse" +version = "0.4.0" +description = "Consume Server-Sent Event (SSE) messages with HTTPX." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721"}, + {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, +] + [[package]] name = "huggingface-hub" version = "0.16.4" @@ -8466,29 +8539,29 @@ pyasn1 = ">=0.1.3" [[package]] name = "ruff" -version = "0.6.9" +version = "0.7.3" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, - {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, - {file = "ruff-0.6.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53fd8ca5e82bdee8da7f506d7b03a261f24cd43d090ea9db9a1dc59d9313914c"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:645d7d8761f915e48a00d4ecc3686969761df69fb561dd914a773c1a8266e14e"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eae02b700763e3847595b9d2891488989cac00214da7f845f4bcf2989007d577"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d5ccc9e58112441de8ad4b29dcb7a86dc25c5f770e3c06a9d57e0e5eba48829"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:417b81aa1c9b60b2f8edc463c58363075412866ae4e2b9ab0f690dc1e87ac1b5"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c866b631f5fbce896a74a6e4383407ba7507b815ccc52bcedabb6810fdb3ef7"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7b118afbb3202f5911486ad52da86d1d52305b59e7ef2031cea3425142b97d6f"}, - {file = "ruff-0.6.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a67267654edc23c97335586774790cde402fb6bbdb3c2314f1fc087dee320bfa"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3ef0cc774b00fec123f635ce5c547dac263f6ee9fb9cc83437c5904183b55ceb"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:12edd2af0c60fa61ff31cefb90aef4288ac4d372b4962c2864aeea3a1a2460c0"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:55bb01caeaf3a60b2b2bba07308a02fca6ab56233302406ed5245180a05c5625"}, - {file = "ruff-0.6.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:925d26471fa24b0ce5a6cdfab1bb526fb4159952385f386bdcc643813d472039"}, - {file = "ruff-0.6.9-py3-none-win32.whl", hash = "sha256:eb61ec9bdb2506cffd492e05ac40e5bc6284873aceb605503d8494180d6fc84d"}, - {file = "ruff-0.6.9-py3-none-win_amd64.whl", hash = "sha256:785d31851c1ae91f45b3d8fe23b8ae4b5170089021fbb42402d811135f0b7117"}, - {file = "ruff-0.6.9-py3-none-win_arm64.whl", hash = "sha256:a9641e31476d601f83cd602608739a0840e348bda93fec9f1ee816f8b6798b93"}, - {file = "ruff-0.6.9.tar.gz", hash = "sha256:b076ef717a8e5bc819514ee1d602bbdca5b4420ae13a9cf61a0c0a4f53a2baa2"}, + {file = "ruff-0.7.3-py3-none-linux_armv6l.whl", hash = "sha256:34f2339dc22687ec7e7002792d1f50712bf84a13d5152e75712ac08be565d344"}, + {file = "ruff-0.7.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fb397332a1879b9764a3455a0bb1087bda876c2db8aca3a3cbb67b3dbce8cda0"}, + {file = "ruff-0.7.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:37d0b619546103274e7f62643d14e1adcbccb242efda4e4bdb9544d7764782e9"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59f0c3ee4d1a6787614e7135b72e21024875266101142a09a61439cb6e38a5"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:44eb93c2499a169d49fafd07bc62ac89b1bc800b197e50ff4633aed212569299"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d0242ce53f3a576c35ee32d907475a8d569944c0407f91d207c8af5be5dae4e"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6b6224af8b5e09772c2ecb8dc9f3f344c1aa48201c7f07e7315367f6dd90ac29"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c50f95a82b94421c964fae4c27c0242890a20fe67d203d127e84fbb8013855f5"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7f3eff9961b5d2644bcf1616c606e93baa2d6b349e8aa8b035f654df252c8c67"}, + {file = "ruff-0.7.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8963cab06d130c4df2fd52c84e9f10d297826d2e8169ae0c798b6221be1d1d2"}, + {file = "ruff-0.7.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:61b46049d6edc0e4317fb14b33bd693245281a3007288b68a3f5b74a22a0746d"}, + {file = "ruff-0.7.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:10ebce7696afe4644e8c1a23b3cf8c0f2193a310c18387c06e583ae9ef284de2"}, + {file = "ruff-0.7.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3f36d56326b3aef8eeee150b700e519880d1aab92f471eefdef656fd57492aa2"}, + {file = "ruff-0.7.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5d024301109a0007b78d57ab0ba190087b43dce852e552734ebf0b0b85e4fb16"}, + {file = "ruff-0.7.3-py3-none-win32.whl", hash = "sha256:4ba81a5f0c5478aa61674c5a2194de8b02652f17addf8dfc40c8937e6e7d79fc"}, + {file = "ruff-0.7.3-py3-none-win_amd64.whl", hash = "sha256:588a9ff2fecf01025ed065fe28809cd5a53b43505f48b69a1ac7707b1b7e4088"}, + {file = "ruff-0.7.3-py3-none-win_arm64.whl", hash = "sha256:1713e2c5545863cdbfe2cbce21f69ffaf37b813bfd1fb3b90dc9a6f1963f5a8c"}, + {file = "ruff-0.7.3.tar.gz", hash = "sha256:e1d1ba2e40b6e71a61b063354d04be669ab0d39c352461f3d789cac68b54a313"}, ] [[package]] @@ -11005,4 +11078,4 @@ cffi = ["cffi (>=1.11)"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "f20bd678044926913dbbc24bd0cf22503a75817aa55f59457ff7822032139b77" +content-hash = "2ba4b464eebc26598f290fa94713acc44c588f902176e6efa80622911d40f0ac" diff --git a/api/pyproject.toml b/api/pyproject.toml index 40485a8efacf84..8def7cd8f73ae0 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -35,6 +35,7 @@ select = [ "S506", # unsafe-yaml-load "SIM", # flake8-simplify rules "TRY400", # error-instead-of-exception + "TRY401", # verbose-log-message "UP", # pyupgrade rules "W191", # tab-indentation "W605", # invalid-escape-sequence @@ -122,6 +123,7 @@ celery = "~5.4.0" chardet = "~5.1.0" cohere = "~5.2.4" dashscope = { version = "~1.17.0", extras = ["tokenizer"] } +fal-client = "0.5.6" flask = "~3.0.1" flask-compress = "~1.14" flask-cors = "~4.0.0" @@ -278,4 +280,4 @@ pytest-mock = "~3.14.0" optional = true [tool.poetry.group.lint.dependencies] dotenv-linter = "~0.5.0" -ruff = "~0.6.9" +ruff = "~0.7.3" diff --git a/api/services/account_service.py b/api/services/account_service.py index 963a05594845e4..aacc1c85f6e8e1 100644 --- a/api/services/account_service.py +++ b/api/services/account_service.py @@ -779,7 +779,7 @@ def setup(cls, email: str, name: str, password: str, ip_address: str) -> None: db.session.query(Tenant).delete() db.session.commit() - logging.exception(f"Setup failed: {e}") + logging.exception(f"Setup account failed, email: {email}, name: {name}") raise ValueError(f"Setup failed: {e}") @classmethod @@ -821,7 +821,7 @@ def register( db.session.rollback() except Exception as e: db.session.rollback() - logging.exception(f"Register failed: {e}") + logging.exception("Register failed") raise AccountRegisterError(f"Registration failed: {e}") from e return account diff --git a/api/services/app_service.py b/api/services/app_service.py index ac45d623e84bc9..620d0ac270f76e 100644 --- a/api/services/app_service.py +++ b/api/services/app_service.py @@ -88,7 +88,7 @@ def create_app(self, tenant_id: str, args: dict, account: Account) -> App: except (ProviderTokenNotInitError, LLMBadRequestError): model_instance = None except Exception as e: - logging.exception(e) + logging.exception(f"Get default model instance failed, tenant_id: {tenant_id}") model_instance = None if model_instance: diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py index 8562dad1d3e9ee..806dbdf8c529a4 100644 --- a/api/services/dataset_service.py +++ b/api/services/dataset_service.py @@ -1458,6 +1458,7 @@ def multi_create_segment(cls, segments: list, document: Document, dataset: Datas pre_segment_data_list = [] segment_data_list = [] keywords_list = [] + position = max_position + 1 if max_position else 1 for segment_item in segments: content = segment_item["content"] doc_id = str(uuid.uuid4()) @@ -1475,7 +1476,7 @@ def multi_create_segment(cls, segments: list, document: Document, dataset: Datas document_id=document.id, index_node_id=doc_id, index_node_hash=segment_hash, - position=max_position + 1 if max_position else 1, + position=position, content=content, word_count=len(content), tokens=tokens, @@ -1490,6 +1491,7 @@ def multi_create_segment(cls, segments: list, document: Document, dataset: Datas increment_word_count += segment_document.word_count db.session.add(segment_document) segment_data_list.append(segment_document) + position += 1 pre_segment_data_list.append(segment_document) if "keywords" in segment_item: diff --git a/api/services/feature_service.py b/api/services/feature_service.py index c321393bc53f66..d0b04628cfa0f3 100644 --- a/api/services/feature_service.py +++ b/api/services/feature_service.py @@ -1,3 +1,5 @@ +from enum import Enum + from pydantic import BaseModel, ConfigDict from configs import dify_config @@ -20,6 +22,20 @@ class LimitationModel(BaseModel): limit: int = 0 +class LicenseStatus(str, Enum): + NONE = "none" + INACTIVE = "inactive" + ACTIVE = "active" + EXPIRING = "expiring" + EXPIRED = "expired" + LOST = "lost" + + +class LicenseModel(BaseModel): + status: LicenseStatus = LicenseStatus.NONE + expired_at: str = "" + + class FeatureModel(BaseModel): billing: BillingModel = BillingModel() members: LimitationModel = LimitationModel(size=0, limit=1) @@ -47,6 +63,7 @@ class SystemFeatureModel(BaseModel): enable_social_oauth_login: bool = False is_allow_register: bool = False is_allow_create_workspace: bool = False + license: LicenseModel = LicenseModel() class FeatureService: @@ -131,17 +148,31 @@ def _fulfill_params_from_enterprise(cls, features): if "sso_enforced_for_signin" in enterprise_info: features.sso_enforced_for_signin = enterprise_info["sso_enforced_for_signin"] + if "sso_enforced_for_signin_protocol" in enterprise_info: features.sso_enforced_for_signin_protocol = enterprise_info["sso_enforced_for_signin_protocol"] + if "sso_enforced_for_web" in enterprise_info: features.sso_enforced_for_web = enterprise_info["sso_enforced_for_web"] + if "sso_enforced_for_web_protocol" in enterprise_info: features.sso_enforced_for_web_protocol = enterprise_info["sso_enforced_for_web_protocol"] + if "enable_email_code_login" in enterprise_info: features.enable_email_code_login = enterprise_info["enable_email_code_login"] + if "enable_email_password_login" in enterprise_info: features.enable_email_password_login = enterprise_info["enable_email_password_login"] + if "is_allow_register" in enterprise_info: features.is_allow_register = enterprise_info["is_allow_register"] + if "is_allow_create_workspace" in enterprise_info: features.is_allow_create_workspace = enterprise_info["is_allow_create_workspace"] + + if "license" in enterprise_info: + if "status" in enterprise_info["license"]: + features.license.status = enterprise_info["license"]["status"] + + if "expired_at" in enterprise_info["license"]: + features.license.expired_at = enterprise_info["license"]["expired_at"] diff --git a/api/services/tools/api_tools_manage_service.py b/api/services/tools/api_tools_manage_service.py index 4a938918550ab8..78a80f70ab6b00 100644 --- a/api/services/tools/api_tools_manage_service.py +++ b/api/services/tools/api_tools_manage_service.py @@ -113,8 +113,10 @@ def create_api_tool_provider( if schema_type not in [member.value for member in ApiProviderSchemaType]: raise ValueError(f"invalid schema type {schema}") + provider_name = provider_name.strip() + # check if the provider exists - provider: ApiToolProvider = ( + provider = ( db.session.query(ApiToolProvider) .filter( ApiToolProvider.tenant_id == tenant_id, @@ -193,27 +195,27 @@ def get_api_tool_provider_remote_schema(user_id: str, tenant_id: str, url: str): # try to parse schema, avoid SSRF attack ApiToolManageService.parser_api_schema(schema) except Exception as e: - logger.exception(f"parse api schema error: {str(e)}") + logger.exception("parse api schema error") raise ValueError("invalid schema, please check the url you provided") return {"schema": schema} @staticmethod - def list_api_tool_provider_tools(user_id: str, tenant_id: str, provider: str) -> list[UserTool]: + def list_api_tool_provider_tools(user_id: str, tenant_id: str, provider_name: str) -> list[UserTool]: """ list api tool provider tools """ - provider: ApiToolProvider = ( + provider = ( db.session.query(ApiToolProvider) .filter( ApiToolProvider.tenant_id == tenant_id, - ApiToolProvider.name == provider, + ApiToolProvider.name == provider_name, ) .first() ) if provider is None: - raise ValueError(f"you have not added provider {provider}") + raise ValueError(f"you have not added provider {provider_name}") controller = ToolTransformService.api_provider_to_controller(db_provider=provider) labels = ToolLabelManager.get_tool_labels(controller) @@ -246,8 +248,10 @@ def update_api_tool_provider( if schema_type not in [member.value for member in ApiProviderSchemaType]: raise ValueError(f"invalid schema type {schema}") + provider_name = provider_name.strip() + # check if the provider exists - provider: ApiToolProvider = ( + provider = ( db.session.query(ApiToolProvider) .filter( ApiToolProvider.tenant_id == tenant_id, @@ -314,7 +318,7 @@ def delete_api_tool_provider(user_id: str, tenant_id: str, provider_name: str): """ delete tool provider """ - provider: ApiToolProvider = ( + provider = ( db.session.query(ApiToolProvider) .filter( ApiToolProvider.tenant_id == tenant_id, @@ -364,7 +368,7 @@ def test_api_tool_preview( if tool_bundle is None: raise ValueError(f"invalid tool name {tool_name}") - db_provider: ApiToolProvider = ( + db_provider = ( db.session.query(ApiToolProvider) .filter( ApiToolProvider.tenant_id == tenant_id, diff --git a/api/services/tools/tools_transform_service.py b/api/services/tools/tools_transform_service.py index e535ddb575814c..1befa11531d3f0 100644 --- a/api/services/tools/tools_transform_service.py +++ b/api/services/tools/tools_transform_service.py @@ -183,7 +183,7 @@ def api_provider_to_user_provider( try: username = db_provider.user.name except Exception as e: - logger.exception(f"failed to get user name for api provider {db_provider.id}: {str(e)}") + logger.exception(f"failed to get user name for api provider {db_provider.id}") # add provider into providers credentials = db_provider.credentials result = UserToolProvider( diff --git a/api/tasks/annotation/delete_annotation_index_task.py b/api/tasks/annotation/delete_annotation_index_task.py index 5758db53de820b..f0f6b32b06c78c 100644 --- a/api/tasks/annotation/delete_annotation_index_task.py +++ b/api/tasks/annotation/delete_annotation_index_task.py @@ -38,4 +38,4 @@ def delete_annotation_index_task(annotation_id: str, app_id: str, tenant_id: str click.style("App annotations index deleted : {} latency: {}".format(app_id, end_at - start_at), fg="green") ) except Exception as e: - logging.exception("Annotation deleted index failed:{}".format(str(e))) + logging.exception("Annotation deleted index failed") diff --git a/api/tasks/annotation/disable_annotation_reply_task.py b/api/tasks/annotation/disable_annotation_reply_task.py index 0f83dfdbd4a72f..a2f49135139b08 100644 --- a/api/tasks/annotation/disable_annotation_reply_task.py +++ b/api/tasks/annotation/disable_annotation_reply_task.py @@ -60,7 +60,7 @@ def disable_annotation_reply_task(job_id: str, app_id: str, tenant_id: str): click.style("App annotations index deleted : {} latency: {}".format(app_id, end_at - start_at), fg="green") ) except Exception as e: - logging.exception("Annotation batch deleted index failed:{}".format(str(e))) + logging.exception("Annotation batch deleted index failed") redis_client.setex(disable_app_annotation_job_key, 600, "error") disable_app_annotation_error_key = "disable_app_annotation_error_{}".format(str(job_id)) redis_client.setex(disable_app_annotation_error_key, 600, str(e)) diff --git a/api/tasks/annotation/enable_annotation_reply_task.py b/api/tasks/annotation/enable_annotation_reply_task.py index 82b70f6b71eddf..e819bf36353fca 100644 --- a/api/tasks/annotation/enable_annotation_reply_task.py +++ b/api/tasks/annotation/enable_annotation_reply_task.py @@ -93,7 +93,7 @@ def enable_annotation_reply_task( click.style("App annotations added to index: {} latency: {}".format(app_id, end_at - start_at), fg="green") ) except Exception as e: - logging.exception("Annotation batch created index failed:{}".format(str(e))) + logging.exception("Annotation batch created index failed") redis_client.setex(enable_app_annotation_job_key, 600, "error") enable_app_annotation_error_key = "enable_app_annotation_error_{}".format(str(job_id)) redis_client.setex(enable_app_annotation_error_key, 600, str(e)) diff --git a/api/tasks/batch_create_segment_to_index_task.py b/api/tasks/batch_create_segment_to_index_task.py index d1b41f26751519..5ee72c27fc407c 100644 --- a/api/tasks/batch_create_segment_to_index_task.py +++ b/api/tasks/batch_create_segment_to_index_task.py @@ -103,5 +103,5 @@ def batch_create_segment_to_index_task( click.style("Segment batch created job: {} latency: {}".format(job_id, end_at - start_at), fg="green") ) except Exception as e: - logging.exception("Segments batch created index failed:{}".format(str(e))) + logging.exception("Segments batch created index failed") redis_client.setex(indexing_cache_key, 600, "error") diff --git a/api/tasks/clean_dataset_task.py b/api/tasks/clean_dataset_task.py index 36249038011747..4d45df4d2a87e8 100644 --- a/api/tasks/clean_dataset_task.py +++ b/api/tasks/clean_dataset_task.py @@ -5,6 +5,7 @@ from celery import shared_task from core.rag.index_processor.index_processor_factory import IndexProcessorFactory +from core.tools.utils.web_reader_tool import get_image_upload_file_ids from extensions.ext_database import db from extensions.ext_storage import storage from models.dataset import ( @@ -67,6 +68,16 @@ def clean_dataset_task( db.session.delete(document) for segment in segments: + image_upload_file_ids = get_image_upload_file_ids(segment.content) + for upload_file_id in image_upload_file_ids: + image_file = db.session.query(UploadFile).filter(UploadFile.id == upload_file_id).first() + try: + storage.delete(image_file.key) + except Exception: + logging.exception( + "Delete image_files failed when storage deleted, \ + image_upload_file_is: {}".format(upload_file_id) + ) db.session.delete(segment) db.session.query(DatasetProcessRule).filter(DatasetProcessRule.dataset_id == dataset_id).delete() diff --git a/api/tasks/clean_document_task.py b/api/tasks/clean_document_task.py index ae2855aa2ebc4d..54c89450c91419 100644 --- a/api/tasks/clean_document_task.py +++ b/api/tasks/clean_document_task.py @@ -6,6 +6,7 @@ from celery import shared_task from core.rag.index_processor.index_processor_factory import IndexProcessorFactory +from core.tools.utils.web_reader_tool import get_image_upload_file_ids from extensions.ext_database import db from extensions.ext_storage import storage from models.dataset import Dataset, DocumentSegment @@ -40,6 +41,16 @@ def clean_document_task(document_id: str, dataset_id: str, doc_form: str, file_i index_processor.clean(dataset, index_node_ids) for segment in segments: + image_upload_file_ids = get_image_upload_file_ids(segment.content) + for upload_file_id in image_upload_file_ids: + image_file = db.session.query(UploadFile).filter(UploadFile.id == upload_file_id).first() + try: + storage.delete(image_file.key) + except Exception: + logging.exception( + "Delete image_files failed when storage deleted, \ + image_upload_file_is: {}".format(upload_file_id) + ) db.session.delete(segment) db.session.commit() diff --git a/api/tasks/document_indexing_task.py b/api/tasks/document_indexing_task.py index 72c4674e0fccbb..df1177d57887e7 100644 --- a/api/tasks/document_indexing_task.py +++ b/api/tasks/document_indexing_task.py @@ -25,7 +25,9 @@ def document_indexing_task(dataset_id: str, document_ids: list): start_at = time.perf_counter() dataset = db.session.query(Dataset).filter(Dataset.id == dataset_id).first() - + if not dataset: + logging.info(click.style("Dataset is not found: {}".format(dataset_id), fg="yellow")) + return # check document limit features = FeatureService.get_features(dataset.tenant_id) try: diff --git a/api/tests/integration_tests/vdb/__mock/baiduvectordb.py b/api/tests/integration_tests/vdb/__mock/baiduvectordb.py index f20833ea5666de..0ea61369c0304e 100644 --- a/api/tests/integration_tests/vdb/__mock/baiduvectordb.py +++ b/api/tests/integration_tests/vdb/__mock/baiduvectordb.py @@ -1,4 +1,5 @@ import os +from collections import UserDict from unittest.mock import MagicMock import pytest @@ -11,7 +12,7 @@ from requests.adapters import HTTPAdapter -class AttrDict(dict): +class AttrDict(UserDict): def __getattr__(self, item): return self.get(item) diff --git a/api/tests/integration_tests/vdb/__mock/upstashvectordb.py b/api/tests/integration_tests/vdb/__mock/upstashvectordb.py index c93292bd8a2ee0..4b251ba836e40d 100644 --- a/api/tests/integration_tests/vdb/__mock/upstashvectordb.py +++ b/api/tests/integration_tests/vdb/__mock/upstashvectordb.py @@ -1,4 +1,5 @@ import os +from collections import UserDict from typing import Optional import pytest @@ -50,7 +51,7 @@ def info(self): return AttrDict({"dimension": 1024}) -class AttrDict(dict): +class AttrDict(UserDict): def __getattr__(self, item): return self.get(item) diff --git a/api/tests/unit_tests/core/app/segments/test_segment.py b/api/tests/unit_tests/core/app/segments/test_segment.py index 3b1715ab452a11..1b035d01a7ad55 100644 --- a/api/tests/unit_tests/core/app/segments/test_segment.py +++ b/api/tests/unit_tests/core/app/segments/test_segment.py @@ -1,5 +1,5 @@ from core.helper import encrypter -from core.variables import SecretVariable, StringSegment +from core.variables import SecretVariable, StringVariable from core.workflow.entities.variable_pool import VariablePool from core.workflow.enums import SystemVariableKey @@ -54,4 +54,5 @@ def test_convert_variable_to_segment_group(): segments_group = variable_pool.convert_template(template) assert segments_group.text == "fake-user-id" assert segments_group.log == "fake-user-id" - assert segments_group.value == [StringSegment(value="fake-user-id")] + assert isinstance(segments_group.value[0], StringVariable) + assert segments_group.value[0].value == "fake-user-id" diff --git a/api/tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py b/api/tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py index 4f1f8f05c8ea92..1a550ec5309aa3 100644 --- a/api/tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py +++ b/api/tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py @@ -140,6 +140,17 @@ def test_extract_text_from_plain_text(): assert text == "Hello, world!" +def test_extract_text_from_plain_text_non_utf8(): + import tempfile + + non_utf8_content = b"Hello, world\xa9." # \xA9 represents © in Latin-1 + with tempfile.NamedTemporaryFile(delete=True) as temp_file: + temp_file.write(non_utf8_content) + temp_file.seek(0) + text = _extract_text_from_plain_text(temp_file.read()) + assert text == "Hello, world." + + @patch("pypdfium2.PdfDocument") def test_extract_text_from_pdf(mock_pdf_document): mock_page = Mock() diff --git a/api/tests/unit_tests/core/workflow/nodes/test_list_operator.py b/api/tests/unit_tests/core/workflow/nodes/test_list_operator.py index 0f5c8bf51ba158..d20dfc5b311698 100644 --- a/api/tests/unit_tests/core/workflow/nodes/test_list_operator.py +++ b/api/tests/unit_tests/core/workflow/nodes/test_list_operator.py @@ -4,7 +4,14 @@ from core.file import File, FileTransferMethod, FileType from core.variables import ArrayFileSegment -from core.workflow.nodes.list_operator.entities import FilterBy, FilterCondition, Limit, ListOperatorNodeData, OrderBy +from core.workflow.nodes.list_operator.entities import ( + ExtractConfig, + FilterBy, + FilterCondition, + Limit, + ListOperatorNodeData, + OrderBy, +) from core.workflow.nodes.list_operator.exc import InvalidKeyError from core.workflow.nodes.list_operator.node import ListOperatorNode, _get_file_extract_string_func from models.workflow import WorkflowNodeExecutionStatus @@ -22,6 +29,7 @@ def list_operator_node(): ), "order_by": OrderBy(enabled=False, value="asc"), "limit": Limit(enabled=False, size=0), + "extract_by": ExtractConfig(enabled=False, serial="1"), "title": "Test Title", } node_data = ListOperatorNodeData(**config) diff --git a/api/tests/unit_tests/oss/__mock/volcengine_tos.py b/api/tests/unit_tests/oss/__mock/volcengine_tos.py index 1194a03258bb36..649d93a20261d3 100644 --- a/api/tests/unit_tests/oss/__mock/volcengine_tos.py +++ b/api/tests/unit_tests/oss/__mock/volcengine_tos.py @@ -1,4 +1,5 @@ import os +from collections import UserDict from unittest.mock import MagicMock import pytest @@ -14,7 +15,7 @@ ) -class AttrDict(dict): +class AttrDict(UserDict): def __getattr__(self, item): return self.get(item) diff --git a/docker-legacy/docker-compose.yaml b/docker-legacy/docker-compose.yaml index 90110f49a23abe..9c2a1fe980a2f9 100644 --- a/docker-legacy/docker-compose.yaml +++ b/docker-legacy/docker-compose.yaml @@ -2,7 +2,7 @@ version: '3' services: # API service api: - image: langgenius/dify-api:0.11.0 + image: langgenius/dify-api:0.11.1 restart: always environment: # Startup mode, 'api' starts the API server. @@ -227,7 +227,7 @@ services: # worker service # The Celery worker for processing the queue. worker: - image: langgenius/dify-api:0.11.0 + image: langgenius/dify-api:0.11.1 restart: always environment: CONSOLE_WEB_URL: '' @@ -397,7 +397,7 @@ services: # Frontend web application. web: - image: langgenius/dify-web:0.11.0 + image: langgenius/dify-web:0.11.1 restart: always environment: # The base URL of console application api server, refers to the Console base URL of WEB service if console domain is diff --git a/docker/.env.example b/docker/.env.example index 0b181d831aa648..1750c2b1bbadb7 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -689,6 +689,20 @@ TEMPLATE_TRANSFORM_MAX_LENGTH=80000 CODE_MAX_STRING_ARRAY_LENGTH=30 CODE_MAX_OBJECT_ARRAY_LENGTH=30 CODE_MAX_NUMBER_ARRAY_LENGTH=1000 +CODE_EXECUTION_CONNECT_TIMEOUT=10 +CODE_EXECUTION_READ_TIMEOUT=60 +CODE_EXECUTION_WRITE_TIMEOUT=10 + +# Workflow runtime configuration +WORKFLOW_MAX_EXECUTION_STEPS=500 +WORKFLOW_MAX_EXECUTION_TIME=1200 +WORKFLOW_CALL_MAX_DEPTH=5 +MAX_VARIABLE_SIZE=204800 +WORKFLOW_FILE_UPLOAD_LIMIT=10 + +# HTTP request node in workflow configuration +HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760 +HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576 # Workflow runtime configuration WORKFLOW_MAX_EXECUTION_STEPS=500 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 2835f793d6b2d7..9b7231b66e6079 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -244,6 +244,9 @@ x-shared-env: &shared-api-worker-env RESET_PASSWORD_TOKEN_EXPIRY_MINUTES: ${RESET_PASSWORD_TOKEN_EXPIRY_MINUTES:-5} CODE_EXECUTION_ENDPOINT: ${CODE_EXECUTION_ENDPOINT:-http://sandbox:8194} CODE_EXECUTION_API_KEY: ${SANDBOX_API_KEY:-dify-sandbox} + CODE_EXECUTION_CONNECT_TIMEOUT: ${CODE_EXECUTION_CONNECT_TIMEOUT:-10} + CODE_EXECUTION_READ_TIMEOUT: ${CODE_EXECUTION_READ_TIMEOUT:-60} + CODE_EXECUTION_WRITE_TIMEOUT: ${CODE_EXECUTION_WRITE_TIMEOUT:-10} CODE_MAX_NUMBER: ${CODE_MAX_NUMBER:-9223372036854775807} CODE_MIN_NUMBER: ${CODE_MIN_NUMBER:--9223372036854775808} CODE_MAX_DEPTH: ${CODE_MAX_DEPTH:-5} @@ -280,7 +283,7 @@ x-shared-env: &shared-api-worker-env services: # API service api: - image: langgenius/dify-api:0.11.0 + image: langgenius/dify-api:0.11.1 restart: always build: '../api' environment: @@ -301,7 +304,7 @@ services: # worker service # The Celery worker for processing the queue. worker: - image: langgenius/dify-api:0.11.0 + image: langgenius/dify-api:0.11.1 restart: always build: '../api' environment: @@ -321,7 +324,7 @@ services: # Frontend web application. web: - image: langgenius/dify-web:0.11.0 + image: langgenius/dify-web:0.11.1 restart: always build: '../web' environment: diff --git a/web/Dockerfile b/web/Dockerfile index 29f7675f4af7ee..6118adbca4c447 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,5 +1,5 @@ # base image -FROM node:20.11-alpine3.19 AS base +FROM node:20-alpine3.20 AS base LABEL maintainer="takatost@gmail.com" # if you located in China, you can use aliyun mirror to speed up diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx index b01bc1b8563f00..b5d3462dfacf47 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chartView.tsx @@ -7,7 +7,7 @@ import type { PeriodParams } from '@/app/components/app/overview/appChart' import { AvgResponseTime, AvgSessionInteractions, AvgUserInteractions, ConversationsChart, CostChart, EndUsersChart, MessagesChart, TokenPerSecond, UserSatisfactionRate, WorkflowCostChart, WorkflowDailyTerminalsChart, WorkflowMessagesChart } from '@/app/components/app/overview/appChart' import type { Item } from '@/app/components/base/select' import { SimpleSelect } from '@/app/components/base/select' -import { TIME_PERIOD_LIST } from '@/app/components/app/log/filter' +import { TIME_PERIOD_MAPPING } from '@/app/components/app/log/filter' import { useStore as useAppStore } from '@/app/components/app/store' dayjs.extend(quarterOfYear) @@ -28,7 +28,7 @@ export default function ChartView({ appId }: IChartViewProps) { const [period, setPeriod] = useState({ name: t('appLog.filter.period.last7days'), query: { start: today.subtract(7, 'day').startOf('day').format(queryDateFormat), end: today.endOf('day').format(queryDateFormat) } }) const onSelect = (item: Item) => { - if (item.value === 'all') { + if (item.value === '-1') { setPeriod({ name: item.name, query: undefined }) } else if (item.value === 0) { @@ -49,10 +49,15 @@ export default function ChartView({ appId }: IChartViewProps) {
{t('appOverview.analysis.title')} ({ value: item.value, name: t(`appLog.filter.period.${item.name}`) }))} + items={Object.entries(TIME_PERIOD_MAPPING).map(([k, v]) => ({ value: k, name: t(`appLog.filter.period.${v.name}`) }))} className='mt-0 !w-40' - onSelect={onSelect} - defaultValue={7} + onSelect={(item) => { + const id = item.value + const value = TIME_PERIOD_MAPPING[id]?.value || '-1' + const name = item.name || t('appLog.filter.period.allTime') + onSelect({ value, name }) + }} + defaultValue={'2'} />
{!isWorkflow && ( diff --git a/web/app/components/app/configuration/dataset-config/index.tsx b/web/app/components/app/configuration/dataset-config/index.tsx index 0d9d575c1eb022..78b49f81d00824 100644 --- a/web/app/components/app/configuration/dataset-config/index.tsx +++ b/web/app/components/app/configuration/dataset-config/index.tsx @@ -47,12 +47,16 @@ const DatasetConfig: FC = () => { const { currentModel: currentRerankModel, + currentProvider: currentRerankProvider, } = useModelListAndDefaultModelAndCurrentProviderAndModel(ModelTypeEnum.rerank) const onRemove = (id: string) => { const filteredDataSets = dataSet.filter(item => item.id !== id) setDataSet(filteredDataSets) - const retrievalConfig = getMultipleRetrievalConfig(datasetConfigs as any, filteredDataSets, dataSet, !!currentRerankModel) + const retrievalConfig = getMultipleRetrievalConfig(datasetConfigs as any, filteredDataSets, dataSet, { + provider: currentRerankProvider?.provider, + model: currentRerankModel?.model, + }) setDatasetConfigs({ ...(datasetConfigs as any), ...retrievalConfig, diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx index 5bd748382ed905..dcb2b1a3fd5e46 100644 --- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx +++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx @@ -172,7 +172,7 @@ const ConfigContent: FC = ({ return false return datasetConfigs.reranking_enable - }, [canManuallyToggleRerank, datasetConfigs.reranking_enable]) + }, [canManuallyToggleRerank, datasetConfigs.reranking_enable, isRerankDefaultModelValid]) const handleDisabledSwitchClick = useCallback(() => { if (!currentRerankModel && !showRerankModel) diff --git a/web/app/components/app/configuration/dataset-config/params-config/index.tsx b/web/app/components/app/configuration/dataset-config/params-config/index.tsx index 94920fbd39ce21..7f7a4799d12217 100644 --- a/web/app/components/app/configuration/dataset-config/params-config/index.tsx +++ b/web/app/components/app/configuration/dataset-config/params-config/index.tsx @@ -43,6 +43,7 @@ const ParamsConfig = ({ const { defaultModel: rerankDefaultModel, currentModel: isRerankDefaultModelValid, + currentProvider: rerankDefaultProvider, } = useModelListAndDefaultModelAndCurrentProviderAndModel(ModelTypeEnum.rerank) const isValid = () => { @@ -91,7 +92,10 @@ const ParamsConfig = ({ reranking_mode: restConfigs.reranking_mode, weights: restConfigs.weights, reranking_enable: restConfigs.reranking_enable, - }, selectedDatasets, selectedDatasets, !!isRerankDefaultModelValid) + }, selectedDatasets, selectedDatasets, { + provider: rerankDefaultProvider?.provider, + model: isRerankDefaultModelValid?.model, + }) setTempDataSetConfigs({ ...retrievalConfig, diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsx index 2bb11a870c2746..b5b7e98d4337e6 100644 --- a/web/app/components/app/configuration/index.tsx +++ b/web/app/components/app/configuration/index.tsx @@ -226,6 +226,7 @@ const Configuration: FC = () => { const [rerankSettingModalOpen, setRerankSettingModalOpen] = useState(false) const { currentModel: currentRerankModel, + currentProvider: currentRerankProvider, } = useModelListAndDefaultModelAndCurrentProviderAndModel(ModelTypeEnum.rerank) const handleSelect = (data: DataSet[]) => { if (isEqual(data.map(item => item.id), dataSets.map(item => item.id))) { @@ -279,7 +280,10 @@ const Configuration: FC = () => { reranking_mode: restConfigs.reranking_mode, weights: restConfigs.weights, reranking_enable: restConfigs.reranking_enable, - }, newDatasets, dataSets, !!currentRerankModel) + }, newDatasets, dataSets, { + provider: currentRerankProvider?.provider, + model: currentRerankModel?.model, + }) setDatasetConfigs({ ...retrievalConfig, @@ -620,7 +624,10 @@ const Configuration: FC = () => { syncToPublishedConfig(config) setPublishedConfig(config) - const retrievalConfig = getMultipleRetrievalConfig(modelConfig.dataset_configs, datasets, datasets, !!currentRerankModel) + const retrievalConfig = getMultipleRetrievalConfig(modelConfig.dataset_configs, datasets, datasets, { + provider: currentRerankProvider?.provider, + model: currentRerankModel?.model, + }) setDatasetConfigs({ retrieval_model: RETRIEVE_TYPE.multiWay, ...modelConfig.dataset_configs, diff --git a/web/app/components/app/log/filter.tsx b/web/app/components/app/log/filter.tsx index 75dc83a3187c55..630cde6e17d83e 100644 --- a/web/app/components/app/log/filter.tsx +++ b/web/app/components/app/log/filter.tsx @@ -15,17 +15,17 @@ dayjs.extend(quarterOfYear) const today = dayjs() -export const TIME_PERIOD_LIST = [ - { value: 0, name: 'today' }, - { value: 7, name: 'last7days' }, - { value: 28, name: 'last4weeks' }, - { value: today.diff(today.subtract(3, 'month'), 'day'), name: 'last3months' }, - { value: today.diff(today.subtract(12, 'month'), 'day'), name: 'last12months' }, - { value: today.diff(today.startOf('month'), 'day'), name: 'monthToDate' }, - { value: today.diff(today.startOf('quarter'), 'day'), name: 'quarterToDate' }, - { value: today.diff(today.startOf('year'), 'day'), name: 'yearToDate' }, - { value: 'all', name: 'allTime' }, -] +export const TIME_PERIOD_MAPPING: { [key: string]: { value: number; name: string } } = { + 1: { value: 0, name: 'today' }, + 2: { value: 7, name: 'last7days' }, + 3: { value: 28, name: 'last4weeks' }, + 4: { value: today.diff(today.subtract(3, 'month'), 'day'), name: 'last3months' }, + 5: { value: today.diff(today.subtract(12, 'month'), 'day'), name: 'last12months' }, + 6: { value: today.diff(today.startOf('month'), 'day'), name: 'monthToDate' }, + 7: { value: today.diff(today.startOf('quarter'), 'day'), name: 'quarterToDate' }, + 8: { value: today.diff(today.startOf('year'), 'day'), name: 'yearToDate' }, + 9: { value: -1, name: 'allTime' }, +} type IFilterProps = { isChatMode?: boolean @@ -45,12 +45,12 @@ const Filter: FC = ({ isChatMode, appId, queryParams, setQueryPara className='min-w-[150px]' panelClassName='w-[270px]' leftIcon={} - value={queryParams.period || 7} + value={queryParams.period} onSelect={(item) => { setQueryParams({ ...queryParams, period: item.value as string }) }} - onClear={() => setQueryParams({ ...queryParams, period: 7 })} - items={TIME_PERIOD_LIST.map(item => ({ value: item.value, name: t(`appLog.filter.period.${item.name}`) }))} + onClear={() => setQueryParams({ ...queryParams, period: '9' })} + items={Object.entries(TIME_PERIOD_MAPPING).map(([k, v]) => ({ value: k, name: t(`appLog.filter.period.${v.name}`) }))} /> = ({ appUrl }) => { const Logs: FC = ({ appDetail }) => { const { t } = useTranslation() const [queryParams, setQueryParams] = useState({ - period: 7, + period: '2', annotation_status: 'all', sort_by: '-created_at', }) @@ -68,9 +68,9 @@ const Logs: FC = ({ appDetail }) => { const query = { page: currPage + 1, limit: APP_PAGE_LIMIT, - ...(debouncedQueryParams.period !== 'all' + ...((debouncedQueryParams.period !== '9') ? { - start: dayjs().subtract(debouncedQueryParams.period as number, 'day').startOf('day').format('YYYY-MM-DD HH:mm'), + start: dayjs().subtract(TIME_PERIOD_MAPPING[debouncedQueryParams.period].value, 'day').startOf('day').format('YYYY-MM-DD HH:mm'), end: dayjs().endOf('day').format('YYYY-MM-DD HH:mm'), } : {}), diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index a8ab456f43cb11..e7cc4148efb099 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -261,6 +261,10 @@ const SettingsModal: FC = ({ onChange={onChange('chatColorTheme')} placeholder='E.g #A020F0' /> +
+

{t(`${prefixSettings}.chatColorThemeInverted`)}

+ setInputInfo({ ...inputInfo, chatColorThemeInverted: v })}> +
} {systemFeatures.enable_web_sso_switch_component &&

{t(`${prefixSettings}.sso.label`)}

diff --git a/web/app/components/base/chat/chat-with-history/hooks.tsx b/web/app/components/base/chat/chat-with-history/hooks.tsx index d4fa170e4c60d0..a67cc3cd885387 100644 --- a/web/app/components/base/chat/chat-with-history/hooks.tsx +++ b/web/app/components/base/chat/chat-with-history/hooks.tsx @@ -173,7 +173,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => { const conversationInputs: Record = {} inputsForms.forEach((item: any) => { - conversationInputs[item.variable] = item.default || '' + conversationInputs[item.variable] = item.default || null }) handleNewConversationInputsChange(conversationInputs) }, [handleNewConversationInputsChange, inputsForms]) diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsx index 631d3b56bc0232..0a8bc0993f997c 100644 --- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx +++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx @@ -159,7 +159,7 @@ export const useEmbeddedChatbot = () => { const conversationInputs: Record = {} inputsForms.forEach((item: any) => { - conversationInputs[item.variable] = item.default || '' + conversationInputs[item.variable] = item.default || null }) handleNewConversationInputsChange(conversationInputs) }, [handleNewConversationInputsChange, inputsForms]) diff --git a/web/app/components/base/markdown-blocks/form.tsx b/web/app/components/base/markdown-blocks/form.tsx index f87f2dcd911850..975d8b04ddfd3a 100644 --- a/web/app/components/base/markdown-blocks/form.tsx +++ b/web/app/components/base/markdown-blocks/form.tsx @@ -1,3 +1,4 @@ +import React, { useEffect, useState } from 'react' import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' import Textarea from '@/app/components/base/textarea' @@ -32,16 +33,26 @@ const MarkdownForm = ({ node }: any) => { // const { onSend } = useChatContext() + const [formValues, setFormValues] = useState<{ [key: string]: any }>({}) + + useEffect(() => { + const initialValues: { [key: string]: any } = {} + node.children.forEach((child: any) => { + if ([SUPPORTED_TAGS.INPUT, SUPPORTED_TAGS.TEXTAREA].includes(child.tagName)) + initialValues[child.properties.name] = child.properties.value + }) + setFormValues(initialValues) + }, [node.children]) + const getFormValues = (children: any) => { - const formValues: { [key: string]: any } = {} + const values: { [key: string]: any } = {} children.forEach((child: any) => { - if (child.tagName === SUPPORTED_TAGS.INPUT) - formValues[child.properties.name] = child.properties.value - if (child.tagName === SUPPORTED_TAGS.TEXTAREA) - formValues[child.properties.name] = child.properties.value + if ([SUPPORTED_TAGS.INPUT, SUPPORTED_TAGS.TEXTAREA].includes(child.tagName)) + values[child.properties.name] = formValues[child.properties.name] }) - return formValues + return values } + const onSubmit = (e: any) => { e.preventDefault() const format = node.properties.dataFormat || DATA_FORMAT.TEXT @@ -77,25 +88,22 @@ const MarkdownForm = ({ node }: any) => { ) } - if (child.tagName === SUPPORTED_TAGS.INPUT) { - if (Object.values(SUPPORTED_TYPES).includes(child.properties.type)) { - return ( - { - e.preventDefault() - child.properties.value = e.target.value - }} - /> - ) - } - else { - return

Unsupported input type: {child.properties.type}

- } + if (child.tagName === SUPPORTED_TAGS.INPUT && Object.values(SUPPORTED_TYPES).includes(child.properties.type)) { + return ( + { + setFormValues(prevValues => ({ + ...prevValues, + [child.properties.name]: e.target.value, + })) + }} + /> + ) } if (child.tagName === SUPPORTED_TAGS.TEXTAREA) { return ( @@ -103,10 +111,12 @@ const MarkdownForm = ({ node }: any) => { key={index} name={child.properties.name} placeholder={child.properties.placeholder} - value={child.properties.value} + value={formValues[child.properties.name]} onChange={(e) => { - e.preventDefault() - child.properties.value = e.target.value + setFormValues(prevValues => ({ + ...prevValues, + [child.properties.name]: e.target.value, + })) }} /> ) diff --git a/web/app/components/base/prompt-editor/constants.tsx b/web/app/components/base/prompt-editor/constants.tsx index 00360c7bc1d488..78568aba7bcf69 100644 --- a/web/app/components/base/prompt-editor/constants.tsx +++ b/web/app/components/base/prompt-editor/constants.tsx @@ -53,6 +53,6 @@ export const getInputVars = (text: string): ValueSelector[] => { export const FILE_EXTS: Record = { [SupportUploadFileTypes.image]: ['JPG', 'JPEG', 'PNG', 'GIF', 'WEBP', 'SVG'], [SupportUploadFileTypes.document]: ['TXT', 'MD', 'MARKDOWN', 'PDF', 'HTML', 'XLSX', 'XLS', 'DOCX', 'CSV', 'EML', 'MSG', 'PPTX', 'PPT', 'XML', 'EPUB'], - [SupportUploadFileTypes.audio]: ['MP3', 'M4A', 'WAV', 'WEBM', 'AMR'], + [SupportUploadFileTypes.audio]: ['MP3', 'M4A', 'WAV', 'WEBM', 'AMR', 'MPGA'], [SupportUploadFileTypes.video]: ['MP4', 'MOV', 'MPEG', 'MPGA'], } diff --git a/web/app/components/develop/template/template_advanced_chat.en.mdx b/web/app/components/develop/template/template_advanced_chat.en.mdx index 6642c5cedcd546..c3c3f7c6f39a96 100644 --- a/web/app/components/develop/template/template_advanced_chat.en.mdx +++ b/web/app/components/develop/template/template_advanced_chat.en.mdx @@ -774,6 +774,10 @@ Chat applications support session persistence, allowing previous chat history to ### Request Body + Rename the session, the session name is used for display on clients that support multiple sessions. + + ### Path + - `conversation_id` (string) Conversation ID @@ -796,10 +800,10 @@ Chat applications support session persistence, allowing previous chat history to - + ```bash {{ title: 'cURL' }} - curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \ + curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {api_key}' \ --data-raw '{ diff --git a/web/app/components/develop/template/template_advanced_chat.zh.mdx b/web/app/components/develop/template/template_advanced_chat.zh.mdx index 8e64d63ac528c1..f3ddd6933c9a70 100755 --- a/web/app/components/develop/template/template_advanced_chat.zh.mdx +++ b/web/app/components/develop/template/template_advanced_chat.zh.mdx @@ -810,6 +810,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' 对会话进行重命名,会话名称用于显示在支持多会话的客户端上。 + ### Path + - `conversation_id` (string) 会话 ID + ### Request Body @@ -833,10 +836,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - + ```bash {{ title: 'cURL' }} - curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \ + curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ --header 'Authorization: Bearer {api_key}' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/web/app/components/develop/template/template_chat.en.mdx b/web/app/components/develop/template/template_chat.en.mdx index a94016ca3a3121..f44f991b890054 100644 --- a/web/app/components/develop/template/template_chat.en.mdx +++ b/web/app/components/develop/template/template_chat.en.mdx @@ -808,6 +808,10 @@ Chat applications support session persistence, allowing previous chat history to ### Request Body + Rename the session, the session name is used for display on clients that support multiple sessions. + + ### Path + - `conversation_id` (string) Conversation ID @@ -830,10 +834,10 @@ Chat applications support session persistence, allowing previous chat history to - + ```bash {{ title: 'cURL' }} - curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \ + curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {api_key}' \ --data-raw '{ diff --git a/web/app/components/develop/template/template_chat.zh.mdx b/web/app/components/develop/template/template_chat.zh.mdx index 92b13b2c7dc788..c786d56980226b 100644 --- a/web/app/components/develop/template/template_chat.zh.mdx +++ b/web/app/components/develop/template/template_chat.zh.mdx @@ -824,6 +824,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' 对会话进行重命名,会话名称用于显示在支持多会话的客户端上。 + ### Path + - `conversation_id` (string) 会话 ID + ### Request Body @@ -847,10 +850,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx' - + ```bash {{ title: 'cURL' }} - curl -X POST '${props.appDetail.api_base_url}/conversations/:conversation_id/name' \ + curl -X POST '${props.appDetail.api_base_url}/conversations/{conversation_id}/name' \ --header 'Authorization: Bearer {api_key}' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index 2b020b81e73419..3757d552df9a7a 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -12,6 +12,7 @@ import EnvNav from './env-nav' import ExploreNav from './explore-nav' import ToolsNav from './tools-nav' import GithubStar from './github-star' +import LicenseNav from './license-env' import { WorkspaceProvider } from '@/context/workspace-context' import { useAppContext } from '@/context/app-context' import LogoSite from '@/app/components/base/logo/logo-site' @@ -79,6 +80,7 @@ const Header = () => {
)}
+ {enableBilling && (
diff --git a/web/app/components/header/license-env/index.tsx b/web/app/components/header/license-env/index.tsx new file mode 100644 index 00000000000000..800d86d2b801d8 --- /dev/null +++ b/web/app/components/header/license-env/index.tsx @@ -0,0 +1,29 @@ +'use client' + +import AppContext from '@/context/app-context' +import { LicenseStatus } from '@/types/feature' +import { useTranslation } from 'react-i18next' +import { useContextSelector } from 'use-context-selector' +import dayjs from 'dayjs' + +const LicenseNav = () => { + const { t } = useTranslation() + const systemFeatures = useContextSelector(AppContext, s => s.systemFeatures) + + if (systemFeatures.license?.status === LicenseStatus.EXPIRING) { + const expiredAt = systemFeatures.license?.expired_at + const count = dayjs(expiredAt).diff(dayjs(), 'days') + return
+ {count <= 1 && {t('common.license.expiring', { count })}} + {count > 1 && {t('common.license.expiring_plural', { count })}} +
+ } + if (systemFeatures.license.status === LicenseStatus.ACTIVE) { + return
+ Enterprise +
+ } + return null +} + +export default LicenseNav diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx index 0860560e7c0fa5..b853100b69dab3 100644 --- a/web/app/components/share/text-generation/index.tsx +++ b/web/app/components/share/text-generation/index.tsx @@ -94,6 +94,7 @@ const TextGeneration: FC = ({ const [isCallBatchAPI, setIsCallBatchAPI] = useState(false) const isInBatchTab = currentTab === 'batch' const [inputs, setInputs] = useState>({}) + const inputsRef = useRef(inputs) const [appId, setAppId] = useState('') const [siteInfo, setSiteInfo] = useState(null) const [canReplaceLogo, setCanReplaceLogo] = useState(false) @@ -604,6 +605,7 @@ const TextGeneration: FC = ({ + inputsRef: React.MutableRefObject> onInputsChange: (inputs: Record) => void onSend: () => void visionConfig: VisionSettings @@ -27,6 +28,7 @@ export type IRunOnceProps = { const RunOnce: FC = ({ promptConfig, inputs, + inputsRef, onInputsChange, onSend, visionConfig, @@ -47,6 +49,11 @@ const RunOnce: FC = ({ onSend() } + const handleInputsChange = useCallback((newInputs: Record) => { + onInputsChange(newInputs) + inputsRef.current = newInputs + }, [onInputsChange, inputsRef]) + return (
@@ -60,7 +67,7 @@ const RunOnce: FC = ({ +
+ ) +} +export default React.memo(ExtractInput) diff --git a/web/app/components/workflow/nodes/list-operator/default.ts b/web/app/components/workflow/nodes/list-operator/default.ts index a7d411420c4018..fe8773a914c451 100644 --- a/web/app/components/workflow/nodes/list-operator/default.ts +++ b/web/app/components/workflow/nodes/list-operator/default.ts @@ -12,6 +12,10 @@ const nodeDefault: NodeDefault = { enabled: false, conditions: [], }, + extract_by: { + enabled: false, + serial: '1', + }, order_by: { enabled: false, key: '', diff --git a/web/app/components/workflow/nodes/list-operator/panel.tsx b/web/app/components/workflow/nodes/list-operator/panel.tsx index a6b53196d9c6d3..f6e9213bbf13e6 100644 --- a/web/app/components/workflow/nodes/list-operator/panel.tsx +++ b/web/app/components/workflow/nodes/list-operator/panel.tsx @@ -13,6 +13,7 @@ import FilterCondition from './components/filter-condition' import Field from '@/app/components/workflow/nodes/_base/components/field' import { type NodePanelProps } from '@/app/components/workflow/types' import Switch from '@/app/components/base/switch' +import ExtractInput from '@/app/components/workflow/nodes/list-operator/components/extract-input' const i18nPrefix = 'workflow.nodes.listFilter' @@ -32,6 +33,8 @@ const Panel: FC> = ({ filterVar, handleFilterEnabledChange, handleFilterChange, + handleExtractsEnabledChange, + handleExtractsChange, handleLimitChange, handleOrderByEnabledChange, handleOrderByKeyChange, @@ -79,6 +82,41 @@ const Panel: FC> = ({ : null} + + } + > + {inputs.extract_by?.enabled + ? ( +
+ {hasSubVariable && ( +
+ +
+ )} +
+ ) + : null} +
+ + + > = ({ : null} -
-
<> diff --git a/web/app/components/workflow/nodes/list-operator/types.ts b/web/app/components/workflow/nodes/list-operator/types.ts index dcd71b69568bbe..770590329a8227 100644 --- a/web/app/components/workflow/nodes/list-operator/types.ts +++ b/web/app/components/workflow/nodes/list-operator/types.ts @@ -25,6 +25,10 @@ export type ListFilterNodeType = CommonNodeType & { enabled: boolean conditions: Condition[] } + extract_by: { + enabled: boolean + serial?: string + } order_by: { enabled: boolean key: ValueSelector | string diff --git a/web/app/components/workflow/nodes/list-operator/use-config.ts b/web/app/components/workflow/nodes/list-operator/use-config.ts index 694ce9d49ae6b9..00defe7a844ab4 100644 --- a/web/app/components/workflow/nodes/list-operator/use-config.ts +++ b/web/app/components/workflow/nodes/list-operator/use-config.ts @@ -119,6 +119,22 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { setInputs(newInputs) }, [inputs, setInputs]) + const handleExtractsEnabledChange = useCallback((enabled: boolean) => { + const newInputs = produce(inputs, (draft) => { + draft.extract_by.enabled = enabled + if (enabled) + draft.extract_by.serial = '1' + }) + setInputs(newInputs) + }, [inputs, setInputs]) + + const handleExtractsChange = useCallback((value: string) => { + const newInputs = produce(inputs, (draft) => { + draft.extract_by.serial = value + }) + setInputs(newInputs) + }, [inputs, setInputs]) + const handleOrderByEnabledChange = useCallback((enabled: boolean) => { const newInputs = produce(inputs, (draft) => { draft.order_by.enabled = enabled @@ -162,6 +178,8 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { handleOrderByEnabledChange, handleOrderByKeyChange, handleOrderByTypeChange, + handleExtractsEnabledChange, + handleExtractsChange, } } diff --git a/web/app/components/workflow/panel/workflow-preview.tsx b/web/app/components/workflow/panel/workflow-preview.tsx index 361f9d6bf44fa1..d560c0b2cb6c10 100644 --- a/web/app/components/workflow/panel/workflow-preview.tsx +++ b/web/app/components/workflow/panel/workflow-preview.tsx @@ -28,7 +28,7 @@ import IterationResultPanel from '../run/iteration-result-panel' import InputsPanel from './inputs-panel' import cn from '@/utils/classnames' import Loading from '@/app/components/base/loading' -import type { NodeTracing } from '@/types/workflow' +import type { IterationDurationMap, NodeTracing } from '@/types/workflow' const WorkflowPreview = () => { const { t } = useTranslation() @@ -53,12 +53,14 @@ const WorkflowPreview = () => { }, [workflowRunningData]) const [iterationRunResult, setIterationRunResult] = useState([]) + const [iterDurationMap, setIterDurationMap] = useState({}) const [isShowIterationDetail, { setTrue: doShowIterationDetail, setFalse: doHideIterationDetail, }] = useBoolean(false) - const handleShowIterationDetail = useCallback((detail: NodeTracing[][]) => { + const handleShowIterationDetail = useCallback((detail: NodeTracing[][], iterationDurationMap: IterationDurationMap) => { + setIterDurationMap(iterationDurationMap) setIterationRunResult(detail) doShowIterationDetail() }, [doShowIterationDetail]) @@ -72,6 +74,7 @@ const WorkflowPreview = () => { list={iterationRunResult} onHide={doHideIterationDetail} onBack={doHideIterationDetail} + iterDurationMap={iterDurationMap} />
) @@ -94,6 +97,7 @@ const WorkflowPreview = () => { list={iterationRunResult} onHide={doHideIterationDetail} onBack={doHideIterationDetail} + iterDurationMap={iterDurationMap} /> ) : ( diff --git a/web/app/components/workflow/run/index.tsx b/web/app/components/workflow/run/index.tsx index 89db43fa35e857..5267cf257db640 100644 --- a/web/app/components/workflow/run/index.tsx +++ b/web/app/components/workflow/run/index.tsx @@ -13,7 +13,7 @@ import cn from '@/utils/classnames' import { ToastContext } from '@/app/components/base/toast' import Loading from '@/app/components/base/loading' import { fetchRunDetail, fetchTracingList } from '@/service/log' -import type { NodeTracing } from '@/types/workflow' +import type { IterationDurationMap, NodeTracing } from '@/types/workflow' import type { WorkflowRunDetailResponse } from '@/models/log' import { useStore as useAppStore } from '@/app/components/app/store' @@ -172,15 +172,17 @@ const RunPanel: FC = ({ hideResult, activeTab = 'RESULT', runID, getRe }, [loading]) const [iterationRunResult, setIterationRunResult] = useState([]) + const [iterDurationMap, setIterDurationMap] = useState({}) const [isShowIterationDetail, { setTrue: doShowIterationDetail, setFalse: doHideIterationDetail, }] = useBoolean(false) - const handleShowIterationDetail = useCallback((detail: NodeTracing[][]) => { + const handleShowIterationDetail = useCallback((detail: NodeTracing[][], iterDurationMap: IterationDurationMap) => { setIterationRunResult(detail) doShowIterationDetail() - }, [doShowIterationDetail]) + setIterDurationMap(iterDurationMap) + }, [doShowIterationDetail, setIterationRunResult, setIterDurationMap]) if (isShowIterationDetail) { return ( @@ -189,6 +191,7 @@ const RunPanel: FC = ({ hideResult, activeTab = 'RESULT', runID, getRe list={iterationRunResult} onHide={doHideIterationDetail} onBack={doHideIterationDetail} + iterDurationMap={iterDurationMap} />
) diff --git a/web/app/components/workflow/run/iteration-result-panel.tsx b/web/app/components/workflow/run/iteration-result-panel.tsx index c4cd909f2ed9ae..b13eadec99bcb2 100644 --- a/web/app/components/workflow/run/iteration-result-panel.tsx +++ b/web/app/components/workflow/run/iteration-result-panel.tsx @@ -6,12 +6,14 @@ import { RiArrowRightSLine, RiCloseLine, RiErrorWarningLine, + RiLoader2Line, } from '@remixicon/react' import { ArrowNarrowLeft } from '../../base/icons/src/vender/line/arrows' +import { NodeRunningStatus } from '../types' import TracingPanel from './tracing-panel' import { Iteration } from '@/app/components/base/icons/src/vender/workflow' import cn from '@/utils/classnames' -import type { NodeTracing } from '@/types/workflow' +import type { IterationDurationMap, NodeTracing } from '@/types/workflow' const i18nPrefix = 'workflow.singleRun' type Props = { @@ -19,6 +21,7 @@ type Props = { onHide: () => void onBack: () => void noWrap?: boolean + iterDurationMap?: IterationDurationMap } const IterationResultPanel: FC = ({ @@ -26,6 +29,7 @@ const IterationResultPanel: FC = ({ onHide, onBack, noWrap, + iterDurationMap, }) => { const { t } = useTranslation() const [expandedIterations, setExpandedIterations] = useState>({}) @@ -36,6 +40,40 @@ const IterationResultPanel: FC = ({ [index]: !prev[index], })) }, []) + const countIterDuration = (iteration: NodeTracing[], iterDurationMap: IterationDurationMap): string => { + const IterRunIndex = iteration[0].execution_metadata.iteration_index as number + const iterRunId = iteration[0].execution_metadata.parallel_mode_run_id + const iterItem = iterDurationMap[iterRunId || IterRunIndex] + const duration = iterItem + return `${(duration && duration > 0.01) ? duration.toFixed(2) : 0.01}s` + } + const iterationStatusShow = (index: number, iteration: NodeTracing[], iterDurationMap?: IterationDurationMap) => { + const hasFailed = iteration.some(item => item.status === NodeRunningStatus.Failed) + const isRunning = iteration.some(item => item.status === NodeRunningStatus.Running) + const hasDurationMap = iterDurationMap && Object.keys(iterDurationMap).length !== 0 + + if (hasFailed) + return + + if (isRunning) + return + + return ( + <> + {hasDurationMap && ( +
+ {countIterDuration(iteration, iterDurationMap)} +
+ )} + + + ) + } const main = ( <> @@ -72,19 +110,7 @@ const IterationResultPanel: FC = ({ {t(`${i18nPrefix}.iteration`)} {index + 1} - { - iteration.some(item => item.status === 'failed') - ? ( - - ) - : (< RiArrowRightSLine className={ - cn( - 'w-4 h-4 text-text-tertiary transition-transform duration-200 flex-shrink-0', - expandedIterations[index] && 'transform rotate-90', - )} /> - ) - } - + {iterationStatusShow(index, iteration, iterDurationMap)} {expandedIterations[index] &&
void + onShowIterationDetail?: (detail: NodeTracing[][], iterDurationMap: IterationDurationMap) => void notShowIterationNav?: boolean justShowIterationNavArrow?: boolean } @@ -90,7 +90,7 @@ const NodePanel: FC = ({ const handleOnShowIterationDetail = (e: React.MouseEvent) => { e.stopPropagation() e.nativeEvent.stopImmediatePropagation() - onShowIterationDetail?.(nodeInfo.details || []) + onShowIterationDetail?.(nodeInfo.details || [], nodeInfo?.iterDurationMap || nodeInfo.execution_metadata?.iteration_duration_map || {}) } return (
diff --git a/web/app/components/workflow/run/tracing-panel.tsx b/web/app/components/workflow/run/tracing-panel.tsx index 613c10198de884..57b3a5cf5f145d 100644 --- a/web/app/components/workflow/run/tracing-panel.tsx +++ b/web/app/components/workflow/run/tracing-panel.tsx @@ -16,11 +16,11 @@ import NodePanel from './node' import { BlockEnum, } from '@/app/components/workflow/types' -import type { NodeTracing } from '@/types/workflow' +import type { IterationDurationMap, NodeTracing } from '@/types/workflow' type TracingPanelProps = { list: NodeTracing[] - onShowIterationDetail?: (detail: NodeTracing[][]) => void + onShowIterationDetail?: (detail: NodeTracing[][], iterDurationMap: IterationDurationMap) => void className?: string hideNodeInfo?: boolean hideNodeProcessDetail?: boolean diff --git a/web/app/signin/normalForm.tsx b/web/app/signin/normalForm.tsx index f4f46c68ba6543..783d8ac507886c 100644 --- a/web/app/signin/normalForm.tsx +++ b/web/app/signin/normalForm.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import Link from 'next/link' import { useRouter, useSearchParams } from 'next/navigation' -import { RiDoorLockLine } from '@remixicon/react' +import { RiContractLine, RiDoorLockLine, RiErrorWarningFill } from '@remixicon/react' import Loading from '../components/base/loading' import MailAndCodeAuth from './components/mail-and-code-auth' import MailAndPasswordAuth from './components/mail-and-password-auth' @@ -10,7 +10,7 @@ import SocialAuth from './components/social-auth' import SSOAuth from './components/sso-auth' import cn from '@/utils/classnames' import { getSystemFeatures, invitationCheck } from '@/service/common' -import { defaultSystemFeatures } from '@/types/feature' +import { LicenseStatus, defaultSystemFeatures } from '@/types/feature' import Toast from '@/app/components/base/toast' import { IS_CE_EDITION } from '@/config' @@ -83,6 +83,48 @@ const NormalForm = () => {
} + if (systemFeatures.license?.status === LicenseStatus.LOST) { + return
+
+
+
+ + +
+

{t('login.licenseLost')}

+

{t('login.licenseLostTip')}

+
+
+
+ } + if (systemFeatures.license?.status === LicenseStatus.EXPIRED) { + return
+
+
+
+ + +
+

{t('login.licenseExpired')}

+

{t('login.licenseExpiredTip')}

+
+
+
+ } + if (systemFeatures.license?.status === LicenseStatus.INACTIVE) { + return
+
+
+
+ + +
+

{t('login.licenseInactive')}

+

{t('login.licenseInactiveTip')}

+
+
+
+ } return ( <> diff --git a/web/context/app-context.tsx b/web/context/app-context.tsx index 78ac1c98481dac..369fe5af19b3b7 100644 --- a/web/context/app-context.tsx +++ b/web/context/app-context.tsx @@ -144,7 +144,7 @@ export const AppContextProvider: FC = ({ children }) => theme, setTheme: handleSetTheme, apps: appList.data, - systemFeatures, + systemFeatures: { ...defaultSystemFeatures, ...systemFeatures }, mutateApps, userProfile, mutateUserProfile, diff --git a/web/i18n/README.md b/web/i18n/README.md index 6e79be6b9b875b..9384ffc519ea72 100644 --- a/web/i18n/README.md +++ b/web/i18n/README.md @@ -72,7 +72,7 @@ export type I18nText = { } ``` -4. Add the new language to the `language.ts` file. +4. Add the new language to the `language.json` file. ```typescript diff --git a/web/i18n/de-DE/common.ts b/web/i18n/de-DE/common.ts index 0b6d6fa0b200f8..085371aeb17fcb 100644 --- a/web/i18n/de-DE/common.ts +++ b/web/i18n/de-DE/common.ts @@ -591,6 +591,10 @@ const translation = { uploadFromComputerReadError: 'Lesen der Datei fehlgeschlagen, bitte versuchen Sie es erneut.', fileExtensionNotSupport: 'Dateiendung nicht bedient', }, + license: { + expiring: 'Läuft an einem Tag ab', + expiring_plural: 'Läuft in {{count}} Tagen ab', + }, } export default translation diff --git a/web/i18n/de-DE/login.ts b/web/i18n/de-DE/login.ts index 6736e349148834..2e0d51cf857c33 100644 --- a/web/i18n/de-DE/login.ts +++ b/web/i18n/de-DE/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethodTip: 'Wenden Sie sich an den Systemadministrator, um eine Authentifizierungsmethode hinzuzufügen.', usePassword: 'Passwort verwenden', noLoginMethod: 'Authentifizierungsmethode nicht konfiguriert', + licenseExpired: 'Lizenz abgelaufen', + licenseLostTip: 'Fehler beim Verbinden des Dify-Lizenzservers. Wenden Sie sich an Ihren Administrator, um Dify weiterhin zu verwenden.', + licenseInactive: 'Lizenz inaktiv', + licenseInactiveTip: 'Die Dify Enterprise-Lizenz für Ihren Arbeitsbereich ist inaktiv. Wenden Sie sich an Ihren Administrator, um Dify weiterhin zu verwenden.', + licenseExpiredTip: 'Die Dify Enterprise-Lizenz für Ihren Arbeitsbereich ist abgelaufen. Wenden Sie sich an Ihren Administrator, um Dify weiterhin zu verwenden.', + licenseLost: 'Lizenz verloren', } export default translation diff --git a/web/i18n/de-DE/workflow.ts b/web/i18n/de-DE/workflow.ts index d05070c3089fa9..9ee52894295e28 100644 --- a/web/i18n/de-DE/workflow.ts +++ b/web/i18n/de-DE/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Art', binaryFileVariable: 'Variable der Binärdatei', + extractListPlaceholder: 'Geben Sie den Index des Listeneintrags ein, geben Sie \'/\' ein, fügen Sie die Variable ein', }, code: { inputVars: 'Eingabevariablen', @@ -618,6 +619,7 @@ const translation = { filterConditionKey: 'Bedingungsschlüssel filtern', filterCondition: 'Filter-Bedingung', selectVariableKeyPlaceholder: 'Untervariablenschlüssel auswählen', + extractsCondition: 'Extrahieren des N-Elements', }, }, tracing: { diff --git a/web/i18n/en-US/common.ts b/web/i18n/en-US/common.ts index 3390280e8a7242..f9d815be2c4e78 100644 --- a/web/i18n/en-US/common.ts +++ b/web/i18n/en-US/common.ts @@ -591,6 +591,10 @@ const translation = { created: 'Tag created successfully', failed: 'Tag creation failed', }, + license: { + expiring: 'Expiring in one day', + expiring_plural: 'Expiring in {{count}} days', + }, } export default translation diff --git a/web/i18n/en-US/login.ts b/web/i18n/en-US/login.ts index b47d7bd69a8dd7..5ff7b80b4e105c 100644 --- a/web/i18n/en-US/login.ts +++ b/web/i18n/en-US/login.ts @@ -98,6 +98,12 @@ const translation = { back: 'Back', noLoginMethod: 'Authentication method not configured', noLoginMethodTip: 'Please contact the system admin to add an authentication method.', + licenseExpired: 'License Expired', + licenseExpiredTip: 'The Dify Enterprise license for your workspace has expired. Please contact your administrator to continue using Dify.', + licenseLost: 'License Lost', + licenseLostTip: 'Failed to connect Dify license server. Please contact your administrator to continue using Dify.', + licenseInactive: 'License Inactive', + licenseInactiveTip: 'The Dify Enterprise license for your workspace is inactive. Please contact your administrator to continue using Dify.', } export default translation diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 3c6ccd0a6707e8..b3fece702a3b2b 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -369,6 +369,7 @@ const translation = { inputVars: 'Input Variables', api: 'API', apiPlaceholder: 'Enter URL, type ‘/’ insert variable', + extractListPlaceholder: 'Enter list item index, type ‘/’ insert variable', notStartWithHttp: 'API should start with http:// or https://', key: 'Key', type: 'Type', @@ -568,9 +569,9 @@ const translation = { MaxParallelismDesc: 'The maximum parallelism is used to control the number of tasks executed simultaneously in a single iteration.', errorResponseMethod: 'Error response method', ErrorMethod: { - operationTerminated: 'terminated', - continueOnError: 'continue on error', - removeAbnormalOutput: 'remove abnormal output', + operationTerminated: 'Terminated', + continueOnError: 'Continue on Error', + removeAbnormalOutput: 'Remove Abnormal Output', }, answerNodeWarningDesc: 'Parallel mode warning: Answer nodes, conversation variable assignments, and persistent read/write operations within iterations may cause exceptions.', }, @@ -605,6 +606,7 @@ const translation = { inputVar: 'Input Variable', filterCondition: 'Filter Condition', filterConditionKey: 'Filter Condition Key', + extractsCondition: 'Extract the N item', filterConditionComparisonOperator: 'Filter Condition Comparison Operator', filterConditionComparisonValue: 'Filter Condition value', selectVariableKeyPlaceholder: 'Select sub variable key', diff --git a/web/i18n/es-ES/common.ts b/web/i18n/es-ES/common.ts index c2cef9afcd54d4..8eba3258c8686c 100644 --- a/web/i18n/es-ES/common.ts +++ b/web/i18n/es-ES/common.ts @@ -591,6 +591,10 @@ const translation = { pasteFileLinkInputPlaceholder: 'Introduzca la URL...', uploadFromComputerLimit: 'El archivo de carga no puede exceder {{size}}', }, + license: { + expiring: 'Caduca en un día', + expiring_plural: 'Caducando en {{count}} días', + }, } export default translation diff --git a/web/i18n/es-ES/login.ts b/web/i18n/es-ES/login.ts index 3a6debbe481039..bb465ac1bec09d 100644 --- a/web/i18n/es-ES/login.ts +++ b/web/i18n/es-ES/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethod: 'Método de autenticación no configurado', setYourAccount: 'Configura tu cuenta', noLoginMethodTip: 'Póngase en contacto con el administrador del sistema para agregar un método de autenticación.', + licenseInactive: 'Licencia inactiva', + licenseInactiveTip: 'La licencia de Dify Enterprise para su espacio de trabajo está inactiva. Póngase en contacto con su administrador para seguir utilizando Dify.', + licenseExpired: 'Licencia caducada', + licenseLost: 'Licencia perdida', + licenseExpiredTip: 'La licencia de Dify Enterprise para su espacio de trabajo ha caducado. Póngase en contacto con su administrador para seguir utilizando Dify.', + licenseLostTip: 'No se pudo conectar el servidor de licencias de Dife. Póngase en contacto con su administrador para seguir utilizando Dify.', } export default translation diff --git a/web/i18n/es-ES/workflow.ts b/web/i18n/es-ES/workflow.ts index 6c9af49c4d0fa9..4b3da57d7c7bce 100644 --- a/web/i18n/es-ES/workflow.ts +++ b/web/i18n/es-ES/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Tipo', binaryFileVariable: 'Variable de archivo binario', + extractListPlaceholder: 'Introduzca el índice de elementos de la lista, escriba \'/\' insertar variable', }, code: { inputVars: 'Variables de entrada', @@ -621,6 +622,7 @@ const translation = { filterConditionComparisonOperator: 'Operador de comparación de condiciones de filtro', asc: 'ASC', selectVariableKeyPlaceholder: 'Seleccione la clave de subvariable', + extractsCondition: 'Extraiga el elemento N', }, }, tracing: { diff --git a/web/i18n/fa-IR/common.ts b/web/i18n/fa-IR/common.ts index 9ec9332ce84a41..969c134be76795 100644 --- a/web/i18n/fa-IR/common.ts +++ b/web/i18n/fa-IR/common.ts @@ -591,6 +591,10 @@ const translation = { pasteFileLink: 'پیوند فایل را جایگذاری کنید', uploadFromComputerLimit: 'آپلود فایل نمی تواند از {{size}} تجاوز کند', }, + license: { + expiring_plural: 'انقضا در {{count}} روز', + expiring: 'انقضا در یک روز', + }, } export default translation diff --git a/web/i18n/fa-IR/login.ts b/web/i18n/fa-IR/login.ts index 0f2fe9464ad02f..7394ab325f4666 100644 --- a/web/i18n/fa-IR/login.ts +++ b/web/i18n/fa-IR/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethod: 'روش احراز هویت پیکربندی نشده است', noLoginMethodTip: 'لطفا برای افزودن روش احراز هویت با مدیر سیستم تماس بگیرید.', resetPasswordDesc: 'ایمیلی را که برای ثبت نام در Dify استفاده کرده اید تایپ کنید و ما یک ایمیل بازنشانی رمز عبور برای شما ارسال خواهیم کرد.', + licenseInactive: 'مجوز غیر فعال', + licenseLost: 'مجوز گم شده است', + licenseExpired: 'مجوز منقضی شده است', + licenseExpiredTip: 'مجوز Dify Enterprise برای فضای کاری شما منقضی شده است. لطفا برای ادامه استفاده از Dify با سرپرست خود تماس بگیرید.', + licenseInactiveTip: 'مجوز Dify Enterprise برای فضای کاری شما غیرفعال است. لطفا برای ادامه استفاده از Dify با سرپرست خود تماس بگیرید.', + licenseLostTip: 'اتصال سرور مجوز Dify انجام نشد. لطفا برای ادامه استفاده از Dify با سرپرست خود تماس بگیرید.', } export default translation diff --git a/web/i18n/fa-IR/workflow.ts b/web/i18n/fa-IR/workflow.ts index 4b00390663b77d..c23cf8f62e4fa0 100644 --- a/web/i18n/fa-IR/workflow.ts +++ b/web/i18n/fa-IR/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, binaryFileVariable: 'متغیر فایل باینری', type: 'نوع', + extractListPlaceholder: 'فهرست آیتم لیست را وارد کنید، متغیر درج \'/\' را تایپ کنید', }, code: { inputVars: 'متغیرهای ورودی', @@ -618,6 +619,7 @@ const translation = { filterConditionComparisonValue: 'مقدار شرایط فیلتر', selectVariableKeyPlaceholder: 'کلید متغیر فرعی را انتخاب کنید', asc: 'صعودی', + extractsCondition: 'مورد N را استخراج کنید', }, }, tracing: { diff --git a/web/i18n/fr-FR/common.ts b/web/i18n/fr-FR/common.ts index f6b5b62b300a69..62b5a1ca10b97a 100644 --- a/web/i18n/fr-FR/common.ts +++ b/web/i18n/fr-FR/common.ts @@ -591,6 +591,10 @@ const translation = { pasteFileLinkInvalid: 'Lien de fichier non valide', uploadFromComputerLimit: 'Le fichier de téléchargement ne peut pas dépasser {{size}}', }, + license: { + expiring: 'Expirant dans un jour', + expiring_plural: 'Expirant dans {{count}} jours', + }, } export default translation diff --git a/web/i18n/fr-FR/login.ts b/web/i18n/fr-FR/login.ts index 2f59b8afef3ee0..a7a633f3308dce 100644 --- a/web/i18n/fr-FR/login.ts +++ b/web/i18n/fr-FR/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethodTip: 'Veuillez contacter l’administrateur système pour ajouter une méthode d’authentification.', resetPasswordDesc: 'Tapez l’adresse e-mail que vous avez utilisée pour vous inscrire sur Dify et nous vous enverrons un e-mail de réinitialisation de mot de passe.', usePassword: 'Utiliser le mot de passe', + licenseInactiveTip: 'La licence Dify Enterprise de votre espace de travail est inactive. Veuillez contacter votre administrateur pour continuer à utiliser Dify.', + licenseLostTip: 'Échec de la connexion au serveur de licences Dify. Veuillez contacter votre administrateur pour continuer à utiliser Dify.', + licenseExpired: 'Licence expirée', + licenseLost: 'Licence perdue', + licenseExpiredTip: 'La licence Dify Enterprise de votre espace de travail a expiré. Veuillez contacter votre administrateur pour continuer à utiliser Dify.', + licenseInactive: 'Licence inactive', } export default translation diff --git a/web/i18n/fr-FR/workflow.ts b/web/i18n/fr-FR/workflow.ts index e736e2cb0793b4..dd41c8f9d196d4 100644 --- a/web/i18n/fr-FR/workflow.ts +++ b/web/i18n/fr-FR/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, binaryFileVariable: 'Variable de fichier binaire', type: 'Type', + extractListPlaceholder: 'Entrez l’index de l’élément de liste, tapez \'/\' insérer la variable', }, code: { inputVars: 'Variables de saisie', @@ -618,6 +619,7 @@ const translation = { limit: 'Haut N', orderBy: 'Trier par', filterConditionKey: 'Clé de condition de filtre', + extractsCondition: 'Extraire l’élément N', }, }, tracing: { diff --git a/web/i18n/hi-IN/common.ts b/web/i18n/hi-IN/common.ts index 80deee1f94702b..569ee0a1afc243 100644 --- a/web/i18n/hi-IN/common.ts +++ b/web/i18n/hi-IN/common.ts @@ -613,6 +613,10 @@ const translation = { fileExtensionNotSupport: 'फ़ाइल एक्सटेंशन समर्थित नहीं है', uploadFromComputer: 'स्थानीय अपलोड', }, + license: { + expiring: 'एक दिन में समाप्त हो रहा है', + expiring_plural: '{{गिनती}} दिनों में समाप्त हो रहा है', + }, } export default translation diff --git a/web/i18n/hi-IN/login.ts b/web/i18n/hi-IN/login.ts index e3ad60d572cd1f..0be8cbc3ab60ac 100644 --- a/web/i18n/hi-IN/login.ts +++ b/web/i18n/hi-IN/login.ts @@ -104,6 +104,12 @@ const translation = { resetPasswordDesc: 'वह ईमेल टाइप करें जिसका उपयोग आपने Dify पर साइन अप करने के लिए किया था और हम आपको एक पासवर्ड रीसेट ईमेल भेजेंगे।', withSSO: 'एसएसओ के साथ जारी रखें', back: 'पीछे', + licenseInactive: 'लाइसेंस निष्क्रिय', + licenseExpired: 'लाइसेंस की समय सीमा समाप्त हो गई', + licenseLost: 'लाइसेंस खो गया', + licenseLostTip: 'Dify लायसेंस सर्वर से कनेक्ट करने में विफल. Dify का उपयोग जारी रखने के लिए कृपया अपने व्यवस्थापक से संपर्क करें.', + licenseInactiveTip: 'आपके कार्यस्थल के लिए डिफाई एंटरप्राइज लाइसेंस निष्क्रिय है। कृपया डिफाई का उपयोग जारी रखने के लिए अपने प्रशासक से संपर्क करें।', + licenseExpiredTip: 'आपके कार्यस्थल के लिए डिफाई एंटरप्राइज लाइसेंस समाप्त हो गया है। कृपया डिफाई का उपयोग जारी रखने के लिए अपने प्रशासक से संपर्क करें।', } export default translation diff --git a/web/i18n/hi-IN/workflow.ts b/web/i18n/hi-IN/workflow.ts index 4112643488f3ee..70ddf1145f34e3 100644 --- a/web/i18n/hi-IN/workflow.ts +++ b/web/i18n/hi-IN/workflow.ts @@ -420,6 +420,7 @@ const translation = { }, type: 'प्रकार', binaryFileVariable: 'बाइनरी फ़ाइल चर', + extractListPlaceholder: 'सूची आइटम इंडेक्स दर्ज करें, \'/\' इन्सर्ट वेरिएबल टाइप करें', }, code: { inputVars: 'इनपुट वेरिएबल्स', @@ -638,6 +639,7 @@ const translation = { filterConditionComparisonOperator: 'फ़िल्टर शर्त तुलन ऑपरेटर', selectVariableKeyPlaceholder: 'उप चर कुंजी का चयन करें', inputVar: 'इनपुट वेरिएबल', + extractsCondition: 'N आइटम निकालें', }, }, tracing: { diff --git a/web/i18n/it-IT/common.ts b/web/i18n/it-IT/common.ts index 46586179ec2452..971c292852f161 100644 --- a/web/i18n/it-IT/common.ts +++ b/web/i18n/it-IT/common.ts @@ -622,6 +622,10 @@ const translation = { pasteFileLink: 'Incolla il collegamento del file', uploadFromComputerReadError: 'Lettura del file non riuscita, riprovare.', }, + license: { + expiring_plural: 'Scadenza tra {{count}} giorni', + expiring: 'Scadenza in un giorno', + }, } export default translation diff --git a/web/i18n/it-IT/login.ts b/web/i18n/it-IT/login.ts index eb547ec661fdfc..350424259e20f3 100644 --- a/web/i18n/it-IT/login.ts +++ b/web/i18n/it-IT/login.ts @@ -109,6 +109,12 @@ const translation = { resetPasswordDesc: 'Digita l\'e-mail che hai utilizzato per registrarti su Dify e ti invieremo un\'e-mail per reimpostare la password.', noLoginMethodTip: 'Contatta l\'amministratore di sistema per aggiungere un metodo di autenticazione.', enterYourName: 'Inserisci il tuo nome utente', + licenseLostTip: 'Impossibile connettersi al server licenze Dify. Contatta il tuo amministratore per continuare a utilizzare Dify.', + licenseExpired: 'Licenza scaduta', + licenseLost: 'Licenza persa', + licenseExpiredTip: 'La licenza Dify Enterprise per la tua area di lavoro è scaduta. Contatta il tuo amministratore per continuare a utilizzare Dify.', + licenseInactiveTip: 'La licenza Dify Enterprise per la tua area di lavoro è inattiva. Contatta il tuo amministratore per continuare a utilizzare Dify.', + licenseInactive: 'Licenza inattiva', } export default translation diff --git a/web/i18n/it-IT/workflow.ts b/web/i18n/it-IT/workflow.ts index 756fb665af6832..db617425e18bf5 100644 --- a/web/i18n/it-IT/workflow.ts +++ b/web/i18n/it-IT/workflow.ts @@ -424,6 +424,7 @@ const translation = { }, binaryFileVariable: 'Variabile file binario', type: 'Digitare', + extractListPlaceholder: 'Inserisci l\'indice delle voci dell\'elenco, digita \'/\' inserisci la variabile', }, code: { inputVars: 'Variabili di Input', @@ -645,6 +646,7 @@ const translation = { desc: 'DESC', filterConditionComparisonValue: 'Valore della condizione di filtro', orderBy: 'Ordina per', + extractsCondition: 'Estrai l\'elemento N', }, }, tracing: { diff --git a/web/i18n/ja-JP/common.ts b/web/i18n/ja-JP/common.ts index 19f502c92864ab..20182d89807dd5 100644 --- a/web/i18n/ja-JP/common.ts +++ b/web/i18n/ja-JP/common.ts @@ -591,6 +591,10 @@ const translation = { fileExtensionNotSupport: 'ファイル拡張子はサポートされていません', pasteFileLinkInvalid: '無効なファイルリンク', }, + license: { + expiring_plural: '有効期限 {{count}} 日', + expiring: '1日で有効期限が切れます', + }, } export default translation diff --git a/web/i18n/ja-JP/login.ts b/web/i18n/ja-JP/login.ts index 178c2617aea31c..fe4510686b6126 100644 --- a/web/i18n/ja-JP/login.ts +++ b/web/i18n/ja-JP/login.ts @@ -99,6 +99,12 @@ const translation = { sendVerificationCode: '確認コードの送信', enterYourName: 'ユーザー名を入力してください', resetPasswordDesc: 'Difyへのサインアップに使用したメールアドレスを入力すると、パスワードリセットメールが送信されます。', + licenseLost: 'ライセンスを失った', + licenseExpiredTip: 'ワークスペースの Dify Enterprise ライセンスの有効期限が切れています。Difyを引き続き使用するには、管理者に連絡してください。', + licenseInactive: 'ライセンスが非アクティブです', + licenseInactiveTip: 'ワークスペースの Dify Enterprise ライセンスが非アクティブです。Difyを引き続き使用するには、管理者に連絡してください。', + licenseExpired: 'ライセンスの有効期限が切れています', + licenseLostTip: 'Difyライセンスサーバーへの接続に失敗しました。続けてDifyを使用するために管理者に連絡してください。', } export default translation diff --git a/web/i18n/ja-JP/workflow.ts b/web/i18n/ja-JP/workflow.ts index a82ba71e485865..95e667de4ab0a3 100644 --- a/web/i18n/ja-JP/workflow.ts +++ b/web/i18n/ja-JP/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'タイプ', binaryFileVariable: 'バイナリファイル変数', + extractListPlaceholder: 'リスト項目のインデックスを入力し、変数を挿入 \'/\' と入力します', }, code: { inputVars: '入力変数', @@ -619,6 +620,7 @@ const translation = { filterConditionComparisonOperator: 'フィルター条件を比較オペレーター', inputVar: '入力変数', desc: 'DESC', + extractsCondition: 'N個のアイテムを抽出します', }, }, tracing: { diff --git a/web/i18n/ko-KR/common.ts b/web/i18n/ko-KR/common.ts index 43e7402bd40964..a5a697b2e50f98 100644 --- a/web/i18n/ko-KR/common.ts +++ b/web/i18n/ko-KR/common.ts @@ -587,6 +587,10 @@ const translation = { uploadFromComputerLimit: '업로드 파일은 {{size}}를 초과할 수 없습니다.', uploadFromComputerUploadError: '파일 업로드에 실패했습니다. 다시 업로드하십시오.', }, + license: { + expiring_plural: '{{count}}일 후에 만료', + expiring: '하루 후에 만료', + }, } export default translation diff --git a/web/i18n/ko-KR/login.ts b/web/i18n/ko-KR/login.ts index a338ce5ed7b718..05a60c7b681376 100644 --- a/web/i18n/ko-KR/login.ts +++ b/web/i18n/ko-KR/login.ts @@ -99,6 +99,12 @@ const translation = { enterYourName: '사용자 이름을 입력해 주세요', noLoginMethodTip: '인증 방법을 추가하려면 시스템 관리자에게 문의하십시오.', resetPasswordDesc: 'Dify에 가입할 때 사용한 이메일을 입력하면 비밀번호 재설정 이메일을 보내드립니다.', + licenseInactiveTip: '작업 영역에 대한 Dify Enterprise 라이선스가 비활성 상태입니다. Dify를 계속 사용하려면 관리자에게 문의하십시오.', + licenseLost: '라이센스 분실', + licenseLostTip: 'Dify 라이선스 서버에 연결하지 못했습니다. Dify를 계속 사용하려면 관리자에게 문의하십시오.', + licenseInactive: 'License Inactive(라이선스 비활성)', + licenseExpired: '라이센스가 만료되었습니다.', + licenseExpiredTip: '작업 영역에 대한 Dify Enterprise 라이선스가 만료되었습니다. Dify를 계속 사용하려면 관리자에게 문의하십시오.', } export default translation diff --git a/web/i18n/ko-KR/workflow.ts b/web/i18n/ko-KR/workflow.ts index 589831401c6afb..158d407e2a4aa6 100644 --- a/web/i18n/ko-KR/workflow.ts +++ b/web/i18n/ko-KR/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: '형', binaryFileVariable: '바이너리 파일 변수', + extractListPlaceholder: '목록 항목 인덱스 입력, \'/\' 변수 삽입', }, code: { inputVars: '입력 변수', @@ -618,6 +619,7 @@ const translation = { orderBy: '정렬 기준', selectVariableKeyPlaceholder: '하위 변수 키 선택', filterConditionComparisonOperator: '필터 조건 비교 연산자', + extractsCondition: 'N 항목을 추출합니다.', }, }, tracing: { diff --git a/web/i18n/language.ts b/web/i18n/language.ts index fde69328bd9221..e83088346c86d7 100644 --- a/web/i18n/language.ts +++ b/web/i18n/language.ts @@ -24,6 +24,7 @@ export type I18nText = { 'pl-PL': string 'hi-IN': string 'fa-IR': string + 'sl-SI': string } export const languages = data.languages @@ -53,6 +54,7 @@ export const NOTICE_I18N = { vi_VN: 'Thông báo quan trọng', it_IT: 'Avviso Importante', fa_IR: 'هشدار مهم', + sl_SI: 'Pomembno obvestilo', }, desc: { en_US: @@ -83,6 +85,8 @@ export const NOTICE_I18N = { 'Sistemimiz, 28 Ağustos\'ta 19:00 ile 24:00 UTC saatleri arasında güncelleme nedeniyle kullanılamayacaktır. Sorularınız için lütfen destek ekibimizle iletişime geçin (support@dify.ai). Sabrınız için teşekkür ederiz.', fa_IR: 'سیستم ما از ساعت 19:00 تا 24:00 UTC در تاریخ 28 اوت برای ارتقاء در دسترس نخواهد بود. برای سؤالات، لطفاً با تیم پشتیبانی ما (support@dify.ai) تماس بگیرید. ما برای صبر شما ارزش قائلیم.', + sl_SI: + 'Naš sistem ne bo na voljo od 19:00 do 24:00 UTC 28. avgusta zaradi nadgradnje. Za vprašanja se obrnite na našo skupino za podporo (support@dify.ai). Cenimo vašo potrpežljivost.', }, href: '#', } diff --git a/web/i18n/languages.json b/web/i18n/languages.json index a70963b067da55..c29d0280a1ac7e 100644 --- a/web/i18n/languages.json +++ b/web/i18n/languages.json @@ -139,6 +139,13 @@ "prompt_name": "Farsi", "example": "سلام, دیفای!", "supported": true + }, + { + "value": "sl-SI", + "name": "Slovensko (Slovenija)", + "prompt_name": "Slovensko", + "example": "Zdravo, Dify!", + "supported": true } ] } diff --git a/web/i18n/pl-PL/common.ts b/web/i18n/pl-PL/common.ts index 0a0f7adb9919c0..3dff3f5c27c407 100644 --- a/web/i18n/pl-PL/common.ts +++ b/web/i18n/pl-PL/common.ts @@ -609,6 +609,10 @@ const translation = { fileExtensionNotSupport: 'Rozszerzenie pliku nie jest obsługiwane', uploadFromComputer: 'Przesyłanie lokalne', }, + license: { + expiring_plural: 'Wygasa za {{count}} dni', + expiring: 'Wygasa w ciągu jednego dnia', + }, } export default translation diff --git a/web/i18n/pl-PL/login.ts b/web/i18n/pl-PL/login.ts index 78f11f3a268169..99719fe71a0065 100644 --- a/web/i18n/pl-PL/login.ts +++ b/web/i18n/pl-PL/login.ts @@ -104,6 +104,12 @@ const translation = { or: 'LUB', noLoginMethodTip: 'Skontaktuj się z administratorem systemu, aby dodać metodę uwierzytelniania.', noLoginMethod: 'Nie skonfigurowano metody uwierzytelniania', + licenseLost: 'Utrata licencji', + licenseExpired: 'Licencja wygasła', + licenseInactive: 'Licencja nieaktywna', + licenseExpiredTip: 'Licencja Dify Enterprise dla Twojego obszaru roboczego wygasła. Skontaktuj się z administratorem, aby kontynuować korzystanie z Dify.', + licenseLostTip: 'Nie udało się nawiązać połączenia z serwerem licencji Dify. Skontaktuj się z administratorem, aby kontynuować korzystanie z Dify.', + licenseInactiveTip: 'Licencja Dify Enterprise dla Twojego obszaru roboczego jest nieaktywna. Skontaktuj się z administratorem, aby kontynuować korzystanie z Dify.', } export default translation diff --git a/web/i18n/pl-PL/workflow.ts b/web/i18n/pl-PL/workflow.ts index f118f7945c526e..021cfd2534e8ed 100644 --- a/web/i18n/pl-PL/workflow.ts +++ b/web/i18n/pl-PL/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Typ', binaryFileVariable: 'Binarna zmienna pliku', + extractListPlaceholder: 'Wprowadź indeks elementu listy, wpisz "/" wstaw zmienną', }, code: { inputVars: 'Zmienne wejściowe', @@ -618,6 +619,7 @@ const translation = { filterCondition: 'Stan filtra', filterConditionComparisonValue: 'Wartość warunku filtru', selectVariableKeyPlaceholder: 'Wybierz klucz zmiennej podrzędnej', + extractsCondition: 'Wyodrębnij element N', }, }, tracing: { diff --git a/web/i18n/pt-BR/app-log.ts b/web/i18n/pt-BR/app-log.ts index 96e604c49e9066..03f5bc981fdbed 100644 --- a/web/i18n/pt-BR/app-log.ts +++ b/web/i18n/pt-BR/app-log.ts @@ -86,8 +86,8 @@ const translation = { agenteLogDetail: { agentMode: 'Modo Agente', toolUsed: 'Ferramenta usada', - iterações: 'Iterações', - iteração: 'Iteração', + iterations: 'Iterações', + iteration: 'Iteração', finalProcessing: 'Processamento Final', }, agentLogDetail: { diff --git a/web/i18n/pt-BR/common.ts b/web/i18n/pt-BR/common.ts index 431db81d24f660..d51b24e34d992f 100644 --- a/web/i18n/pt-BR/common.ts +++ b/web/i18n/pt-BR/common.ts @@ -591,6 +591,10 @@ const translation = { uploadFromComputerLimit: 'Carregar arquivo não pode exceder {{size}}', uploadFromComputerUploadError: 'Falha no upload do arquivo, faça o upload novamente.', }, + license: { + expiring: 'Expirando em um dia', + expiring_plural: 'Expirando em {{count}} dias', + }, } export default translation diff --git a/web/i18n/pt-BR/login.ts b/web/i18n/pt-BR/login.ts index 6c08de45b08e55..7af5181bb92324 100644 --- a/web/i18n/pt-BR/login.ts +++ b/web/i18n/pt-BR/login.ts @@ -99,6 +99,12 @@ const translation = { resetPasswordDesc: 'Digite o e-mail que você usou para se inscrever no Dify e enviaremos um e-mail de redefinição de senha.', sendVerificationCode: 'Enviar código de verificação', usePassword: 'Usar senha', + licenseInactiveTip: 'A licença do Dify Enterprise para seu espaço de trabalho está inativa. Entre em contato com o administrador para continuar usando o Dify.', + licenseLostTip: 'Falha ao conectar o servidor de licenças Dify. Entre em contato com o administrador para continuar usando o Dify.', + licenseExpired: 'Licença expirada', + licenseLost: 'Licença perdida', + licenseInactive: 'Licença inativa', + licenseExpiredTip: 'A licença do Dify Enterprise para seu espaço de trabalho expirou. Entre em contato com o administrador para continuar usando o Dify.', } export default translation diff --git a/web/i18n/pt-BR/workflow.ts b/web/i18n/pt-BR/workflow.ts index 44afda5cd4f2b1..de3f10ff6ea233 100644 --- a/web/i18n/pt-BR/workflow.ts +++ b/web/i18n/pt-BR/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Tipo', binaryFileVariable: 'Variável de arquivo binário', + extractListPlaceholder: 'Insira o índice do item da lista, digite \'/\' inserir variável', }, code: { inputVars: 'Variáveis de entrada', @@ -618,6 +619,7 @@ const translation = { filterConditionKey: 'Chave de condição do filtro', filterConditionComparisonOperator: 'Operador de comparação de condição de filtro', filterConditionComparisonValue: 'Valor da condição do filtro', + extractsCondition: 'Extraia o item N', }, }, tracing: { diff --git a/web/i18n/ro-RO/common.ts b/web/i18n/ro-RO/common.ts index 89b965db6333c4..0b7baf37ab7157 100644 --- a/web/i18n/ro-RO/common.ts +++ b/web/i18n/ro-RO/common.ts @@ -591,6 +591,10 @@ const translation = { uploadFromComputerLimit: 'Încărcarea fișierului nu poate depăși {{size}}', pasteFileLink: 'Lipiți linkul fișierului', }, + license: { + expiring: 'Expiră într-o zi', + expiring_plural: 'Expiră în {{count}} zile', + }, } export default translation diff --git a/web/i18n/ro-RO/login.ts b/web/i18n/ro-RO/login.ts index a60e367ea7319b..12878d46c08296 100644 --- a/web/i18n/ro-RO/login.ts +++ b/web/i18n/ro-RO/login.ts @@ -99,6 +99,12 @@ const translation = { or: 'SAU', resetPasswordDesc: 'Tastați e-mailul pe care l-ați folosit pentru a vă înscrie pe Dify și vă vom trimite un e-mail de resetare a parolei.', changePasswordBtn: 'Setați o parolă', + licenseLostTip: 'Nu s-a reușit conectarea serverului de licențe Dify. Contactați administratorul pentru a continua să utilizați Dify.', + licenseInactive: 'Licență inactivă', + licenseInactiveTip: 'Licența Dify Enterprise pentru spațiul de lucru este inactivă. Contactați administratorul pentru a continua să utilizați Dify.', + licenseExpired: 'Licență expirată', + licenseLost: 'Licență pierdută', + licenseExpiredTip: 'Licența Dify Enterprise pentru spațiul de lucru a expirat. Contactați administratorul pentru a continua să utilizați Dify.', } export default translation diff --git a/web/i18n/ro-RO/workflow.ts b/web/i18n/ro-RO/workflow.ts index d8cd84f730cdee..276ebefa90ffc7 100644 --- a/web/i18n/ro-RO/workflow.ts +++ b/web/i18n/ro-RO/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Tip', binaryFileVariable: 'Variabilă de fișier binar', + extractListPlaceholder: 'Introduceți indexul elementelor din listă, tastați "/" inserați variabila', }, code: { inputVars: 'Variabile de intrare', @@ -618,6 +619,7 @@ const translation = { limit: 'N de sus', filterConditionComparisonValue: 'Valoare Stare filtrare', asc: 'ASC', + extractsCondition: 'Extrageți elementul N', }, }, tracing: { diff --git a/web/i18n/ru-RU/common.ts b/web/i18n/ru-RU/common.ts index f383b534798957..8df7c1ae55524a 100644 --- a/web/i18n/ru-RU/common.ts +++ b/web/i18n/ru-RU/common.ts @@ -591,6 +591,10 @@ const translation = { uploadFromComputerLimit: 'Файл загрузки не может превышать {{size}}', uploadFromComputerUploadError: 'Загрузка файла не удалась, пожалуйста, загрузите еще раз.', }, + license: { + expiring: 'Срок действия истекает за один день', + expiring_plural: 'Срок действия истекает через {{count}} дней', + }, } export default translation diff --git a/web/i18n/ru-RU/login.ts b/web/i18n/ru-RU/login.ts index 7aba7c4cddc8ee..5c46cb7ff91404 100644 --- a/web/i18n/ru-RU/login.ts +++ b/web/i18n/ru-RU/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethodTip: 'Обратитесь к системному администратору, чтобы добавить метод аутентификации.', resetPasswordDesc: 'Введите адрес электронной почты, который вы использовали для регистрации в Dify, и мы отправим вам электронное письмо для сброса пароля.', or: 'ИЛИ', + licenseInactive: 'Лицензия неактивна', + licenseLostTip: 'Не удалось подключить сервер лицензий Dify. Обратитесь к своему администратору, чтобы продолжить использование Dify.', + licenseExpired: 'Срок действия лицензии истек', + licenseLost: 'Утеряна лицензия', + licenseInactiveTip: 'Лицензия Dify Enterprise для рабочего пространства неактивна. Обратитесь к своему администратору, чтобы продолжить использование Dify.', + licenseExpiredTip: 'Срок действия лицензии Dify Enterprise для рабочего пространства истек. Обратитесь к своему администратору, чтобы продолжить использование Dify.', } export default translation diff --git a/web/i18n/ru-RU/workflow.ts b/web/i18n/ru-RU/workflow.ts index c822f8c3e5ab07..2fdb6a5f3b00a4 100644 --- a/web/i18n/ru-RU/workflow.ts +++ b/web/i18n/ru-RU/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Тип', binaryFileVariable: 'Переменная двоичного файла', + extractListPlaceholder: 'Введите индекс элемента списка, введите \'/\' вставьте переменную', }, code: { inputVars: 'Входные переменные', @@ -618,6 +619,7 @@ const translation = { filterConditionKey: 'Ключ условия фильтра', selectVariableKeyPlaceholder: 'Выбор ключа подпеременной', filterConditionComparisonValue: 'Значение условия фильтра', + extractsCondition: 'Извлечение элемента N', }, }, tracing: { diff --git a/web/i18n/sl-SI/app-annotation.ts b/web/i18n/sl-SI/app-annotation.ts new file mode 100644 index 00000000000000..07b175a8e76182 --- /dev/null +++ b/web/i18n/sl-SI/app-annotation.ts @@ -0,0 +1,87 @@ +const translation = { + title: 'Opombe', + name: 'Odgovor na opombo', + editBy: 'Odgovor je uredil {{author}}', + noData: { + title: 'Brez opomb', + description: 'Opombe lahko urejate med odpravljanjem napak v aplikaciji ali jih množično uvozite tukaj za visokokakovosten odgovor.', + }, + table: { + header: { + question: 'vprašanje', + answer: 'odgovor', + createdAt: 'ustvarjeno ob', + hits: 'zadetki', + actions: 'dejanja', + addAnnotation: 'Dodaj opombo', + bulkImport: 'Množični uvoz', + bulkExport: 'Množični izvoz', + clearAll: 'Počisti vse opombe', + }, + }, + editModal: { + title: 'Uredi odgovor na opombo', + queryName: 'Uporabniško vprašanje', + answerName: 'Pripovedovalec Bot', + yourAnswer: 'Vaš odgovor', + answerPlaceholder: 'Vnesite svoj odgovor tukaj', + yourQuery: 'Vaše vprašanje', + queryPlaceholder: 'Vnesite svoje vprašanje tukaj', + removeThisCache: 'Odstrani to opombo', + createdAt: 'Ustvarjeno ob', + }, + addModal: { + title: 'Dodaj odgovor na opombo', + queryName: 'Vprašanje', + answerName: 'Odgovor', + answerPlaceholder: 'Vnesite odgovor tukaj', + queryPlaceholder: 'Vnesite vprašanje tukaj', + createNext: 'Dodaj še en odgovor z opombo', + }, + batchModal: { + title: 'Množični uvoz', + csvUploadTitle: 'Povlecite in spustite svoj CSV datoteko tukaj ali ', + browse: 'poiščite', + tip: 'CSV datoteka mora ustrezati naslednji strukturi:', + question: 'vprašanje', + answer: 'odgovor', + contentTitle: 'vsebina fragmenta', + content: 'vsebina', + template: 'Prenesite predlogo tukaj', + cancel: 'Prekliči', + run: 'Zaženi množično obdelavo', + runError: 'Napaka pri množičnem zagonu', + processing: 'V množični obdelavi', + completed: 'Uvoz zaključen', + error: 'Napaka pri uvozu', + ok: 'V redu', + }, + errorMessage: { + answerRequired: 'Odgovor je obvezen', + queryRequired: 'Vprašanje je obvezno', + }, + viewModal: { + annotatedResponse: 'Odgovor na opombo', + hitHistory: 'Zgodovina zadetkov', + hit: 'Zadetek', + hits: 'Zadetki', + noHitHistory: 'Ni zgodovine zadetkov', + }, + hitHistoryTable: { + query: 'Vprašanje', + match: 'Ujemanje', + response: 'Odgovor', + source: 'Vir', + score: 'Rezultat', + time: 'Čas', + }, + initSetup: { + title: 'Začetna nastavitev odgovora na opombo', + configTitle: 'Nastavitev odgovora na opombo', + confirmBtn: 'Shrani in omogoči', + configConfirmBtn: 'Shrani', + }, + embeddingModelSwitchTip: 'Model za vektorizacijo besedila opomb, preklapljanje modelov bo ponovno vektoriziralo, kar bo povzročilo dodatne stroške.', +} + +export default translation diff --git a/web/i18n/sl-SI/app-api.ts b/web/i18n/sl-SI/app-api.ts new file mode 100644 index 00000000000000..17d0645193608d --- /dev/null +++ b/web/i18n/sl-SI/app-api.ts @@ -0,0 +1,84 @@ +const translation = { + apiServer: 'API Strežnik', + apiKey: 'API Ključ', + status: 'Status', + disabled: 'Onemogočeno', + ok: 'V uporabi', + copy: 'Kopiraj', + copied: 'Kopirano', + regenerate: 'Regeneriraj', + play: 'Predvajaj', + pause: 'Premor', + playing: 'Predvajanje', + loading: 'Nalaganje', + merMaid: { + rerender: 'Ponovno izrisi', + }, + never: 'Nikoli', + apiKeyModal: { + apiSecretKey: 'API Skrivni ključ', + apiSecretKeyTips: 'Da bi preprečili zlorabo API-ja, zaščitite svoj API ključ. Izogibajte se uporabi v navadnem besedilu v sprednji kodi. :)', + createNewSecretKey: 'Ustvari nov skrivni ključ', + secretKey: 'Skrivni ključ', + created: 'USTVARJENO', + lastUsed: 'ZADNJA UPORABA', + generateTips: 'Hranite ta ključ na varnem in dostopnem mestu.', + }, + actionMsg: { + deleteConfirmTitle: 'Izbrisati ta skrivni ključ?', + deleteConfirmTips: 'To dejanje ni mogoče razveljaviti.', + ok: 'V redu', + }, + completionMode: { + title: 'API za dokončanje aplikacije', + info: 'Za visokokakovostno generiranje besedil, kot so članki, povzetki in prevodi, uporabite API za dokončanje sporočil z vnosom uporabnika. Generiranje besedil temelji na parametrih modela in predlogah pozivov, določenih v Dify Prompt Engineering.', + createCompletionApi: 'Ustvari sporočilo o dokončanju', + createCompletionApiTip: 'Ustvari sporočilo o dokončanju za podporo načinu vprašanj in odgovorov.', + inputsTips: '(Neobvezno) Navedite vnosna polja uporabnikov kot ključ-vrednost pare, ki ustrezajo spremenljivkam v Prompt Eng. Ključ je ime spremenljivke, vrednost pa vrednost parametra. Če je vrsta polja Izberi, mora biti posredovana vrednost ena izmed vnaprej določenih možnosti.', + queryTips: 'Vsebina besedila vnosa uporabnika.', + blocking: 'Vrsta blokiranja, čakanje na dokončanje izvajanja in vračanje rezultatov. (Zahteve se lahko prekinejo, če je postopek dolg)', + streaming: 'streaming povratki. Implementacija povratkov pretakanja na podlagi SSE (Server-Sent Events).', + messageFeedbackApi: 'Povratne informacije o sporočilih (všeč)', + messageFeedbackApiTip: 'Ocenite prejeta sporočila v imenu končnih uporabnikov z všečki ali nevšečki. Ti podatki so vidni na strani Dnevniki in opombe ter se uporabljajo za nadaljnje fino prilagajanje modela.', + messageIDTip: 'ID sporočila', + ratingTip: 'všeč ali nevšeč, null je preklic', + parametersApi: 'Pridobite informacije o parametrih aplikacije', + parametersApiTip: 'Pridobite konfigurirane vhodne parametre, vključno z imeni spremenljivk, imeni polj, vrstami in privzetimi vrednostmi. Običajno se uporablja za prikaz teh polj v obrazcu ali izpolnjevanje privzetih vrednosti po nalaganju odjemalca.', + }, + chatMode: { + title: 'API za klepet aplikacije', + info: 'Za vsestranske pogovorne aplikacije, ki uporabljajo obliko vprašanj in odgovorov, pokličite API za klepetna sporočila, da začnete dialog. Ohranite tekoče pogovore tako, da prenesete vrnjeni conversation_id. Parametri odgovorov in predloge so odvisni od nastavitev Dify Prompt Eng.', + createChatApi: 'Ustvari klepetno sporočilo', + createChatApiTip: 'Ustvari novo pogovorno sporočilo ali nadaljuj obstoječi pogovor.', + inputsTips: '(Neobvezno) Navedite vnosna polja uporabnikov kot ključ-vrednost pare, ki ustrezajo spremenljivkam v Prompt Eng. Ključ je ime spremenljivke, vrednost pa vrednost parametra. Če je vrsta polja Izberi, mora biti posredovana vrednost ena izmed vnaprej določenih možnosti.', + queryTips: 'Vsebina vnosa/uporabniškega vprašanja', + blocking: 'Vrsta blokiranja, čakanje na dokončanje izvajanja in vračanje rezultatov. (Zahteve se lahko prekinejo, če je postopek dolg)', + streaming: 'streaming povratki. Implementacija povratkov pretakanja na podlagi SSE (Server-Sent Events).', + conversationIdTip: '(Neobvezno) ID pogovora: pustite prazno za prvi pogovor; prenesite conversation_id iz konteksta, da nadaljujete dialog.', + messageFeedbackApi: 'Povratne informacije končnih uporabnikov o sporočilu, všeč', + messageFeedbackApiTip: 'Ocenite prejeta sporočila v imenu končnih uporabnikov z všečki ali nevšečki. Ti podatki so vidni na strani Dnevniki in opombe ter se uporabljajo za nadaljnje fino prilagajanje modela.', + messageIDTip: 'ID sporočila', + ratingTip: 'všeč ali nevšeč, null je preklic', + chatMsgHistoryApi: 'Pridobi zgodovino klepetnih sporočil', + chatMsgHistoryApiTip: 'Prva stran vrne najnovejše `limit` zapise, ki so v obratnem vrstnem redu.', + chatMsgHistoryConversationIdTip: 'ID pogovora', + chatMsgHistoryFirstId: 'ID prvega klepeta na trenutni strani. Privzeto ni.', + chatMsgHistoryLimit: 'Koliko klepetov je vrnjenih na eno zahtevo', + conversationsListApi: 'Pridobi seznam pogovorov', + conversationsListApiTip: 'Pridobi seznam sej trenutnega uporabnika. Privzeto je vrnjenih zadnjih 20 sej.', + conversationsListFirstIdTip: 'ID zadnjega zapisa na trenutni strani, privzeto ni.', + conversationsListLimitTip: 'Koliko klepetov je vrnjenih na eno zahtevo', + conversationRenamingApi: 'Preimenovanje pogovora', + conversationRenamingApiTip: 'Preimenujte pogovore; ime je prikazano v večsejnih odjemalskih vmesnikih.', + conversationRenamingNameTip: 'Novo ime', + parametersApi: 'Pridobite informacije o parametrih aplikacije', + parametersApiTip: 'Pridobite konfigurirane vhodne parametre, vključno z imeni spremenljivk, imeni polj, vrstami in privzetimi vrednostmi. Običajno se uporablja za prikaz teh polj v obrazcu ali izpolnjevanje privzetih vrednosti po nalaganju odjemalca.', + }, + develop: { + requestBody: 'Telo zahteve', + pathParams: 'Parametri poti', + query: 'Poizvedba', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/app-debug.ts b/web/i18n/sl-SI/app-debug.ts new file mode 100644 index 00000000000000..8672fa5c58fd25 --- /dev/null +++ b/web/i18n/sl-SI/app-debug.ts @@ -0,0 +1,242 @@ +const translation = { + pageTitle: { + line1: 'PROMPT', + line2: 'Inženiring', + }, + orchestrate: 'Orkestriraj', + promptMode: { + simple: 'Preklopi na strokovni način, da urejaš celoten PROMPT', + advanced: 'Strokovni način', + switchBack: 'Preklopi nazaj', + advancedWarning: { + title: 'Preklopil si na strokovni način. Ko spremeniš PROMPT, ne moreš več preklopiti nazaj v osnovni način.', + description: 'V strokovnem načinu lahko urejaš celoten PROMPT.', + learnMore: 'Preberi več', + ok: 'V redu', + }, + operation: { + addMessage: 'Dodaj sporočilo', + }, + contextMissing: 'Manjka komponenta konteksta, zato učinkovitost PROMPT-a morda ne bo najboljša.', + }, + operation: { + applyConfig: 'Objavi', + resetConfig: 'Ponastavi', + debugConfig: 'Odpravljanje napak', + addFeature: 'Dodaj funkcionalnost', + automatic: 'Generiraj', + stopResponding: 'Prenehaj odgovarjati', + agree: 'všeč', + disagree: 'ni všeč', + cancelAgree: 'Prekliči všeček', + cancelDisagree: 'Prekliči nevšečnost', + userAction: 'Uporabnik ', + }, + notSetAPIKey: { + title: 'Ključ ponudnika LLM ni nastavljen', + trailFinished: 'Preizkus končan', + description: 'Ključ ponudnika LLM ni nastavljen. Pred odpravljanjem napak je treba nastaviti ključ.', + settingBtn: 'Pojdi v nastavitve', + }, + trailUseGPT4Info: { + title: 'GPT-4 trenutno ni podprt', + description: 'Za uporabo GPT-4 je treba nastaviti API ključ.', + }, + feature: { + groupChat: { + title: 'Izboljšanje klepeta', + description: 'Dodajanje prednastavitev klepeta lahko izboljša uporabniško izkušnjo.', + }, + groupExperience: { + title: 'Izboljšanje izkušnje', + }, + conversationOpener: { + title: 'Začetek pogovora', + description: 'V klepetu AI običajno začne pogovor z uporabnikom z dobrodošlico.', + }, + suggestedQuestionsAfterAnswer: { + title: 'Nadaljnja vprašanja', + description: 'Nastavitev predlogov za naslednja vprašanja lahko uporabnikom izboljša klepet.', + resDes: '3 predlogi za naslednje vprašanje uporabnika.', + tryToAsk: 'Poskusi vprašati', + }, + moreLikeThis: { + title: 'Več takšnih', + description: 'Ustvari več besedil naenkrat, nato pa jih urejaj in nadaljuj z ustvarjanjem.', + generateNumTip: 'Število generacij vsakič', + tip: 'Uporaba te funkcije povzroča dodatno porabo žetonov.', + }, + speechToText: { + title: 'Govor v besedilo', + description: 'Ko je omogočeno, lahko uporabljaš glasovni vnos.', + resDes: 'Glasovni vnos je omogočen.', + }, + textToSpeech: { + title: 'Besedilo v govor', + description: 'Ko je omogočeno, lahko besedilo pretvoriš v govor.', + resDes: 'Pretvorba besedila v zvok je omogočena.', + }, + citation: { + title: 'Citati in pripisovanja', + description: 'Ko je omogočeno, prikaži izvorni dokument in pripisani del generirane vsebine.', + resDes: 'Citati in pripisovanja so omogočeni.', + }, + annotation: { + title: 'Odgovor z opombami', + description: 'Ročno lahko dodate visokokakovostne odgovore v predpomnilnik za prednostno ujemanje s podobnimi vprašanji uporabnikov.', + resDes: 'Odgovor z opombami je omogočen.', + scoreThreshold: { + title: 'Prag ujemanja', + description: 'Uporabljeno za nastavitev praga podobnosti za odgovor z opombami.', + easyMatch: 'Lahko ujemanje', + accurateMatch: 'Natančno ujemanje', + }, + matchVariable: { + title: 'Spremenljivka za ujemanje', + choosePlaceholder: 'Izberi spremenljivko za ujemanje', + }, + cacheManagement: 'Upravljanje opomb', + cached: 'Z opombo', + remove: 'Odstrani', + removeConfirm: 'Izbrisati to opombo?', + add: 'Dodaj opombo', + edit: 'Uredi opombo', + }, + dataSet: { + title: 'Kontekst', + noData: 'Uvozi znanje kot kontekst', + words: 'Besede', + textBlocks: 'Bloki besedila', + selectTitle: 'Izberi referenčno znanje', + selected: 'Izbrano znanje', + noDataSet: 'Znanje ni bilo najdeno', + toCreate: 'Pojdi na ustvarjanje', + notSupportSelectMulti: 'Trenutno je podprto le eno znanje', + queryVariable: { + title: 'Spremenljivka poizvedbe', + tip: 'Ta spremenljivka bo uporabljena kot vnos poizvedbe za pridobitev kontekstnih informacij.', + choosePlaceholder: 'Izberi spremenljivko poizvedbe', + noVar: 'Ni spremenljivk', + noVarTip: 'ustvari spremenljivko v razdelku Spremenljivke', + unableToQueryDataSet: 'Neuspešna poizvedba po znanju', + unableToQueryDataSetTip: 'Neuspešna poizvedba po znanju, izberi spremenljivko poizvedbe v razdelku kontekst.', + ok: 'V redu', + contextVarNotEmpty: 'Spremenljivka poizvedbe ne sme biti prazna', + deleteContextVarTitle: 'Izbrisati spremenljivko “{{varName}}”?', + deleteContextVarTip: 'Ta spremenljivka je nastavljena kot spremenljivka za poizvedbo po kontekstu. Če jo odstraniš, bo to vplivalo na uporabo znanja. Če jo želiš izbrisati, ponovno izberi v razdelku kontekst.', + }, + }, + tools: { + title: 'Orodja', + tips: 'Orodja nudijo standardiziran način klicanja API-jev, pri čemer se uporabniški vnos ali spremenljivke uporabijo kot parametri za poizvedovanje zunanjih podatkov.', + toolsInUse: '{{count}} orodij v uporabi', + modal: { + title: 'Orodje', + toolType: { + title: 'Tip orodja', + placeholder: 'Izberi tip orodja', + }, + name: { + title: 'Ime', + placeholder: 'Vnesi ime', + }, + variableName: { + title: 'Ime spremenljivke', + placeholder: 'Vnesi ime spremenljivke', + }, + }, + }, + conversationHistory: { + title: 'Zgodovina pogovorov', + description: 'Nastavi predpone imen za vloge v pogovoru', + tip: 'Zgodovina pogovorov ni omogočena. Dodaj v zgornji PROMPT.', + learnMore: 'Preberi več', + editModal: { + title: 'Uredi imena vlog v pogovoru', + userPrefix: 'Predpona uporabnika', + assistantPrefix: 'Predpona pomočnika', + }, + }, + toolbox: { + title: 'ORODJA', + }, + moderation: { + title: 'Moderiranje vsebine', + description: 'Zagotovi varno izhodno vsebino s pomočjo API-ja za moderiranje ali vzdrževanja seznama občutljivih besed.', + allEnabled: 'VSEBINA VNOSA/IZHODA omogočena', + inputEnabled: 'VSEBINA VNOSA omogočena', + outputEnabled: 'VSEBINA IZHODA omogočena', + modal: { + title: 'Nastavitve moderiranja vsebine', + provider: { + title: 'Ponudnik', + openai: 'OpenAI Moderiranje', + openaiTip: { + prefix: 'OpenAI Moderiranje zahteva nastavljen API ključ pri ', + suffix: '.', + }, + keywords: 'Ključne besede', + }, + keywords: { + tip: 'Vsaka beseda na lastni vrstici, ločena z vrsticami. Največ 100 znakov na vrstico.', + placeholder: 'Vsaka beseda na lastni vrstici, ločena z vrsticami', + line: 'Vrstica', + }, + content: { + input: 'Moderiraj VSEBINO VNOSA', + output: 'Moderiraj VSEBINO IZHODA', + }, + }, + }, + debug: { + title: 'Odpravljanje napak', + description: 'Debugiranje omogoča pregled podrobnih informacij, kot so podatki API-jev, vklop dnevnikov, opozorila in še več.', + }, + agent: { + title: 'Pomočnik', + description: 'Osnovne informacije in odgovorne naloge pomočnika.', + prompts: 'Temeljni PROMPT', + message: { + title: 'Vrstice sporočila', + user: 'Uporabnik', + assistant: 'Pomočnik', + }, + }, + history: { + title: 'Zgodovina', + notFound: 'Zgodovina ni bila najdena', + notOpen: 'Zgodovina ni odprta', + }, + prompt: { + title: 'Vsebina PROMPT-a', + }, + message: { + title: 'Sporočilo', + description: 'Način nastavitve formatiranega pogovora.', + tryChat: 'Preizkusi klepet', + }, + theme: { + title: 'Tema', + themes: { + default: 'Osnovna tema', + light: 'Svetla tema', + dark: 'Temna tema', + custom: 'Prilagodi temo', + }, + modal: { + title: 'Nastavitve teme', + primaryColor: { + title: 'Primarna barva', + placeholder: 'Izberi primarno barvo', + }, + textColor: { + title: 'Barva besedila', + placeholder: 'Izberi barvo besedila', + }, + ok: 'V redu', + }, + }, + }, +} + +module.exports = translation diff --git a/web/i18n/sl-SI/app-log.ts b/web/i18n/sl-SI/app-log.ts new file mode 100644 index 00000000000000..03efc594cab9f6 --- /dev/null +++ b/web/i18n/sl-SI/app-log.ts @@ -0,0 +1,95 @@ +const translation = { + title: 'Dnevniki', + description: 'Dnevniki beležijo stanje delovanja aplikacije, vključno z vnosi uporabnikov in odgovori umetne inteligence.', + dateTimeFormat: 'DD.MM.YYYY hh:mm A', + table: { + header: { + updatedTime: 'Čas posodobitve', + time: 'Čas ustvarjanja', + endUser: 'Končni uporabnik ali račun', + input: 'Vnos', + output: 'Izhod', + summary: 'Naslov', + messageCount: 'Število sporočil', + userRate: 'Ocena uporabnika', + adminRate: 'Ocena operaterja', + startTime: 'ZAČETNI ČAS', + status: 'STATUS', + runtime: 'ČAS DELOVANJA', + tokens: 'ŽETONI', + user: 'Končni uporabnik ali račun', + version: 'VERZIJA', + }, + pagination: { + previous: 'Prejšnja', + next: 'Naslednja', + }, + empty: { + noChat: 'Še ni pogovora', + noOutput: 'Ni izhoda', + element: { + title: 'Je kdo tam?', + content: 'Opazujte in označite interakcije med končnimi uporabniki in aplikacijami umetne inteligence, da stalno izboljšujete natančnost AI. Lahko delite ali preizkusite spletno aplikacijo sami, nato pa se vrnete na to stran.', + }, + }, + }, + detail: { + time: 'Čas', + conversationId: 'ID pogovora', + promptTemplate: 'Predloga PROMPT-a', + promptTemplateBeforeChat: 'Predloga PROMPT-a pred pogovorom · Kot sistemsko sporočilo', + annotationTip: 'Izboljšave, ki jih je označil {{user}}', + timeConsuming: 'Porabljen čas', + second: 's', + tokenCost: 'Porabljeni žetoni', + loading: 'nalaganje', + operation: { + like: 'všeč', + dislike: 'ni všeč', + addAnnotation: 'Dodaj izboljšavo', + editAnnotation: 'Uredi izboljšavo', + annotationPlaceholder: 'Vnesite pričakovan odgovor, ki ga želite, da AI odgovori, kar se lahko uporabi za izboljšanje modela in kakovosti generiranja besedil v prihodnje.', + }, + variables: 'Spremenljivke', + uploadImages: 'Naložene slike', + }, + filter: { + period: { + today: 'Danes', + last7days: 'Zadnjih 7 dni', + last4weeks: 'Zadnje 4 tedne', + last3months: 'Zadnji 3 meseci', + last12months: 'Zadnjih 12 mesecev', + monthToDate: 'Mesec do danes', + quarterToDate: 'Četrtletje do danes', + yearToDate: 'Leto do danes', + allTime: 'Vse obdobje', + }, + annotation: { + all: 'Vse', + annotated: 'Označene izboljšave ({{count}} elementov)', + not_annotated: 'Neoznačene', + }, + sortBy: 'Razvrsti po:', + descending: 'padajoče', + ascending: 'naraščajoče', + }, + workflowTitle: 'Dnevniki poteka dela', + workflowSubtitle: 'Dnevnik beleži delovanje avtomatizacije.', + runDetail: { + title: 'Dnevnik pogovora', + workflowTitle: 'Podrobnosti dnevnika', + }, + promptLog: 'Dnevnik PROMPT-ov', + agentLog: 'Dnevnik pomočnika', + viewLog: 'Ogled dnevnika', + agentLogDetail: { + agentMode: 'Način pomočnika', + toolUsed: 'Uporabljeno orodje', + iterations: 'Iteracije', + iteration: 'Iteracija', + finalProcessing: 'Končna obdelava', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/app-overview.ts b/web/i18n/sl-SI/app-overview.ts new file mode 100644 index 00000000000000..ced27cc77976c5 --- /dev/null +++ b/web/i18n/sl-SI/app-overview.ts @@ -0,0 +1,168 @@ +const translation = { + welcome: { + firstStepTip: 'Začnite s tem, da', + enterKeyTip: 'vnesete svoj OpenAI API ključ spodaj', + getKeyTip: 'Pridobite svoj API ključ na nadzorni plošči OpenAI', + placeholder: 'Vaš OpenAI API ključ (npr. sk-xxxx)', + }, + apiKeyInfo: { + cloud: { + trial: { + title: 'Uporabljate {{providerName}} poskusno kvoto.', + description: 'Poskusna kvota je namenjena vašemu testiranju. Preden se kvota izčrpa, nastavite lastnega ponudnika modela ali kupite dodatno kvoto.', + }, + exhausted: { + title: 'Vaša poskusna kvota je bila porabljena, nastavite API ključ.', + description: 'Porabili ste svojo poskusno kvoto. Prosimo, nastavite lastnega ponudnika modela ali kupite dodatno kvoto.', + }, + }, + selfHost: { + title: { + row1: 'Za začetek,', + row2: 'najprej nastavite svojega ponudnika modela.', + }, + }, + callTimes: 'Število klicev', + usedToken: 'Porabljeni žetoni', + setAPIBtn: 'Pojdi na nastavitev ponudnika modela', + tryCloud: 'Ali preizkusite oblačno različico Dify s prosto kvoto', + }, + overview: { + title: 'Pregled', + appInfo: { + explanation: 'Pripravljena AI spletna aplikacija', + accessibleAddress: 'Javni URL', + preview: 'Predogled', + regenerate: 'Ustvari ponovno', + regenerateNotice: 'Ali želite ponovno ustvariti javni URL?', + preUseReminder: 'Pred nadaljevanjem omogočite spletno aplikacijo.', + settings: { + entry: 'Nastavitve', + title: 'Nastavitve spletne aplikacije', + webName: 'Ime spletne aplikacije', + webDesc: 'Opis spletne aplikacije', + webDescTip: 'Besedilo bo prikazano na strani za stranke in bo zagotavljalo osnovna navodila za uporabo aplikacije', + webDescPlaceholder: 'Vnesite opis spletne aplikacije', + language: 'Jezik', + workflow: { + title: 'Potek dela', + subTitle: 'Podrobnosti poteka dela', + show: 'Prikaži', + hide: 'Skrij', + showDesc: 'Pokažite ali skrijte podrobnosti poteka dela v spletni aplikaciji', + }, + chatColorTheme: 'Barvna tema klepeta', + chatColorThemeDesc: 'Nastavite barvno temo klepetalnega bota', + chatColorThemeInverted: 'Inverzna', + invalidHexMessage: 'Neveljavna vrednost heksa', + sso: { + label: 'SSO avtentikacija', + title: 'SSO spletne aplikacije', + description: 'Vsi uporabniki morajo pred uporabo spletne aplikacije opraviti prijavo preko SSO', + tooltip: 'Za omogočitev SSO za spletno aplikacijo se obrnite na skrbnika', + }, + more: { + entry: 'Prikaži več nastavitev', + copyright: 'Avtorske pravice', + copyRightPlaceholder: 'Vnesite ime avtorja ali organizacije', + privacyPolicy: 'Politika zasebnosti', + privacyPolicyPlaceholder: 'Vnesite povezavo do politike zasebnosti', + privacyPolicyTip: 'Pomaga obiskovalcem razumeti, katere podatke aplikacija zbira, glejte politiko zasebnosti Dify.', + customDisclaimer: 'Prilagojena izjava o omejitvi odgovornosti', + customDisclaimerPlaceholder: 'Vnesite prilagojeno izjavo o omejitvi odgovornosti', + customDisclaimerTip: 'Prilagojeno izjavo o omejitvi odgovornosti bo prikazano na strani za stranke, ki bo zagotavljala dodatne informacije o aplikaciji', + }, + }, + embedded: { + entry: 'Vdelano', + title: 'Vdelava na spletno stran', + explanation: 'Izberite način vdelave klepeta na svojo spletno stran', + iframe: 'Za dodajanje klepeta kjerkoli na vaši spletni strani dodajte to iframe v vašo HTML kodo.', + scripts: 'Za dodajanje klepeta na spodnji desni del vaše spletne strani dodajte to kodo v vašo HTML kodo.', + chromePlugin: 'Namestite Dify Chatbot razširitev za Chrome', + copied: 'Kopirano', + copy: 'Kopiraj', + }, + qrcode: { + title: 'Povezava QR koda', + scan: 'Skeniraj za deljenje', + download: 'Prenesi QR kodo', + }, + customize: { + way: 'način', + entry: 'Prilagodi', + title: 'Prilagodi AI spletno aplikacijo', + explanation: 'Lahko prilagodite sprednji del spletne aplikacije, da ustreza vašim scenarijem in potrebam po slogu.', + way1: { + name: 'Forkajte kodo stranke, jo spremenite in namestite na Vercel (priporočeno)', + step1: 'Forkajte kodo stranke in jo spremenite', + step1Tip: 'Kliknite tukaj, da forknite izvorno kodo v svoj GitHub račun in spremenite kodo', + step1Operation: 'Dify-WebClient', + step2: 'Namestite na Vercel', + step2Tip: 'Kliknite tukaj, da uvozite repozitorij v Vercel in namestite', + step2Operation: 'Uvoz repozitorija', + step3: 'Konfigurirajte spremenljivke okolja', + step3Tip: 'Dodajte naslednje spremenljivke okolja v Vercel', + }, + way2: { + name: 'Napišite kodo na strani stranke za klic API-ja in jo namestite na strežnik', + operation: 'Dokumentacija', + }, + }, + }, + apiInfo: { + title: 'API storitev v ozadju', + explanation: 'Enostavna integracija v vašo aplikacijo', + accessibleAddress: 'API končna točka storitve', + doc: 'API referenca', + }, + status: { + running: 'V storitvi', + disable: 'Onemogočeno', + }, + }, + analysis: { + title: 'Analiza', + ms: 'ms', + tokenPS: 'Žetoni/s', + totalMessages: { + title: 'Skupno število sporočil', + explanation: 'Število dnevnih AI interakcij.', + }, + totalConversations: { + title: 'Skupno število pogovorov', + explanation: 'Število dnevnih AI pogovorov; inženiring promptov/debugging izključeno.', + }, + activeUsers: { + title: 'Aktivni uporabniki', + explanation: 'Unikatni uporabniki, ki sodelujejo v vprašanjih in odgovorih z AI; inženiring promptov/debugging izključeno.', + }, + tokenUsage: { + title: 'Poraba žetonov', + explanation: 'Odzrcaljuje dnevno porabo žetonov jezikovnega modela za aplikacijo, uporabno za namene nadzora stroškov.', + consumed: 'Porabljeni', + }, + avgSessionInteractions: { + title: 'Povprečne interakcije v seji', + explanation: 'Število neprekinjenih komunikacij med uporabnikom in AI; za aplikacije, ki temeljijo na pogovoru.', + }, + avgUserInteractions: { + title: 'Povprečne interakcije uporabnika', + explanation: 'Odzrcaljuje dnevno pogostost uporabe uporabnikov. Ta metrika odraža vezanost uporabnikov.', + }, + userSatisfactionRate: { + title: 'Stopnja zadovoljstva uporabnikov', + explanation: 'Število všečkov na 1.000 sporočil. To kaže delež odgovorov, s katerimi so uporabniki zelo zadovoljni.', + }, + avgResponseTime: { + title: 'Povprečni odzivni čas', + explanation: 'Čas (v ms) za obdelavo/odgovor AI; za aplikacije, ki temeljijo na besedilu.', + }, + tps: { + title: 'Hitrost izhoda žetonov', + explanation: 'Merite učinkovitost LLM. Šteje hitrost izhoda žetonov od začetka zahteve do zaključka izhoda.', + }, + }, +} + +export default translation diff --git a/web/i18n/sl-SI/app.ts b/web/i18n/sl-SI/app.ts new file mode 100644 index 00000000000000..d111316668c2ca --- /dev/null +++ b/web/i18n/sl-SI/app.ts @@ -0,0 +1,138 @@ +const translation = { + createApp: 'USTVARI APLIKACIJO', + types: { + all: 'Vse', + chatbot: 'Klepetalnik', + agent: 'Agent', + workflow: 'Potek dela', + completion: 'Dopolnjevanje', + }, + duplicate: 'Podvoji', + duplicateTitle: 'Podvoji aplikacijo', + export: 'Izvozi DSL', + exportFailed: 'Izvoz DSL ni uspel.', + importDSL: 'Uvozi datoteko DSL', + createFromConfigFile: 'Ustvari iz datoteke DSL', + importFromDSL: 'Uvozi iz DSL', + importFromDSLFile: 'Iz datoteke DSL', + importFromDSLUrl: 'Iz URL-ja', + importFromDSLUrlPlaceholder: 'Tukaj prilepi povezavo DSL', + deleteAppConfirmTitle: 'Izbrišem to aplikacijo?', + deleteAppConfirmContent: + 'Brisanje aplikacije je nepopravljivo. Uporabniki ne bodo več imeli dostopa do vaše aplikacije, vse konfiguracije in dnevniki pa bodo trajno izbrisani.', + appDeleted: 'Aplikacija izbrisana', + appDeleteFailed: 'Brisanje aplikacije ni uspelo', + join: 'Pridruži se skupnosti', + communityIntro: + 'Pogovarjajte se s člani ekipe, sodelavci in razvijalci na različnih kanalih.', + roadmap: 'Oglejte si naš načrt', + newApp: { + startFromBlank: 'Ustvari iz nič', + startFromTemplate: 'Ustvari iz predloge', + captionAppType: 'Kakšno aplikacijo želite ustvariti?', + chatbotDescription: 'Zgradite aplikacijo, ki temelji na klepetu. Ta aplikacija uporablja format vprašanj in odgovorov, ki omogoča več krogov neprekinjenega pogovora.', + completionDescription: 'Zgradite aplikacijo, ki na podlagi pozivov generira visokokakovostno besedilo, kot je ustvarjanje člankov, povzetkov, prevodov in več.', + completionWarning: 'Ta vrsta aplikacije ne bo več podprta.', + agentDescription: 'Zgradite inteligentnega agenta, ki lahko samostojno izbere orodja za dokončanje nalog.', + workflowDescription: 'Zgradite aplikacijo, ki generira visokokakovostno besedilo na podlagi orkestracije poteka dela z visoko stopnjo prilagodljivosti. Primerna je za izkušene uporabnike.', + workflowWarning: 'Trenutno v beta različici', + chatbotType: 'Metoda orkestracije klepetalnika', + basic: 'Osnovno', + basicTip: 'Za začetnike, lahko kasneje preklopite na Chatflow', + basicFor: 'ZA ZAČETNIKE', + basicDescription: 'Osnovna orkestracija omogoča orkestracijo aplikacije klepetalnika z enostavnimi nastavitvami, brez možnosti spreminjanja vgrajenih pozivov. Primerna je za začetnike.', + advanced: 'Chatflow', + advancedFor: 'Za napredne uporabnike', + advancedDescription: 'Orkestracija poteka dela orkestrira klepetalnike v obliki potekov dela, ki ponuja visoko stopnjo prilagodljivosti, vključno z možnostjo urejanja vgrajenih pozivov. Primerna je za izkušene uporabnike.', + captionName: 'Ikona in ime aplikacije', + appNamePlaceholder: 'Poimenujte svojo aplikacijo', + captionDescription: 'Opis', + appDescriptionPlaceholder: 'Vnesite opis aplikacije', + useTemplate: 'Uporabi to predlogo', + previewDemo: 'Predogled demo različice', + chatApp: 'Pomočnik', + chatAppIntro: + 'Želim zgraditi aplikacijo, ki temelji na klepetu. Ta aplikacija uporablja format vprašanj in odgovorov, ki omogoča več krogov neprekinjenega pogovora.', + agentAssistant: 'Novi pomočnik agenta', + completeApp: 'Generator besedila', + completeAppIntro: + 'Želim ustvariti aplikacijo, ki na podlagi pozivov generira visokokakovostno besedilo, kot je ustvarjanje člankov, povzetkov, prevodov in več.', + showTemplates: 'Želim izbrati iz predloge', + hideTemplates: 'Vrni se na izbiro načina', + Create: 'Ustvari', + Cancel: 'Prekliči', + nameNotEmpty: 'Ime ne sme biti prazno', + appTemplateNotSelected: 'Izberite predlogo', + appTypeRequired: 'Izberite vrsto aplikacije', + appCreated: 'Aplikacija ustvarjena', + appCreateFailed: 'Ustvarjanje aplikacije ni uspelo', + }, + editApp: 'Uredi informacije', + editAppTitle: 'Uredi informacije o aplikaciji', + editDone: 'Informacije o aplikaciji posodobljene', + editFailed: 'Posodobitev informacij o aplikaciji ni uspela', + iconPicker: { + ok: 'V redu', + cancel: 'Prekliči', + emoji: 'Emoji', + image: 'Slika', + }, + answerIcon: { + title: 'Uporabite ikono WebApp za zamenjavo 🤖', + description: 'Ali uporabiti ikono WebApp za zamenjavo 🤖 v deljeni aplikaciji', + descriptionInExplore: 'Ali uporabiti ikono WebApp za zamenjavo 🤖 v razdelku Razišči', + }, + switch: 'Preklopi na Workflow Orchestrate', + switchTipStart: 'Za vas bo ustvarjena nova kopija aplikacije, ki bo preklopila na Workflow Orchestrate. Nova kopija ne bo ', + switchTip: 'dovolila', + switchTipEnd: ' preklopa nazaj na Basic Orchestrate.', + switchLabel: 'Kopija aplikacije, ki bo ustvarjena', + removeOriginal: 'Izbriši izvirno aplikacijo', + switchStart: 'Začni preklop', + typeSelector: { + all: 'VSE VRSTE', + chatbot: 'Klepetalnik', + agent: 'Agent', + workflow: 'Potek dela', + completion: 'Dopolnjevanje', + }, + tracing: { + title: 'Sledenje uspešnosti aplikacije', + description: 'Konfiguracija ponudnika LLMOps tretje osebe in sledenje uspešnosti aplikacije.', + config: 'Konfiguracija', + view: 'Ogled', + collapse: 'Strni', + expand: 'Razširi', + tracing: 'Sledenje', + disabled: 'Onemogočeno', + disabledTip: 'Najprej konfigurirajte ponudnika', + enabled: 'V storitvi', + tracingDescription: 'Zajem celotnega konteksta izvajanja aplikacije, vključno s klici LLM, kontekstom, pozivi, zahtevami HTTP in še več, na platformo za sledenje tretje osebe.', + configProviderTitle: { + configured: 'Konfigurirano', + notConfigured: 'Konfigurirajte ponudnika za omogočanje sledenja', + moreProvider: 'Več ponudnikov', + }, + langsmith: { + title: 'LangSmith', + description: 'Vse-v-enem razvijalska platforma za vsak korak življenjskega cikla aplikacije, ki jo poganja LLM.', + }, + langfuse: { + title: 'Langfuse', + description: 'Sledi, vrednoti, upravlja pozive in meri za odpravljanje napak in izboljšanje vaše aplikacije LLM.', + }, + inUse: 'V uporabi', + configProvider: { + title: 'Konfiguracija', + placeholder: 'Vnesite vaš {{key}}', + project: 'Projekt', + publicKey: 'Javni ključ', + secretKey: 'Skrivni ključ', + viewDocsLink: 'Ogled dokumentov {{key}}', + removeConfirmTitle: 'Odstraniti konfiguracijo {{key}}?', + removeConfirmContent: 'Trenutna konfiguracija je v uporabi, odstranitev bo onemogočila funkcijo sledenja.', + }, + }, +} + +export default translation diff --git a/web/i18n/sl-SI/billing.ts b/web/i18n/sl-SI/billing.ts new file mode 100644 index 00000000000000..edbf03ee9aa337 --- /dev/null +++ b/web/i18n/sl-SI/billing.ts @@ -0,0 +1,118 @@ +const translation = { + currentPlan: 'Trenutni načrt', + upgradeBtn: { + plain: 'Nadgradi načrt', + encourage: 'Nadgradi zdaj', + encourageShort: 'Nadgradi', + }, + viewBilling: 'Upravljanje s plačili in naročninami', + buyPermissionDeniedTip: 'Za naročnino kontaktirajte svojega skrbnika podjetja', + plansCommon: { + title: 'Izberite načrt, ki vam ustreza', + yearlyTip: 'Z letno naročnino pridobite 2 meseca brezplačno!', + mostPopular: 'Najbolj priljubljeno', + planRange: { + monthly: 'Mesečno', + yearly: 'Letno', + }, + month: 'mesec', + year: 'leto', + save: 'Prihranite ', + free: 'Brezplačno', + currentPlan: 'Trenutni načrt', + contractSales: 'Kontaktirajte prodajo', + contractOwner: 'Kontaktirajte upravitelja ekipe', + startForFree: 'Začnite brezplačno', + getStartedWith: 'Začnite z ', + contactSales: 'Kontaktirajte prodajo', + talkToSales: 'Pogovorite se s prodajo', + modelProviders: 'Ponudniki modelov', + teamMembers: 'Člani ekipe', + annotationQuota: 'Kvote za označevanje', + buildApps: 'Gradite aplikacije', + vectorSpace: 'Prostor za vektorje', + vectorSpaceBillingTooltip: 'Vsak 1 MB lahko shrani približno 1,2 milijona znakov vektoriziranih podatkov (ocenjeno z uporabo OpenAI Embeddings, odvisno od modelov).', + vectorSpaceTooltip: 'Prostor za vektorje je dolgoročni pomnilniški sistem, potreben za to, da LLM-ji razumejo vaše podatke.', + documentsUploadQuota: 'Kvote za nalaganje dokumentov', + documentProcessingPriority: 'Prioriteta obdelave dokumentov', + documentProcessingPriorityTip: 'Za višjo prioriteto obdelave dokumentov nadgradite svoj načrt.', + documentProcessingPriorityUpgrade: 'Obdelujte več podatkov z večjo natančnostjo in hitrostjo.', + priority: { + 'standard': 'Standard', + 'priority': 'Prioriteta', + 'top-priority': 'Najvišja prioriteta', + }, + logsHistory: 'Zgodovina dnevnikov', + customTools: 'Prilagojena orodja', + unavailable: 'Ni na voljo', + days: 'dni', + unlimited: 'Neomejeno', + support: 'Podpora', + supportItems: { + communityForums: 'Skupnostni forumi', + emailSupport: 'Podpora preko e-pošte', + priorityEmail: 'Prioritetna podpora preko e-pošte in klepeta', + logoChange: 'Sprememba logotipa', + SSOAuthentication: 'SSO avtentikacija', + personalizedSupport: 'Osebna podpora', + dedicatedAPISupport: 'Namenska podpora API-ju', + customIntegration: 'Prilagojena integracija in podpora', + ragAPIRequest: 'RAG API zahtevki', + bulkUpload: 'Masovni prenos dokumentov', + agentMode: 'Način agenta', + workflow: 'Potek dela', + llmLoadingBalancing: 'LLM uravnoteženje obremenitve', + llmLoadingBalancingTooltip: 'Dodajte več API ključev modelom, kar učinkovito preseže omejitve hitrosti API-ja.', + }, + comingSoon: 'Kmalu na voljo', + member: 'Član', + memberAfter: 'Član', + messageRequest: { + title: 'Krediti za sporočila', + tooltip: 'Kvota za klice sporočil pri različnih načrtih z uporabo modelov OpenAI (razen GPT-4). Sporočila preko omejitve bodo uporabljala vaš OpenAI API ključ.', + }, + annotatedResponse: { + title: 'Omejitve kvote za označevanje', + tooltip: 'Ročno urejanje in označevanje odgovorov omogoča prilagojeno visoko kakovostno odgovarjanje na vprašanja v aplikacijah. (Velja samo za klepetalne aplikacije)', + }, + ragAPIRequestTooltip: 'Nanaša se na število API klicev, ki vključujejo samo sposobnosti obdelave baze znanja Dify.', + receiptInfo: 'Le lastnik ekipe in skrbnik ekipe lahko naročita in si ogledate podatke o plačilih', + }, + plans: { + sandbox: { + name: 'Peskovnik', + description: '200 brezplačnih poskusov GPT', + includesTitle: 'Vključuje:', + }, + professional: { + name: 'Profesionalni', + description: 'Za posameznike in male ekipe, da odklenete več zmogljivosti po ugodni ceni.', + includesTitle: 'Vse v brezplačnem načrtu, plus:', + }, + team: { + name: 'Ekipa', + description: 'Sodelujte brez omejitev in uživajte v vrhunski zmogljivosti.', + includesTitle: 'Vse v profesionalnem načrtu, plus:', + }, + enterprise: { + name: 'Podjetje', + description: 'Pridobite vse zmogljivosti in podporo za velike sisteme kritične za misijo.', + includesTitle: 'Vse v načrtu Ekipa, plus:', + }, + }, + vectorSpace: { + fullTip: 'Prostor za vektorje je poln.', + fullSolution: 'Nadgradite svoj načrt za več prostora.', + }, + apps: { + fullTipLine1: 'Nadgradite svoj načrt, da', + fullTipLine2: 'gradite več aplikacij.', + }, + annotatedResponse: { + fullTipLine1: 'Nadgradite svoj načrt, da', + fullTipLine2: 'označite več pogovorov.', + quotaTitle: 'Kvote za odgovor z označevanjem', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/common.ts b/web/i18n/sl-SI/common.ts new file mode 100644 index 00000000000000..2bd148397dd096 --- /dev/null +++ b/web/i18n/sl-SI/common.ts @@ -0,0 +1,799 @@ +const translation = { + api: { + success: 'Uspeh', + actionSuccess: 'Dejanje je uspelo', + saved: 'Shranjeno', + create: 'Ustvarjeno', + remove: 'Odstranjeno', + }, + operation: { + create: 'Ustvari', + confirm: 'Potrdi', + cancel: 'Prekliči', + clear: 'Počisti', + save: 'Shrani', + saveAndEnable: 'Shrani in omogoči', + edit: 'Uredi', + add: 'Dodaj', + added: 'Dodano', + refresh: 'Osveži', + reset: 'Ponastavi', + search: 'Išči', + change: 'Spremeni', + remove: 'Odstrani', + send: 'Pošlji', + copy: 'Kopiraj', + lineBreak: 'Prelom vrstice', + sure: 'Prepričan sem', + download: 'Prenesi', + delete: 'Izbriši', + settings: 'Nastavitve', + setup: 'Nastavitev', + getForFree: 'Dobite brezplačno', + reload: 'Ponovno naloži', + ok: 'V redu', + log: 'Dnevnik', + learnMore: 'Izvedi več', + params: 'Parametri', + duplicate: 'Podvoji', + rename: 'Preimenuj', + audioSourceUnavailable: 'Zvočni vir ni na voljo', + copyImage: 'Kopiraj sliko', + openInNewTab: 'Odpri v novem zavihku', + zoomOut: 'Pomanjšanje', + zoomIn: 'Povečava', + }, + errorMsg: { + fieldRequired: '{{field}} je obvezno', + urlError: 'url mora začeti z http:// ali https://', + }, + placeholder: { + input: 'Vnesite prosim', + select: 'Izberite prosim', + }, + voice: { + language: { + zhHans: 'Kitajščina (poenostavljena)', + zhHant: 'Kitajščina (tradicionalna)', + enUS: 'Angleščina', + deDE: 'Nemščina', + frFR: 'Francoščina', + esES: 'Španščina', + itIT: 'Italijanščina', + thTH: 'Tajščina', + idID: 'Indonezijščina', + jaJP: 'Japonščina', + koKR: 'Korejščina', + ptBR: 'Portugalščina', + ruRU: 'Ruščina', + ukUA: 'Ukrajinščina', + viVN: 'Vietnamščina', + plPL: 'Poljščina', + roRO: 'Romunščina', + hiIN: 'Hindujščina', + trTR: 'Turščina', + faIR: 'Farsi', + }, + }, + unit: { + char: 'znaki', + }, + actionMsg: { + noModification: 'Trenutno ni sprememb.', + modifiedSuccessfully: 'Spremenjeno uspešno', + modifiedUnsuccessfully: 'Spremenjeno neuspešno', + copySuccessfully: 'Kopirano uspešno', + paySucceeded: 'Plačilo je uspelo', + payCancelled: 'Plačilo preklicano', + generatedSuccessfully: 'Generirano uspešno', + generatedUnsuccessfully: 'Generirano neuspešno', + }, + model: { + params: { + temperature: 'Temperatura', + temperatureTip: + 'Nadzoruje naključnost: Znižanje temperature vodi do manj naključnih zaključkov. Ko se temperatura približa ničli, bo model postal determinističen in ponavljajoč.', + top_p: 'Top P', + top_pTip: + 'Nadzoruje raznolikost preko vzorčenja jedra: 0.5 pomeni, da je upoštevanih polovica vseh možnosti glede na njihovo verjetnost.', + presence_penalty: 'Kaznovanje za prisotnost', + presence_penaltyTip: + 'Kako močno kaznovati nove besede, glede na to, ali so se že pojavile v besedilu.\nPovečuje verjetnost, da bo model obravnaval nove teme.', + frequency_penalty: 'Kaznovanje za frekvenco', + frequency_penaltyTip: + 'Kako močno kaznovati nove besede glede na njihovo že obstoječo frekvenco v besedilu.\nZmanjšuje verjetnost, da bo model ponavljal iste vrstice.', + max_tokens: 'Največje število žetonov', + max_tokensTip: + 'Uporabljeno za omejitev največje dolžine odgovora, v žetonih.\nVečje vrednosti lahko omejijo prostor za besede, zgodovino pogovorov in znanje. \nPriporočljivo je nastaviti pod dve tretjini.\ngpt-4-1106-preview, gpt-4-vision-preview maksimalno število žetonov (vnos 128k, izhod 4k)', + maxTokenSettingTip: 'Vaša nastavitev za največje število žetonov je visoka, kar lahko omeji prostor za pozive, poizvedbe in podatke. Razmislite o nastavitvi pod 2/3.', + setToCurrentModelMaxTokenTip: 'Največje število žetonov je posodobljeno na 80 % največjega števila žetonov trenutnega modela {{maxToken}}.', + stop_sequences: 'Zaporedja ustavljanja', + stop_sequencesTip: 'Do štiri zaporedja, kjer bo API prenehal generirati nadaljnje žetone. Vrnjen tekst ne bo vseboval zaporedja ustavitve.', + stop_sequencesPlaceholder: 'Vnesite zaporedje in pritisnite Tab', + }, + tone: { + Creative: 'Kreativno', + Balanced: 'Uravnoteženo', + Precise: 'Natančno', + Custom: 'Po meri', + }, + addMoreModel: 'Pojdite v nastavitve, da dodate več modelov', + }, + menus: { + status: 'beta', + explore: 'Raziskuj', + apps: 'Studio', + plugins: 'Vtičniki', + pluginsTips: 'Integrirajte vtičnike tretjih oseb ali ustvarite vtičnike, združljive s ChatGPT.', + datasets: 'Znanje', + datasetsTips: 'KMALU: Uvozite svoje besedilne podatke ali pišite podatke v realnem času preko spletnih kljuk za izboljšanje konteksta LLM.', + newApp: 'Nova aplikacija', + newDataset: 'Ustvari znanje', + tools: 'Orodja', + }, + userProfile: { + settings: 'Nastavitve', + emailSupport: 'Podpora po e-pošti', + workspace: 'Delovni prostor', + createWorkspace: 'Ustvari delovni prostor', + helpCenter: 'Pomoč', + communityFeedback: 'Povratne informacije', + roadmap: 'Načrt razvoja', + community: 'Skupnost', + about: 'O nas', + logout: 'Odjava', + }, + settings: { + accountGroup: 'SPLOŠNO', + workplaceGroup: 'DELOVNI PROSTOR', + account: 'Moj račun', + members: 'Člani', + billing: 'Zaračunavanje', + integrations: 'Integracije', + language: 'Jezik', + provider: 'Ponudnik modelov', + dataSource: 'Vir podatkov', + plugin: 'Vtičniki', + apiBasedExtension: 'Razširitev API-ja', + }, + account: { + account: 'Račun', + myAccount: 'Moj račun', + studio: 'Dify Studio', + avatar: 'Avatar', + name: 'Ime', + email: 'E-pošta', + password: 'Geslo', + passwordTip: 'Lahko nastavite stalno geslo, če ne želite uporabljati začasnih prijavnih kod', + setPassword: 'Nastavi geslo', + resetPassword: 'Ponastavi geslo', + currentPassword: 'Trenutno geslo', + newPassword: 'Novo geslo', + confirmPassword: 'Potrdi geslo', + notEqual: 'Gesli se ne ujemata.', + langGeniusAccount: 'Dify račun', + langGeniusAccountTip: 'Vaš Dify račun in povezani uporabniški podatki.', + editName: 'Uredi ime', + showAppLength: 'Prikaz {{length}} aplikacij', + delete: 'Izbriši račun', + deleteTip: 'Brisanje vašega računa bo trajno izbrisalo vse vaše podatke in jih ne bo mogoče obnoviti.', + deleteConfirmTip: 'Za potrditev pošljite naslednje s svojega registriranega e-poštnega naslova na ', + }, + members: { + team: 'Ekipa', + invite: 'Dodaj', + name: 'IME', + lastActive: 'NAZADNJE AKTIVEN', + role: 'VLOGE', + pending: 'V teku...', + owner: 'Lastnik', + admin: 'Administrator', + adminTip: 'Lahko ustvarja aplikacije in upravlja nastavitve ekipe', + normal: 'Običajni uporabnik', + normalTip: 'Lahko uporablja samo aplikacije, ne more ustvarjati aplikacij', + builder: 'Graditelj', + builderTip: 'Lahko ustvarja in ureja lastne aplikacije', + editor: 'Urednik', + editorTip: 'Lahko ustvarja in ureja aplikacije', + datasetOperator: 'Skrbnik znanja', + datasetOperatorTip: 'Lahko upravlja samo bazo znanja', + inviteTeamMember: 'Dodaj člana ekipe', + inviteTeamMemberTip: 'Do vaših podatkov bo lahko dostopal takoj po prijavi.', + email: 'E-pošta', + emailInvalid: 'Neveljaven format e-pošte', + emailPlaceholder: 'Vnesite e-poštne naslove', + sendInvite: 'Pošlji povabilo', + invitedAsRole: 'Povabljen kot uporabnik {{role}}', + invitationSent: 'Povabilo poslano', + invitationSentTip: 'Povabilo poslano, in po prijavi v Dify bodo imeli dostop do vaših podatkov ekipe.', + invitationLink: 'Povezava za povabilo', + failedInvitationEmails: 'Spodnji uporabniki niso bili uspešno povabljeni', + ok: 'V redu', + removeFromTeam: 'Odstrani iz ekipe', + removeFromTeamTip: 'Odstranjen bo dostop do ekipe', + setAdmin: 'Nastavi za administratorja', + setMember: 'Nastavi za običajnega člana', + setBuilder: 'Nastavi za graditelja', + setEditor: 'Nastavi za urednika', + disInvite: 'Prekliči povabilo', + deleteMember: 'Izbriši člana', + you: '(Vi)', + }, + integrations: { + connected: 'Povezano', + google: 'Google', + googleAccount: 'Prijavite se z Google računom', + github: 'GitHub', + githubAccount: 'Prijavite se z GitHub računom', + connect: 'Poveži', + }, + language: { + displayLanguage: 'Jezik prikaza', + timezone: 'Časovni pas', + }, + provider: { + apiKey: 'API ključ', + enterYourKey: 'Vnesite svoj API ključ tukaj', + invalidKey: 'Neveljaven OpenAI API ključ', + validatedError: 'Preverjanje ni uspelo: ', + validating: 'Preverjam ključ...', + saveFailed: 'Shranjevanje API ključa ni uspelo', + apiKeyExceedBill: 'Ta API ključ nima več na voljo kvote, preberite', + addKey: 'Dodaj ključ', + comingSoon: 'Kmalu', + editKey: 'Uredi', + invalidApiKey: 'Neveljaven API ključ', + azure: { + apiBase: 'API Osnova', + apiBasePlaceholder: 'URL API osnove vašega Azure OpenAI končnega mesta.', + apiKey: 'API ključ', + apiKeyPlaceholder: 'Vnesite svoj API ključ tukaj', + helpTip: 'Spoznajte Azure OpenAI storitev', + }, + openaiHosted: { + openaiHosted: 'Gostovani OpenAI', + onTrial: 'NA PREIZKUSU', + exhausted: 'KVOTA PORABLJENA', + desc: 'Gostitvena storitev OpenAI, ki jo ponuja Dify, vam omogoča uporabo modelov, kot je GPT-3.5. Preden porabite kvoto za preizkus, morate nastaviti druge ponudnike modelov.', + callTimes: 'Časi klicev', + usedUp: 'Kvota za preizkus porabljena. Dodajte svojega ponudnika modelov.', + useYourModel: 'Trenutno uporabljate svojega ponudnika modelov.', + close: 'Zapri', + }, + anthropicHosted: { + anthropicHosted: 'Anthropic Claude', + onTrial: 'NA PREIZKUSU', + exhausted: 'KVOTA PORABLJENA', + desc: 'Zmogljiv model, ki se odlično obnese pri različnih nalogah, od sofisticiranega dialoga in ustvarjanja kreativnih vsebin do podrobnih navodil.', + callTimes: 'Časi klicev', + usedUp: 'Kvota za preizkus porabljena. Dodajte svojega ponudnika modelov.', + useYourModel: 'Trenutno uporabljate svojega ponudnika modelov.', + close: 'Zapri', + }, + anthropic: { + using: 'Zmožnost vdelave uporablja', + enableTip: 'Za omogočitev modela Anthropic morate najprej povezati OpenAI ali Azure OpenAI storitev.', + notEnabled: 'Ni omogočeno', + keyFrom: 'Pridobite svoj API ključ pri Anthropic', + }, + encrypted: { + front: 'Vaš API ključ bo šifriran in shranjen z uporabo', + back: ' tehnologije.', + }, + }, + modelProvider: { + notConfigured: 'Sistemski model še ni popolnoma konfiguriran, nekatere funkcije morda ne bodo na voljo.', + systemModelSettings: 'Nastavitve sistemskega modela', + systemModelSettingsLink: 'Zakaj je potrebno nastaviti sistemski model?', + selectModel: 'Izberite svoj model', + setupModelFirst: 'Najprej nastavite svoj model', + systemReasoningModel: { + key: 'Sistemski model za sklepanja', + tip: 'Nastavite privzeti model za sklepanja, ki se bo uporabljal za ustvarjanje aplikacij, kot tudi funkcije, kot so generiranje imen dialogov in predlaganje naslednjih vprašanj.', + }, + embeddingModel: { + key: 'Model za vdelavo', + tip: 'Nastavite privzeti model za obdelavo vdelave dokumentov znanja, tako pri iskanju kot pri uvozu znanja se uporablja ta model za vektorizacijo. Preklop bo povzročil neusklajenost vektorske dimenzije med uvoženim znanjem in vprašanjem, kar bo povzročilo neuspešno iskanje. Da bi se izognili neuspehu pri iskanju, ne preklapljajte tega modela brez potrebe.', + required: 'Model za vdelavo je obvezen', + }, + speechToTextModel: { + key: 'Model za pretvorbo govora v besedilo', + tip: 'Nastavite privzeti model za vnos govora v besedilo v pogovoru.', + }, + ttsModel: { + key: 'Model za pretvorbo besedila v govor', + tip: 'Nastavite privzeti model za pretvorbo besedila v govor v pogovoru.', + }, + rerankModel: { + key: 'Model za prerazvrstitev', + tip: 'Model za prerazvrstitev bo prerazporedil seznam kandidatskih dokumentov na podlagi semantične ujemanja z uporabniško poizvedbo, s čimer se izboljšajo rezultati semantičnega razvrščanja.', + }, + apiKey: 'API-KEY', + quota: 'Kvote', + searchModel: 'Model iskanja', + noModelFound: 'Za {{model}} ni najden noben model', + models: 'Modeli', + showMoreModelProvider: 'Prikaži več ponudnikov modelov', + selector: { + tip: 'Ta model je bil odstranjen. Prosimo, dodajte model ali izberite drugega.', + emptyTip: 'Ni razpoložljivih modelov', + emptySetting: 'Prosimo, pojdite v nastavitve za konfiguracijo', + rerankTip: 'Prosimo, nastavite model za prerazvrstitev', + }, + card: { + quota: 'KVOTE', + onTrial: 'Na preizkusu', + paid: 'Plačano', + quotaExhausted: 'Kvote porabljene', + callTimes: 'Časi klicev', + tokens: 'Žetoni', + buyQuota: 'Kupi kvoto', + priorityUse: 'Prednostna uporaba', + removeKey: 'Odstrani API ključ', + tip: 'Prednostno se bo uporabila plačana kvota. Kvota za preizkus se bo uporabila, ko bo plačana kvota porabljena.', + }, + item: { + deleteDesc: '{{modelName}} se uporablja kot sistemski model za sklepanja. Nekatere funkcije ne bodo na voljo po odstranitvi. Prosimo, potrdite.', + freeQuota: 'BREZPLAČNA KVOTA', + }, + addApiKey: 'Dodaj svoj API ključ', + invalidApiKey: 'Neveljaven API ključ', + encrypted: { + front: 'Vaš API ključ bo šifriran in shranjen z uporabo', + back: ' tehnologije.', + }, + freeQuota: { + howToEarn: 'Kako zaslužiti', + }, + addMoreModelProvider: 'DODAJ VEČ PONUDNIKOV MODELOV', + addModel: 'Dodaj model', + modelsNum: '{{num}} modelov', + showModels: 'Prikaži modele', + showModelsNum: 'Prikaži {{num}} modelov', + collapse: 'Strni', + config: 'Konfiguracija', + modelAndParameters: 'Model in parametri', + model: 'Model', + featureSupported: '{{feature}} podprto', + callTimes: 'Število klicev', + credits: 'Sporočilni krediti', + buyQuota: 'Kupi kvoto', + getFreeTokens: 'Pridobi brezplačne žetone', + priorityUsing: 'Prednostna uporaba', + deprecated: 'Zastarelo', + confirmDelete: 'Potrdite izbris?', + quotaTip: 'Preostali razpoložljivi brezplačni žetoni', + loadPresets: 'Naloži prednastavitve', + parameters: 'PARAMETRI', + loadBalancing: 'Uravnoteženje obremenitev', + loadBalancingDescription: 'Zmanjšajte pritisk s pomočjo več sklopov poverilnic.', + loadBalancingHeadline: 'Uravnoteženje obremenitev', + configLoadBalancing: 'Konfiguracija uravnoteženja obremenitev', + modelHasBeenDeprecated: 'Ta model je zastarel', + providerManaged: 'Upravljano s strani ponudnika', + providerManagedDescription: 'Uporabite enoten sklop poverilnic, ki jih zagotovi ponudnik modela.', + defaultConfig: 'Privzeta konfiguracija', + apiKeyStatusNormal: 'Stanje API ključa je normalno', + apiKeyRateLimit: 'Omejitev hitrosti je dosežena, na voljo po {{seconds}} sekundah', + addConfig: 'Dodaj konfiguracijo', + editConfig: 'Uredi konfiguracijo', + loadBalancingLeastKeyWarning: 'Za omogočanje uravnoteženja obremenitev morata biti omogočena vsaj 2 ključa.', + loadBalancingInfo: 'Privzeto uravnoteženje obremenitev uporablja strategijo Round-robin. Če se sproži omejitev hitrosti, se uporabi 1-minutno obdobje ohlajanja.', + upgradeForLoadBalancing: 'Nadgradite svoj načrt, da omogočite uravnoteženje obremenitev.', + dataSource: { + add: 'Dodaj vir podatkov', + connect: 'Poveži', + configure: 'Konfiguriraj', + notion: { + title: 'Notion', + description: 'Uporaba Notiona kot vira podatkov za Znanost.', + connectedWorkspace: 'Povezano delovno okolje', + addWorkspace: 'Dodaj delovno okolje', + connected: 'Povezan', + disconnected: 'Prekinjen', + changeAuthorizedPages: 'Spremeni pooblaščene strani', + pagesAuthorized: 'Pooblaščene strani', + sync: 'Sinhroniziraj', + remove: 'Odstrani', + selector: { + pageSelected: 'Izbrane strani', + searchPages: 'Iskanje strani...', + noSearchResult: 'Ni rezultatov iskanja', + addPages: 'Dodaj strani', + preview: 'PREDOGLED', + }, + }, + website: { + title: 'Spletna stran', + description: 'Uvoz vsebine s spletnih strani z uporabo spletnega pajka.', + with: 'S', + configuredCrawlers: 'Konfigurirani pajki', + active: 'Aktiven', + inactive: 'Neaktiven', + }, + }, + plugin: { + serpapi: { + apiKey: 'API ključ', + apiKeyPlaceholder: 'Vnesite svoj API ključ', + keyFrom: 'Pridobite svoj SerpAPI ključ na strani računa SerpAPI', + }, + }, + apiBasedExtension: { + title: 'Razširitve API omogočajo centralizirano upravljanje API, kar poenostavi konfiguracijo za enostavno uporabo v aplikacijah Dify.', + link: 'Naučite se, kako razviti svojo API razširitev.', + linkUrl: 'https://docs.dify.ai/features/extension/api_based_extension', + add: 'Dodaj API razširitev', + selector: { + title: 'API razširitev', + placeholder: 'Prosimo, izberite API razširitev', + manage: 'Upravljaj API razširitev', + }, + modal: { + title: 'Dodaj API razširitev', + editTitle: 'Uredi API razširitev', + name: { + title: 'Ime', + placeholder: 'Vnesite ime', + }, + apiEndpoint: { + title: 'API konec', + placeholder: 'Vnesite API konec', + }, + apiKey: { + title: 'API ključ', + placeholder: 'Vnesite API ključ', + lengthError: 'Dolžina API ključa ne sme biti manjša od 5 znakov', + }, + }, + type: 'Tip', + }, + about: { + changeLog: 'Dnevnik sprememb', + updateNow: 'Posodobi zdaj', + nowAvailable: 'Dify {{version}} je zdaj na voljo.', + latestAvailable: 'Dify {{version}} je najnovejša različica na voljo.', + }, + appMenus: { + overview: 'Nadzor', + promptEng: 'Orkestriraj', + apiAccess: 'Dostop API', + logAndAnn: 'Dnevniki in objave', + logs: 'Dnevniki', + }, + environment: { + testing: 'TESTIRANJE', + development: 'RAZVOJ', + }, + appModes: { + completionApp: 'Generator besedila', + chatApp: 'Klepetalna aplikacija', + }, + datasetMenus: { + documents: 'Dokumenti', + hitTesting: 'Preizkušanje pridobivanja', + settings: 'Nastavitve', + emptyTip: 'Znanost še ni povezana, pojdite v aplikacijo ali vtičnik, da dokončate povezavo.', + viewDoc: 'Ogled dokumentacije', + relatedApp: 'povezane aplikacije', + }, + voiceInput: { + speaking: 'Govorite zdaj...', + converting: 'Pretvarjanje v besedilo...', + notAllow: 'mikrofon ni pooblaščen', + }, + modelName: { + 'gpt-3.5-turbo': 'GPT-3.5-Turbo', + 'gpt-3.5-turbo-16k': 'GPT-3.5-Turbo-16K', + 'gpt-4': 'GPT-4', + 'gpt-4-32k': 'GPT-4-32K', + 'text-davinci-003': 'Text-Davinci-003', + 'text-embedding-ada-002': 'Text-Embedding-Ada-002', + 'whisper-1': 'Whisper-1', + 'claude-instant-1': 'Claude-Instant', + 'claude-2': 'Claude-2', + }, + chat: { + renameConversation: 'Preimenuj pogovor', + conversationName: 'Ime pogovora', + conversationNamePlaceholder: 'Vnesite ime pogovora', + conversationNameCanNotEmpty: 'Ime pogovora je obvezno', + citation: { + title: 'CITATI', + linkToDataset: 'Povezava do znanja', + characters: 'Znakov:', + hitCount: 'Število zadetkov:', + vectorHash: 'Vektorski hash:', + hitScore: 'Ocena zadetka:', + }, + }, + promptEditor: { + placeholder: 'Tukaj napišite svoje pozivno besedilo, vnesite \'{\' za vstavljanje spremenljivke, vnesite \'/\' za vstavljanje vsebinskega bloka poziva', + context: { + item: { + title: 'Kontekst', + desc: 'Vstavi predlogo konteksta', + }, + modal: { + title: '{{num}} Znanost v kontekstu', + add: 'Dodaj kontekst ', + footer: 'Kontekste lahko upravljate v spodnjem razdelku Kontekst.', + }, + }, + history: { + item: { + title: 'Zgodovina pogovora', + desc: 'Vstavi predlogo zgodovinskega sporočila', + }, + modal: { + title: 'PRIMER', + user: 'Pozdravljeni', + assistant: 'Pozdravljeni! Kako vam lahko pomagam danes?', + edit: 'Uredi imena vlog pogovora', + }, + }, + variable: { + item: { + title: 'Spremenljivke in zunanji orodja', + desc: 'Vstavi spremenljivke in zunanja orodja', + }, + outputToolDisabledItem: { + title: 'Spremenljivke', + desc: 'Vstavi spremenljivke', + }, + modal: { + add: 'Nova spremenljivka', + addTool: 'Novo orodje', + }, + }, + query: { + item: { + title: 'Poizvedba', + desc: 'Vstavi predlogo uporabniške poizvedbe', + }, + }, + existed: 'Že obstaja v pozivu', + }, + imageUploader: { + uploadFromComputer: 'Naloži iz računalnika', + uploadFromComputerReadError: 'Branje slike ni uspelo, poskusite znova.', + uploadFromComputerUploadError: 'Nalaganje slike ni uspelo, poskusite znova.', + uploadFromComputerLimit: 'Nalaganje slik ne sme presegati {{size}} MB', + pasteImageLink: 'Prilepi povezavo do slike', + pasteImageLinkInputPlaceholder: 'Tukaj prilepite povezavo do slike', + pasteImageLinkInvalid: 'Neveljavna povezava slike', + imageUpload: 'Nalaganje slike', + }, + tag: { + placeholder: 'Vse oznake', + addNew: 'Dodaj novo oznako', + noTag: 'Ni oznak', + noTagYet: 'Še ni oznak', + addTag: 'Dodaj oznake', + editTag: 'Uredi oznake', + manageTags: 'Upravljaj oznake', + selectorPlaceholder: 'Vnesite za iskanje ali ustvarjanje', + create: 'Ustvari', + delete: 'Izbriši oznako', + deleteTip: 'Oznaka se uporablja, jo želite izbrisati?', + created: 'Oznaka uspešno ustvarjena', + failed: 'Ustvarjanje oznake ni uspelo', + }, + }, + dataSource: { + notion: { + selector: { + pageSelected: 'Izbrane strani', + addPages: 'Dodajanje strani', + searchPages: 'Iskanje strani ...', + noSearchResult: 'Ni rezultatov iskanja', + preview: 'PREDOGLED', + }, + connected: 'Povezani', + remove: 'Odstrani', + addWorkspace: 'Dodajanje delovnega prostora', + connectedWorkspace: 'Povezani delovni prostor', + description: 'Uporaba pojma kot vira podatkov za znanje.', + disconnected: 'Odklopi', + pagesAuthorized: 'Dovoljene strani', + title: 'Pojem', + changeAuthorizedPages: 'Spreminjanje pooblaščenih strani', + sync: 'Sinhroniziranje', + }, + website: { + active: 'Dejaven', + configuredCrawlers: 'Konfigurirani pajki', + title: 'Spletna stran', + inactive: 'Neaktiven', + description: 'Uvozite vsebino s spletnih mest s spletnim pajkom.', + with: 'S', + }, + add: 'Dodajanje vira podatkov', + connect: 'Povezati', + configure: 'Konfigurirati', + }, + plugin: { + serpapi: { + apiKeyPlaceholder: 'Vnesite ključ API', + apiKey: 'API ključ', + keyFrom: 'Pridobite svoj ključ SerpAPI na strani računa SerpAPI', + }, + }, + apiBasedExtension: { + selector: { + placeholder: 'Prosimo, izberite razširitev API-ja', + manage: 'Upravljanje razširitve API', + title: 'Razširitev API-ja', + }, + modal: { + name: { + placeholder: 'Prosimo, vnesite ime', + title: 'Ime', + }, + apiEndpoint: { + title: 'Končna točka API-ja', + placeholder: 'Prosimo, vnesite končno točko API-ja', + }, + apiKey: { + lengthError: 'Dolžina ključa API ne sme biti manjša od 5 znakov', + title: 'Ključ API-ja', + placeholder: 'Prosimo, vnesite API-ključ', + }, + editTitle: 'Uredi razširitev API-ja', + title: 'Dodajanje razširitve API-ja', + }, + type: 'Vrsta', + link: 'Preberite, kako razvijete lastno razširitev API-ja.', + title: 'Razširitve API zagotavljajo centralizirano upravljanje API, kar poenostavlja konfiguracijo za enostavno uporabo v aplikacijah Dify.', + linkUrl: 'https://docs.dify.ai/features/extension/api_based_extension', + add: 'Dodajanje razširitve API-ja', + }, + about: { + updateNow: 'Posodobi zdaj', + nowAvailable: 'Dify {{version}} je zdaj na voljo.', + latestAvailable: 'Dify {{version}} je najnovejša različica, ki je na voljo.', + changeLog: 'Dnevnik sprememb', + }, + appMenus: { + apiAccess: 'Dostop do API-ja', + logs: 'Dnevniki', + logAndAnn: 'Dnevniki & Ann.', + promptEng: 'Orkester', + overview: 'Spremljanje', + }, + environment: { + development: 'RAZVOJ', + testing: 'PREIZKUŠANJE', + }, + appModes: { + completionApp: 'Generator besedila', + chatApp: 'Aplikacija za klepet', + }, + datasetMenus: { + documents: 'Dokumentov', + settings: 'Nastavitve', + hitTesting: 'Testiranje pridobivanja', + emptyTip: 'Znanje ni bilo povezano, prosimo, pojdite na aplikacijo ali vtičnik, da dokončate združenje.', + viewDoc: 'Oglejte si dokumentacijo', + relatedApp: 'Povezane aplikacije', + }, + voiceInput: { + notAllow: 'Mikrofon ni pooblaščen', + speaking: 'Spregovorite zdaj ...', + converting: 'Pretvorba v besedilo ...', + }, + modelName: { + 'claude-2': 'Claude-2', + 'gpt-4-32k': 'GPT-4-32K', + 'text-embedding-ada-002': 'Vdelava besedila-Ada-002', + 'gpt-4': 'GPT-4', + 'whisper-1': 'Šepet-1', + 'claude-instant-1': 'Claude-Instant', + 'text-davinci-003': 'Besedilo-Davinci-003', + 'gpt-3.5-turbo-16k': 'GPT-3.5-Turbo-16K', + 'gpt-3.5-turbo': 'GPT-3.5-Turbo', + }, + chat: { + citation: { + vectorHash: 'Vektorska razpršitev:', + hitScore: 'Rezultat pridobivanja:', + linkToDataset: 'Povezava do znanja', + hitCount: 'Število pridobivanja:', + characters: 'Znakov:', + title: 'CITATI', + }, + conversationNameCanNotEmpty: 'Zahtevano ime pogovora', + inputPlaceholder: 'Pogovorite se z botom', + renameConversation: 'Preimenovanje pogovora', + conversationName: 'Ime pogovora', + conversationNamePlaceholder: 'Prosimo, vnesite ime pogovora', + }, + promptEditor: { + context: { + item: { + desc: 'Vstavljanje predloge konteksta', + title: 'Kontekstu', + }, + modal: { + footer: 'Kontekste lahko upravljate v spodnjem razdelku Kontekst.', + title: '{{num}} Znanje v kontekstu', + add: 'Dodajanje konteksta', + }, + }, + history: { + item: { + desc: 'Vstavljanje predloge zgodovinskega sporočila', + title: 'Zgodovina pogovorov', + }, + modal: { + title: 'PRIMER', + edit: 'Urejanje imen vlog v pogovoru', + assistant: 'Zdravo! Kako vam lahko pomagam danes?', + user: 'Zdravo', + }, + }, + variable: { + item: { + desc: 'Vstavljanje spremenljivk in zunanjih orodij', + title: 'Spremenljivke in zunanja orodja', + }, + outputToolDisabledItem: { + title: 'Spremenljivke', + desc: 'Vstavljanje spremenljivk', + }, + modal: { + addTool: 'Novo orodje', + add: 'Nova spremenljivka', + }, + }, + query: { + item: { + title: 'Poizvedba', + desc: 'Vstavljanje predloge uporabniške poizvedbe', + }, + }, + existed: 'Že obstaja v pozivu', + placeholder: 'Tukaj vnesite svojo pozivno besedo, vnesite \'{\' za vstavljanje spremenljivke, vnesite \'/\', da vstavite blok vsebine', + }, + imageUploader: { + pasteImageLinkInvalid: 'Neveljavna povezava do slike', + uploadFromComputerLimit: 'Nalaganje slik ne sme presegati {{size}} MB', + uploadFromComputerUploadError: 'Nalaganje slike ni uspelo, naložite ga znova.', + pasteImageLink: 'Prilepi povezavo do slike', + imageUpload: 'Nalaganje slik', + uploadFromComputer: 'Naloži iz računalnika', + pasteImageLinkInputPlaceholder: 'Tukaj prilepi povezavo do slike', + uploadFromComputerReadError: 'Branje slik ni uspelo, poskusite znova.', + }, + fileUploader: { + fileExtensionNotSupport: 'Datotečna pripona ni podprta', + pasteFileLinkInvalid: 'Neveljavna povezava do datoteke', + pasteFileLink: 'Prilepi povezavo do datoteke', + pasteFileLinkInputPlaceholder: 'Vnesite URL ...', + uploadFromComputerUploadError: 'Nalaganje datoteke ni uspelo, naložite ga znova.', + uploadFromComputer: 'Lokalno nalaganje', + uploadFromComputerLimit: 'Nalaganje {{type}} ne sme presegati {{size}}', + uploadFromComputerReadError: 'Branje datoteke ni uspelo, poskusite znova.', + }, + tag: { + addTag: 'Dodajanje oznak', + delete: 'Brisanje oznake', + manageTags: 'Upravljanje oznak', + addNew: 'Dodajanje nove oznake', + placeholder: 'Vse oznake', + failed: 'Ustvarjanje oznake ni uspelo', + editTag: 'Urejanje oznak', + created: 'Oznaka je bila uspešno ustvarjena', + noTagYet: 'Še ni oznak', + create: 'Ustvariti', + deleteTip: 'Oznaka se uporablja, jo izbrišite?', + noTag: 'Brez oznak', + selectorPlaceholder: 'Vnesite za iskanje ali ustvarjanje', + }, + license: { + expiring_plural: 'Poteče v {{count}} dneh', + expiring: 'Poteče v enem dnevu', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/custom.ts b/web/i18n/sl-SI/custom.ts new file mode 100644 index 00000000000000..6c2f3f4f936583 --- /dev/null +++ b/web/i18n/sl-SI/custom.ts @@ -0,0 +1,30 @@ +const translation = { + custom: 'Prilagoditev', + upgradeTip: { + prefix: 'Nadgradite svoj načrt za', + suffix: 'prilagoditev vaše blagovne znamke.', + }, + webapp: { + title: 'Prilagodi blagovno znamko spletne aplikacije', + removeBrand: 'Odstrani Powered by Dify', + changeLogo: 'Spremeni sliko Powered by Brand', + changeLogoTip: 'Format SVG ali PNG z minimalno velikostjo 40x40px', + }, + app: { + title: 'Prilagodi blagovno znamko glave aplikacije', + changeLogoTip: 'Format SVG ali PNG z minimalno velikostjo 80x80px', + }, + upload: 'Naloži', + uploading: 'Nalagam', + uploadedFail: 'Nalaganje slike ni uspelo, prosimo, poskusite znova.', + change: 'Spremeni', + apply: 'Uporabi', + restore: 'Obnovi privzete nastavitve', + customize: { + contactUs: ' kontaktirajte nas ', + prefix: 'Za prilagoditev logotipa blagovne znamke znotraj aplikacije, prosimo,', + suffix: 'za nadgradnjo na Enterprise izdajo.', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/dataset-creation.ts b/web/i18n/sl-SI/dataset-creation.ts new file mode 100644 index 00000000000000..402066ad409f82 --- /dev/null +++ b/web/i18n/sl-SI/dataset-creation.ts @@ -0,0 +1,176 @@ +const translation = { + steps: { + header: { + creation: 'Ustvari Znanje', + update: 'Dodaj podatke', + }, + one: 'Izberi vir podatkov', + two: 'Predobdelava in čiščenje besedila', + three: 'Izvedi in zaključi', + }, + error: { + unavailable: 'To Znanje ni na voljo', + }, + firecrawl: { + configFirecrawl: 'Nastavi 🔥Firecrawl', + apiKeyPlaceholder: 'API ključ od firecrawl.dev', + getApiKeyLinkText: 'Pridobi API ključ na firecrawl.dev', + }, + jinaReader: { + configJinaReader: 'Nastavi Jina Reader', + apiKeyPlaceholder: 'API ključ od jina.ai', + getApiKeyLinkText: 'Pridobi brezplačni API ključ na jina.ai', + }, + stepOne: { + filePreview: 'Predogled datoteke', + pagePreview: 'Predogled strani', + dataSourceType: { + file: 'Uvozi iz datoteke', + notion: 'Sinhroniziraj z Notion', + web: 'Sinhroniziraj s spletno stranjo', + }, + uploader: { + title: 'Naloži datoteko', + button: 'Povleci in spusti datoteko ali', + browse: 'Prebrskaj', + tip: 'Podprti tipi datotek: {{supportTypes}}. Največ {{size}}MB na datoteko.', + validation: { + typeError: 'Tip datoteke ni podprt', + size: 'Datoteka je prevelika. Največja dovoljena velikost je {{size}}MB', + count: 'Podprta je le ena datoteka', + filesNumber: 'Dosegli ste omejitev za pošiljanje {{filesNumber}} datotek.', + }, + cancel: 'Prekliči', + change: 'Zamenjaj', + failed: 'Nalaganje ni uspelo', + }, + notionSyncTitle: 'Notion ni povezan', + notionSyncTip: 'Za sinhronizacijo z Notion je najprej potrebno vzpostaviti povezavo.', + connect: 'Pojdi na povezavo', + button: 'Naprej', + emptyDatasetCreation: 'Želim ustvariti prazno Znanje', + modal: { + title: 'Ustvari prazno Znanje', + tip: 'Prazno Znanje ne bo vsebovalo dokumentov, dokumente pa lahko naložite kadarkoli.', + input: 'Ime Znanja', + placeholder: 'Vnesite ime', + nameNotEmpty: 'Ime ne sme biti prazno', + nameLengthInvalid: 'Ime mora imeti od 1 do 40 znakov', + cancelButton: 'Prekliči', + confirmButton: 'Ustvari', + failed: 'Ustvarjanje ni uspelo', + }, + website: { + chooseProvider: 'Izberi ponudnika', + fireCrawlNotConfigured: 'Firecrawl ni nastavljen', + fireCrawlNotConfiguredDescription: 'Nastavite Firecrawl z API ključem, da ga lahko uporabite.', + jinaReaderNotConfigured: 'Jina Reader ni nastavljen', + jinaReaderNotConfiguredDescription: 'Nastavite Jina Reader z vnosom brezplačnega API ključa.', + configure: 'Nastavi', + run: 'Zaženi', + firecrawlTitle: 'Izvleci spletno vsebino z 🔥Firecrawl', + firecrawlDoc: 'Firecrawl dokumentacija', + firecrawlDocLink: 'https://docs.dify.ai/guides/knowledge-base/sync-from-website', + jinaReaderTitle: 'Pretvori celotno stran v Markdown', + jinaReaderDoc: 'Več o Jina Reader', + jinaReaderDocLink: 'https://jina.ai/reader', + useSitemap: 'Uporabi sitemap', + useSitemapTooltip: 'Sledi zemljevidu spletne strani (sitemap) za iskanje strani. Če ne, bo Jina Reader iterativno iskal strani na podlagi pomembnosti, kar bo prineslo manj, a bolj relevantnih strani.', + options: 'Možnosti', + crawlSubPage: 'Išči podstrani', + limit: 'Omejitev', + maxDepth: 'Največja globina', + excludePaths: 'Izključi poti', + includeOnlyPaths: 'Vključi le poti', + extractOnlyMainContent: 'Izvleci le glavno vsebino (brez glav, navigacij, nog itd.)', + exceptionErrorTitle: 'Med izvajanjem iskanja je prišlo do izjeme:', + unknownError: 'Neznana napaka', + totalPageScraped: 'Skupaj preiskanih strani:', + selectAll: 'Izberi vse', + resetAll: 'Ponastavi vse', + scrapTimeInfo: 'Skupaj preiskanih {{total}} strani v {{time}}s', + preview: 'Predogled', + maxDepthTooltip: 'Največja globina iskanja glede na vneseni URL. Globina 0 bo iskala le stran z vnesenim URL-jem, globina 1 bo iskala URL in vse za tem, dodano z enim /, in tako naprej.', + }, + }, + stepTwo: { + segmentation: 'Nastavitve razdeljevanja', + auto: 'Samodejno', + autoDescription: 'Samodejno nastavi pravila za razdeljevanje in predobdelavo besedila. Neizkušenim uporabnikom priporočamo to možnost.', + custom: 'Po meri', + customDescription: 'Prilagodi pravila za razdeljevanje, dolžino delcev in pravila za predobdelavo besedila itd.', + separator: 'Ločilo', + separatorTip: 'Ločilo je znak, ki se uporablja za ločevanje besedila. \\n\\n in \\n sta pogosto uporabljeni ločili za ločevanje odstavkov in vrstic. V kombinaciji z vejicami (\\n\\n,\\n) bodo odstavki razdeljeni po vrsticah, ko bo presežena največja dolžina delcev. Uporabite lahko tudi posebna ločila, ki jih sami določite (npr. ***).', + separatorPlaceholder: '\\n\\n za ločevanje odstavkov; \\n za ločevanje vrstic', + maxLength: 'Največja dolžina delca', + overlap: 'Prekrivanje delcev', + overlapTip: 'Nastavitev prekrivanja delcev lahko ohrani semantično povezavo med njimi, kar izboljša učinkovitost iskanja. Priporočamo nastavitev 10%-25% največje dolžine delca.', + overlapCheck: 'Prekrivanje delca ne sme biti večje od največje dolžine delca', + rules: 'Pravila predobdelave besedila', + removeExtraSpaces: 'Zamenjaj zaporedne presledke, vrstice in zavihke', + removeUrlEmails: 'Izbriši vse URL-je in e-poštne naslove', + removeStopwords: 'Odstrani neuporabne besede kot so "a", "an", "the"', + preview: 'Potrdi in predogled', + reset: 'Ponastavi', + indexMode: 'Način indeksiranja', + qualified: 'Visoka kakovost', + recommend: 'Priporočeno', + qualifiedTip: 'Za obdelavo se uporabi privzeti sistemski vmesnik za vdelavo, ki zagotavlja višjo natančnost pri poizvedbah uporabnikov.', + warning: 'Najprej nastavite API ključ za model ponudnika.', + click: 'Pojdi na nastavitve', + economical: 'Ekonomsko', + economicalTip: 'Uporablja lokalne vektorske pogone, ključne besede, itd., kar zmanjša natančnost brez porabe žetonov.', + QATitle: 'Razdeljevanje v obliki Vprašanje & Odgovor', + QATip: 'Omogočanje te možnosti bo porabilo več žetonov', + QALanguage: 'Razdelitev z uporabo', + estimateCost: 'Ocena stroškov', + estimateSegment: 'Ocenjeno število delcev', + segmentCount: 'delci', + calculating: 'Izračunavam...', + fileSource: 'Predobdelava dokumentov', + notionSource: 'Predobdelava strani', + websiteSource: 'Predobdelava spletne strani', + other: 'in drugi ', + fileUnit: ' dokumenti', + notionUnit: ' strani', + webpageUnit: ' strani', + previousStep: 'Prejšnji korak', + nextStep: 'Shrani in obdela', + save: 'Shrani in obdela', + cancel: 'Prekliči', + sideTipTitle: 'Zakaj razdeljevanje in predobdelava?', + sideTipP1: 'Pri obdelavi besedilnih podatkov sta razdeljevanje in čiščenje dve pomembni fazi predobdelave.', + sideTipP2: 'Razdeljevanje dolga besedila na odstavke omogoča modelom boljše razumevanje. To izboljša kakovost in relevantnost rezultatov modela.', + sideTipP3: 'Čiščenje odstranjuje nepotrebne znake in formate, kar Znanje naredi bolj čisto in lažje obdeljivo.', + sideTipP4: 'Pravilno razdeljevanje in čiščenje izboljšata delovanje modela, kar zagotavlja bolj natančne in dragocene rezultate.', + previewTitle: 'Predogled', + previewTitleButton: 'Predogled', + previewButton: 'Preklop v obliko Vprašanje & Odgovor', + previewSwitchTipStart: 'Trenutni predogled delcev je v obliki besedila, preklop na predogled v obliki vprašanj in odgovorov bo', + previewSwitchTipEnd: ' porabil dodatne žetone', + characters: 'znaki', + indexSettingTip: 'Če želite spremeniti način indeksiranja in model vdelave, pojdite na ', + retrievalSettingTip: 'Če želite spremeniti nastavitve iskanja, pojdite na ', + datasetSettingLink: 'nastavitve Znanja.', + maxLengthCheck: 'Največja dolžina kosa mora biti manjša od 4000', + }, + stepThree: { + creationTitle: '🎉 Znanje ustvarjeno', + creationContent: 'Samodejno smo poimenovali Znanje, ime lahko kadarkoli spremenite.', + label: 'Ime Znanja', + additionTitle: '🎉 Dokument naložen', + additionP1: 'Dokument je bil naložen v Znanje', + additionP2: ', lahko ga najdete v seznamu dokumentov Znanja.', + stop: 'Ustavi obdelavo', + resume: 'Nadaljuj obdelavo', + navTo: 'Pojdi na dokument', + sideTipTitle: 'Kaj sledi', + sideTipContent: 'Ko je dokument končan z indeksiranjem, lahko Znanje vključite v aplikacijo kot kontekst, nastavitve konteksta najdete na strani za orkestracijo ukazov. Prav tako ga lahko ustvarite kot samostojni vtičnik za indeksiranje ChatGPT in ga izdate.', + modelTitle: 'Ali ste prepričani, da želite ustaviti vdelavo?', + modelContent: 'Če boste morali nadaljevati obdelavo kasneje, se bo ta nadaljevala tam, kjer ste končali.', + modelButtonConfirm: 'Potrdi', + modelButtonCancel: 'Prekliči', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/dataset-documents.ts b/web/i18n/sl-SI/dataset-documents.ts new file mode 100644 index 00000000000000..0ca8be9e95b8ee --- /dev/null +++ b/web/i18n/sl-SI/dataset-documents.ts @@ -0,0 +1,352 @@ +const translation = { + list: { + title: 'Dokumenti', + desc: 'Vse datoteke znanja so prikazane tukaj, celotno znanje pa je mogoče povezati s citati Dify ali indeksirati prek vtičnika Chat.', + addFile: 'Dodaj datoteko', + addPages: 'Dodaj strani', + addUrl: 'Dodaj URL', + table: { + header: { + fileName: 'IME DATOTEKE', + words: 'BESEDE', + hitCount: 'ŠTEVILO PRIDOBITEV', + uploadTime: 'ČAS NALAGANJA', + status: 'STATUS', + action: 'DEJANJE', + }, + rename: 'Preimenuj', + name: 'Ime', + }, + action: { + uploadFile: 'Naloži novo datoteko', + settings: 'Nastavitve segmenta', + addButton: 'Dodaj del', + add: 'Dodaj del', + batchAdd: 'Serijsko dodajanje', + archive: 'Arhiviraj', + unarchive: 'Razveljavi arhiviranje', + delete: 'Izbriši', + enableWarning: 'Arhivirane datoteke ni mogoče omogočiti', + sync: 'Sinhroniziraj', + }, + index: { + enable: 'Omogoči', + disable: 'Onemogoči', + all: 'Vse', + enableTip: 'Datoteka je lahko indeksirana', + disableTip: 'Datoteka ne more biti indeksirana', + }, + status: { + queuing: 'V čakalni vrsti', + indexing: 'Indeksiranje', + paused: 'Zaustavljeno', + error: 'Napaka', + available: 'Na voljo', + enabled: 'Omogočeno', + disabled: 'Onemogočeno', + archived: 'Arhivirano', + }, + empty: { + title: 'Dokumentacije še ni', + upload: { + tip: 'Lahko naložite datoteke, sinhronizirate z spletno stranjo ali aplikacijami, kot so Notion, GitHub itd.', + }, + sync: { + tip: 'Dify bo občasno prenesel datoteke iz Notion in dokončal obdelavo.', + }, + }, + delete: { + title: 'Ali ste prepričani, da želite izbrisati?', + content: 'Če boste nadaljevali obdelavo kasneje, boste nadaljevali tam, kjer ste končali.', + }, + batchModal: { + title: 'Serijsko dodajanje delov', + csvUploadTitle: 'Povlecite in spustite svojo CSV datoteko tukaj ali ', + browse: 'brskajte', + tip: 'CSV datoteka mora ustrezati naslednji strukturi:', + question: 'vprašanje', + answer: 'odgovor', + contentTitle: 'vsebina dela', + content: 'vsebina', + template: 'Prenesite predlogo tukaj', + cancel: 'Prekliči', + run: 'Zaženi serijo', + runError: 'Serijsko dodajanje ni uspelo', + processing: 'V obdelavi serije', + completed: 'Uvoz zaključen', + error: 'Napaka pri uvozu', + ok: 'V redu', + }, + }, + metadata: { + title: 'Metapodatki', + desc: 'Označevanje metapodatkov za dokumente omogoča, da AI pravočasno dostopa do njih in prikaže vir referenc uporabnikom.', + dateTimeFormat: 'MMMM D, YYYY hh:mm A', + docTypeSelectTitle: 'Izberite vrsto dokumenta', + docTypeChangeTitle: 'Spremeni vrsto dokumenta', + docTypeSelectWarning: + 'Če se vrsta dokumenta spremeni, trenutni vneseni metapodatki ne bodo ohranjeni', + firstMetaAction: 'Začni', + placeholder: { + add: 'Dodaj ', + select: 'Izberi ', + }, + source: { + upload_file: 'Naloži datoteko', + notion: 'Sinhroniziraj iz Notion', + github: 'Sinhroniziraj iz Github', + }, + type: { + book: 'Knjiga', + webPage: 'Spletna stran', + paper: 'Znanstveni članek', + socialMediaPost: 'Objava na družbenih omrežjih', + personalDocument: 'Osebni dokument', + businessDocument: 'Poslovni dokument', + IMChat: 'Klepet', + wikipediaEntry: 'Vnos iz Wikipedije', + notion: 'Sinhroniziraj iz Notion', + github: 'Sinhroniziraj iz Github', + technicalParameters: 'Tehnični parametri', + }, + field: { + processRule: { + processDoc: 'Obdelaj dokument', + segmentRule: 'Pravilo segmenta', + segmentLength: 'Dolžina segmentov', + processClean: 'Čiščenje besedila', + }, + book: { + title: 'Naslov', + language: 'Jezik', + author: 'Avtor', + publisher: 'Založnik', + publicationDate: 'Datum objave', + ISBN: 'ISBN', + category: 'Kategorija', + }, + webPage: { + title: 'Naslov', + url: 'URL', + language: 'Jezik', + authorPublisher: 'Avtor/Založnik', + publishDate: 'Datum objave', + topicsKeywords: 'Teme/Ključne besede', + description: 'Opis', + }, + paper: { + title: 'Naslov', + language: 'Jezik', + author: 'Avtor', + publishDate: 'Datum objave', + journalConferenceName: 'Ime revije/konference', + volumeIssuePage: 'Letnik/Številka/Stran', + DOI: 'DOI', + topicsKeywords: 'Teme/Ključne besede', + abstract: 'Povzetek', + }, + socialMediaPost: { + platform: 'Platforma', + authorUsername: 'Avtor/Uporabniško ime', + publishDate: 'Datum objave', + postURL: 'URL objave', + topicsTags: 'Teme/Oznake', + }, + personalDocument: { + title: 'Naslov', + author: 'Avtor', + creationDate: 'Datum nastanka', + lastModifiedDate: 'Datum zadnje spremembe', + documentType: 'Vrsta dokumenta', + tagsCategory: 'Oznake/Kategorija', + }, + businessDocument: { + title: 'Naslov', + author: 'Avtor', + creationDate: 'Datum nastanka', + lastModifiedDate: 'Datum zadnje spremembe', + documentType: 'Vrsta dokumenta', + departmentTeam: 'Oddelek/Ekipa', + }, + IMChat: { + chatPlatform: 'Platforma za klepet', + chatPartiesGroupName: 'Udeleženci klepeta/Skupina', + participants: 'Udeleženci', + startDate: 'Datum začetka', + endDate: 'Datum konca', + topicsKeywords: 'Teme/Ključne besede', + fileType: 'Vrsta datoteke', + }, + wikipediaEntry: { + title: 'Naslov', + language: 'Jezik', + webpageURL: 'URL spletne strani', + editorContributor: 'Urednik/Sodelavec', + lastEditDate: 'Datum zadnje spremembe', + summaryIntroduction: 'Povzetek/Uvod', + }, + notion: { + title: 'Naslov', + language: 'Jezik', + author: 'Avtor', + createdTime: 'Čas nastanka', + lastModifiedTime: 'Čas zadnje spremembe', + url: 'URL', + tag: 'Oznaka', + description: 'Opis', + }, + github: { + repoName: 'Ime repozitorija', + repoDesc: 'Opis repozitorija', + repoOwner: 'Lastnik repozitorija', + fileName: 'Ime datoteke', + filePath: 'Pot do datoteke', + programmingLang: 'Programski jezik', + url: 'URL', + license: 'Licenca', + lastCommitTime: 'Čas zadnje spremembe', + lastCommitAuthor: 'Avtor zadnje spremembe', + }, + originInfo: { + originalFilename: 'Izvirno ime datoteke', + originalFileSize: 'Izvirna velikost datoteke', + uploadDate: 'Datum nalaganja', + lastUpdateDate: 'Datum zadnje spremembe', + source: 'Vir', + }, + technicalParameters: { + segmentSpecification: 'Specifikacija segmentov', + segmentLength: 'Dolžina segmentov', + avgParagraphLength: 'Povprečna dolžina odstavka', + paragraphs: 'Odstavki', + hitCount: 'Število pridobitev', + embeddingTime: 'Čas vdelave', + embeddedSpend: 'Stroški vdelave', + }, + }, + languageMap: { + zh: 'Kitajščina', + en: 'Angleščina', + es: 'Španščina', + fr: 'Francoščina', + de: 'Nemščina', + ja: 'Japonščina', + ko: 'Korejščina', + ru: 'Ruščina', + ar: 'Arabščina', + pt: 'Portugalščina', + it: 'Italijanščina', + nl: 'Nizozemščina', + pl: 'Poljščina', + sv: 'Švedščina', + tr: 'Turščina', + he: 'Hebrejščina', + hi: 'Hindujščina', + da: 'Danščina', + fi: 'Finščina', + no: 'Norveščina', + hu: 'Madžarščina', + el: 'Grščina', + cs: 'Češčina', + th: 'Tajščina', + id: 'Indonezijščina', + }, + categoryMap: { + book: { + fiction: 'Leposlovje', + biography: 'Biografija', + history: 'Zgodovina', + science: 'Znanost', + technology: 'Tehnologija', + education: 'Izobraževanje', + philosophy: 'Filozofija', + religion: 'Religija', + socialSciences: 'Družboslovje', + art: 'Umetnost', + travel: 'Potovanja', + health: 'Zdravje', + selfHelp: 'Samopomoč', + businessEconomics: 'Poslovanje in ekonomija', + cooking: 'Kuhanje', + childrenYoungAdults: 'Otroci in mladi odrasli', + comicsGraphicNovels: 'Stripi in grafični romani', + poetry: 'Poezija', + drama: 'Drama', + other: 'Drugo', + }, + personalDoc: { + notes: 'Zapiski', + blogDraft: 'Osnutek bloga', + diary: 'Dnevnik', + researchReport: 'Raziskovalno poročilo', + bookExcerpt: 'Odlomek iz knjige', + schedule: 'Urnik', + list: 'Seznam', + projectOverview: 'Pregled projekta', + photoCollection: 'Fotografska zbirka', + creativeWriting: 'Ustvarjalno pisanje', + codeSnippet: 'Koda', + designDraft: 'Oblikovalski osnutek', + personalResume: 'Osebni življenjepis', + other: 'Drugo', + }, + businessDoc: { + meetingMinutes: 'Zapisniki sestankov', + researchReport: 'Raziskovalno poročilo', + proposal: 'Predlog', + employeeHandbook: 'Priročnik za zaposlene', + trainingMaterials: 'Izobraževalni materiali', + requirementsDocument: 'Dokumentacija zahtev', + designDocument: 'Oblikovalska dokumentacija', + productSpecification: 'Specifikacija izdelka', + financialReport: 'Finančno poročilo', + marketAnalysis: 'Tržna analiza', + projectPlan: 'Načrt projekta', + teamStructure: 'Struktura ekipe', + policiesProcedures: 'Pravila in postopki', + contractsAgreements: 'Pogodbe in dogovori', + emailCorrespondence: 'E-poštna korespondenca', + other: 'Drugo', + }, + }, + }, + embedding: { + processing: 'Proces vdelave...', + paused: 'Vdelava zaustavljena', + completed: 'Vdelava zaključena', + error: 'Napaka pri vdelavi', + docName: 'Predobdelava dokumenta', + mode: 'Pravilo segmentacije', + segmentLength: 'Dolžina segmentov', + textCleaning: 'Predobdelava in čiščenje besedila', + segments: 'Odstavki', + highQuality: 'Način visoke kakovosti', + economy: 'Ekonomski način', + estimate: 'Ocenjena poraba', + stop: 'Ustavi obdelavo', + resume: 'Nadaljuj obdelavo', + automatic: 'Samodejno', + custom: 'Po meri', + previewTip: 'Predogled odstavkov bo na voljo po zaključku vdelave', + }, + segment: { + paragraphs: 'Odstavki', + keywords: 'Ključne besede', + addKeyWord: 'Dodaj ključno besedo', + keywordError: 'Največja dolžina ključne besede je 20', + characters: 'znakov', + hitCount: 'Število pridobitev', + vectorHash: 'Vektorski hash: ', + questionPlaceholder: 'dodajte vprašanje tukaj', + questionEmpty: 'Vprašanje ne sme biti prazno', + answerPlaceholder: 'dodajte odgovor tukaj', + answerEmpty: 'Odgovor ne sme biti prazen', + contentPlaceholder: 'dodajte vsebino tukaj', + contentEmpty: 'Vsebina ne sme biti prazna', + newTextSegment: 'Nov besedilni segment', + newQaSegment: 'Nov Q&A segment', + delete: 'Izbriši ta del?', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/dataset-hit-testing.ts b/web/i18n/sl-SI/dataset-hit-testing.ts new file mode 100644 index 00000000000000..5f5f895d6ef3a7 --- /dev/null +++ b/web/i18n/sl-SI/dataset-hit-testing.ts @@ -0,0 +1,30 @@ +const translation = { + title: 'Testiranje pridobivanja', + settingTitle: 'Nastavitve pridobivanja', + desc: 'Preizkusite učinkovitost zadetkov znanja na podlagi podanega poizvedbenega besedila', + dateTimeFormat: 'DD/MM/YYYY hh:mm A', + recents: 'Nedavno', + table: { + header: { + source: 'Vir', + text: 'Besedilo', + time: 'Čas', + }, + }, + input: { + title: 'Izvorno besedilo', + placeholder: 'Prosimo, vnesite besedilo, priporočljivo je kratko izjavno poved.', + countWarning: 'Do 200 znakov.', + indexWarning: 'Samo znanje visoke kakovosti.', + testing: 'Testiranje', + }, + hit: { + title: 'PRIDOBLJENI ODSTAVKI', + emptyTip: 'Rezultati testiranja pridobivanja bodo prikazani tukaj', + }, + noRecentTip: 'Tukaj ni nedavnih rezultatov poizvedb', + viewChart: 'Prikaži VEKTORSKI GRAF', + viewDetail: 'Prikaži podrobnosti', +} + +export default translation diff --git a/web/i18n/sl-SI/dataset-settings.ts b/web/i18n/sl-SI/dataset-settings.ts new file mode 100644 index 00000000000000..1e42fcd9b4274e --- /dev/null +++ b/web/i18n/sl-SI/dataset-settings.ts @@ -0,0 +1,38 @@ +const translation = { + title: 'Nastavitve znanja', + desc: 'Tukaj lahko spremenite lastnosti in nastavitve pridobivanja tega znanja.', + form: { + name: 'Ime znanja', + namePlaceholder: 'Prosimo, vnesite ime znanja', + nameError: 'Ime ne sme biti prazno', + desc: 'Opis znanja', + descInfo: 'Prosimo, napišite jasen besedilni opis, ki bo povzel vsebino znanja. Ta opis bo uporabljen kot osnova za ujemanje pri izbiri med več znanji za sklepanje.', + descPlaceholder: 'Opišite, kaj je v tem znanju (neobvezno)', + descWrite: 'Naučite se, kako napisati dober opis znanja.', + permissions: 'Dovoljenja', + permissionsOnlyMe: 'Samo jaz', + permissionsAllMember: 'Vsi člani ekipe', + permissionsInvitedMembers: 'Določeni člani ekipe', + me: '(Vi)', + indexMethod: 'Metoda indeksiranja', + indexMethodHighQuality: 'Visoka kakovost', + indexMethodHighQualityTip: 'Za obdelavo pokličite vdelani model za zagotovitev večje natančnosti pri poizvedbah uporabnikov.', + indexMethodEconomy: 'Varčna', + indexMethodEconomyTip: 'Uporabite offline vektorske motorje, indeksiranje ključnih besed itd., da zmanjšate natančnost brez porabe žetonov', + embeddingModel: 'Vdelani model', + embeddingModelTip: 'Če želite spremeniti vdelani model, pojdite na ', + embeddingModelTipLink: 'Nastavitve', + retrievalSetting: { + title: 'Nastavitve pridobivanja', + learnMore: 'Izvedite več', + description: ' o metodi pridobivanja.', + longDescription: ' o metodi pridobivanja, to lahko kadar koli spremenite v nastavitvah znanja.', + }, + externalKnowledgeAPI: 'Zunanji API za znanje', + externalKnowledgeID: 'ID zunanjega znanja', + retrievalSettings: 'Nastavitve pridobivanja', + save: 'Shrani', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/dataset.ts b/web/i18n/sl-SI/dataset.ts new file mode 100644 index 00000000000000..482a3eab7e9644 --- /dev/null +++ b/web/i18n/sl-SI/dataset.ts @@ -0,0 +1,151 @@ +const translation = { + knowledge: 'Znanje', + externalTag: 'Zunanje', + externalAPI: 'Zunanji API', + externalAPIPanelTitle: 'Zunanji API za znanje', + externalKnowledgeId: 'ID zunanjega znanja', + externalKnowledgeName: 'Ime zunanjega znanja', + externalKnowledgeDescription: 'Opis znanja', + externalKnowledgeIdPlaceholder: 'Prosimo, vnesite ID znanja', + externalKnowledgeNamePlaceholder: 'Prosimo, vnesite ime baze znanja', + externalKnowledgeDescriptionPlaceholder: 'Opišite, kaj je v tej bazi znanja (neobvezno)', + learnHowToWriteGoodKnowledgeDescription: 'Naučite se, kako napisati dober opis znanja', + externalAPIPanelDescription: 'Zunanji API za znanje se uporablja za povezovanje z bazo znanja izven Dify in pridobivanje znanja iz te baze.', + externalAPIPanelDocumentation: 'Naučite se, kako ustvariti zunanji API za znanje', + documentCount: ' dokumentov', + wordCount: ' tisoč besed', + appCount: ' povezanih aplikacij', + createDataset: 'Ustvari znanje', + createNewExternalAPI: 'Ustvari nov zunanji API za znanje', + noExternalKnowledge: 'Zunanjega API-ja za znanje še ni, kliknite tukaj za ustvarjanje', + createExternalAPI: 'Dodaj zunanji API za znanje', + editExternalAPIFormTitle: 'Uredi zunanji API za znanje', + editExternalAPITooltipTitle: 'POVEZANO ZNANJE', + editExternalAPIConfirmWarningContent: { + front: 'Ta zunanji API za znanje je povezan z', + end: 'zunanjim znanjem, in ta sprememba bo vplivala na vse njih. Ali ste prepričani, da želite shraniti to spremembo?', + }, + editExternalAPIFormWarning: { + front: 'Ta zunanji API je povezan z', + end: 'zunanjim znanjem', + }, + deleteExternalAPIConfirmWarningContent: { + title: { + front: 'Izbriši', + end: '?', + }, + content: { + front: 'Ta zunanji API za znanje je povezan z', + end: 'zunanjim znanjem. Brisanje tega API-ja bo onemogočilo vse povezane baze znanja. Ali ste prepričani, da želite izbrisati ta API?', + }, + noConnectionContent: 'Ali ste prepričani, da želite izbrisati ta API?', + }, + selectExternalKnowledgeAPI: { + placeholder: 'Izberite zunanji API za znanje', + }, + connectDataset: 'Povežite se z zunanjo bazo znanja', + connectDatasetIntro: { + title: 'Kako se povezati z zunanjo bazo znanja', + content: { + front: 'Za povezavo z zunanjo bazo znanja morate najprej ustvariti zunanji API. Prosimo, natančno preberite in se sklicujte na', + link: 'Naučite se, kako ustvariti zunanji API', + end: '. Nato poiščite ustrezni ID znanja in ga vnesite v obrazec na levi. Če so vse informacije pravilne, boste po kliku na gumb za povezavo samodejno preusmerjeni na testiranje pridobivanja v bazi znanja.', + }, + learnMore: 'Izvedite več', + }, + connectHelper: { + helper1: 'Povežite se z zunanjimi bazami znanja preko API-ja in ID-ja baze znanja. Trenutno je ', + helper2: 'podprta le funkcionalnost pridobivanja', + helper3: '. Močno priporočamo, da ', + helper4: 'natančno preberete dokumentacijo za pomoč', + helper5: ' pred uporabo te funkcije.', + }, + createDatasetIntro: 'Uvozite lastne podatke v besedilni obliki ali v realnem času pišite podatke prek Webhook-a za izboljšanje konteksta LLM.', + deleteDatasetConfirmTitle: 'Izbrisati to znanje?', + deleteDatasetConfirmContent: + 'Brisanje znanja je nepovratno. Uporabniki do vašega znanja ne bodo več imeli dostopa, vse nastavitve pozivov in dnevniki bodo trajno izbrisani.', + datasetUsedByApp: 'Znanje se uporablja v nekaterih aplikacijah. Aplikacije ne bodo več mogle uporabljati tega znanja, vse nastavitve pozivov in dnevniki bodo trajno izbrisani.', + datasetDeleted: 'Znanje izbrisano', + datasetDeleteFailed: 'Brisanje znanja ni uspelo', + didYouKnow: 'Ali ste vedeli?', + intro1: 'Znanje je mogoče integrirati v aplikacijo Dify ', + intro2: 'kot kontekst', + intro3: ',', + intro4: 'ali pa ', + intro5: 'se lahko ustvari', + intro6: ' kot samostojni vtičnik ChatGPT za objavo', + unavailable: 'Ni na voljo', + unavailableTip: 'Vdelani model ni na voljo, potrebno je konfigurirati privzeti vdelani model', + datasets: 'ZNANJE', + datasetsApi: 'API DOSTOP', + externalKnowledgeForm: { + connect: 'Poveži', + cancel: 'Prekliči', + }, + externalAPIForm: { + name: 'Ime', + endpoint: 'API Končna točka', + apiKey: 'API ključ', + save: 'Shrani', + cancel: 'Prekliči', + edit: 'Uredi', + encrypted: { + front: 'Vaš API žeton bo šifriran in shranjen z uporabo', + end: 'tehnologije.', + }, + }, + retrieval: { + semantic_search: { + title: 'Vektorsko iskanje', + description: 'Ustvari vdelke poizvedbe in poišči odstavke besedila, ki so najbolj podobni njegovi vektorski predstavitvi.', + }, + full_text_search: { + title: 'Iskanje celotnega besedila', + description: 'Indeksirajte vse izraze v dokumentu, kar uporabnikom omogoča iskanje katerega koli izraza in pridobitev ustreznega odstavka besedila, ki ga vsebuje.', + }, + hybrid_search: { + title: 'Hibridno iskanje', + description: 'Istočasno izvede iskanje celotnega besedila in vektorsko iskanje ter ponovno razvrsti zadetke, da izbere najboljše ujemanje za uporabnikovo poizvedbo. Uporabniki lahko določijo uteži ali konfigurirajo model za ponovno razvrščanje.', + recommend: 'Priporočamo', + }, + invertedIndex: { + title: 'Inverzni indeks', + description: 'Inverzni indeks je struktura, ki se uporablja za učinkovito pridobivanje. Organizirano po izrazih, vsak izraz kaže na dokumente ali spletne strani, ki ga vsebujejo.', + }, + change: 'Spremeni', + changeRetrievalMethod: 'Spremeni metodo pridobivanja', + }, + docsFailedNotice: 'dokumentov ni bilo mogoče indeksirati', + retry: 'Poskusi znova', + indexingTechnique: { + high_quality: 'HQ', + economy: 'ECO', + }, + indexingMethod: { + semantic_search: 'VEKTORSKO', + full_text_search: 'CELOTNO BESEDILO', + hybrid_search: 'HIBRIDNO', + invertedIndex: 'INVERZNO', + }, + defaultRetrievalTip: 'Privzeto se uporablja večpotno pridobivanje. Znanje se pridobiva iz več baz znanja in nato ponovno razvrsti.', + mixtureHighQualityAndEconomicTip: 'Model za ponovno razvrščanje je potreben za mešanico baz znanja visoke kakovosti in varčnih baz.', + inconsistentEmbeddingModelTip: 'Model za ponovno razvrščanje je potreben, če so vdelani modeli izbranih baz znanja neenotni.', + mixtureInternalAndExternalTip: 'Model za ponovno razvrščanje je potreben za mešanico notranjega in zunanjega znanja.', + allExternalTip: 'Pri uporabi samo zunanjega znanja lahko uporabnik izbere, ali želi omogočiti model za ponovno razvrščanje. Če ni omogočen, bodo pridobljeni deli razvrščeni glede na ocene. Če so strategije pridobivanja različnih baz znanja neenotne, bo to netočno.', + retrievalSettings: 'Nastavitve pridobivanja', + rerankSettings: 'Nastavitve za ponovno razvrščanje', + weightedScore: { + title: 'Utežena ocena', + description: 'Z nastavljanjem dodeljenih uteži ta strategija za ponovno razvrščanje določa, ali naj se daje prednost semantičnemu ali ključnemu ujemanju.', + semanticFirst: 'Semantično najprej', + keywordFirst: 'Ključne besede najprej', + customized: 'Prilagojeno', + semantic: 'Semantično', + keyword: 'Ključna beseda', + }, + nTo1RetrievalLegacy: 'N-to-1 pridobivanje bo uradno ukinjeno septembra. Priporočamo uporabo najnovejšega večpotnega pridobivanja za boljše rezultate.', + nTo1RetrievalLegacyLink: 'Izvedite več', + nTo1RetrievalLegacyLinkText: 'N-to-1 pridobivanje bo uradno ukinjeno septembra.', +} + +export default translation diff --git a/web/i18n/sl-SI/explore.ts b/web/i18n/sl-SI/explore.ts new file mode 100644 index 00000000000000..ea3813b488477a --- /dev/null +++ b/web/i18n/sl-SI/explore.ts @@ -0,0 +1,41 @@ +const translation = { + title: 'Razišči', + sidebar: { + discovery: 'Odkritja', + chat: 'Klepet', + workspace: 'Delovni prostor', + action: { + pin: 'Pripni', + unpin: 'Odpni', + rename: 'Preimenuj', + delete: 'Izbriši', + }, + delete: { + title: 'Izbriši aplikacijo', + content: 'Ali ste prepričani, da želite izbrisati to aplikacijo?', + }, + }, + apps: { + title: 'Razišči aplikacije Dify', + description: 'Uporabite te predloge aplikacij takoj ali prilagodite svoje aplikacije na podlagi predlog.', + allCategories: 'Priporočeno', + }, + appCard: { + addToWorkspace: 'Dodaj v delovni prostor', + customize: 'Prilagodi', + }, + appCustomize: { + title: 'Ustvari aplikacijo iz {{name}}', + subTitle: 'Ikona aplikacije & ime', + nameRequired: 'Ime aplikacije je obvezno', + }, + category: { + Assistant: 'Pomočnik', + Writing: 'Pisanje', + Translate: 'Prevajanje', + Programming: 'Programiranje', + HR: 'Kadri', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/layout.ts b/web/i18n/sl-SI/layout.ts new file mode 100644 index 00000000000000..928649474b4dcd --- /dev/null +++ b/web/i18n/sl-SI/layout.ts @@ -0,0 +1,4 @@ +const translation = { +} + +export default translation diff --git a/web/i18n/sl-SI/login.ts b/web/i18n/sl-SI/login.ts new file mode 100644 index 00000000000000..70350021bc6337 --- /dev/null +++ b/web/i18n/sl-SI/login.ts @@ -0,0 +1,110 @@ +const translation = { + pageTitle: 'Hej, začnimo!👋', + welcome: 'Dobrodošli v Dify, prosimo, prijavite se za nadaljevanje.', + email: 'E-poštni naslov', + emailPlaceholder: 'Vaš e-poštni naslov', + password: 'Geslo', + passwordPlaceholder: 'Vaše geslo', + name: 'Uporabniško ime', + namePlaceholder: 'Vaše uporabniško ime', + forget: 'Ste pozabili geslo?', + signBtn: 'Prijava', + sso: 'Nadaljujte z SSO', + installBtn: 'Namesti', + setAdminAccount: 'Nastavitev administratorskega računa', + setAdminAccountDesc: 'Najvišje pravice za administratorski račun, ki se lahko uporablja za ustvarjanje aplikacij in upravljanje LLM ponudnikov itd.', + createAndSignIn: 'Ustvari in prijavi se', + oneMoreStep: 'Še en korak', + createSample: 'Na podlagi teh informacij bomo za vas ustvarili vzorčno aplikacijo', + invitationCode: 'Vabilna koda', + invitationCodePlaceholder: 'Vaša vabilna koda', + interfaceLanguage: 'Jezik vmesnika', + timezone: 'Časovni pas', + go: 'Pojdi na Dify', + sendUsMail: 'Pošljite nam uvod po e-pošti, mi pa bomo obravnavali vašo zahtevo za vabilo.', + acceptPP: 'Prebral sem in sprejemam politiko zasebnosti', + reset: 'Za ponastavitev gesla zaženite naslednji ukaz', + withGitHub: 'Nadaljujte z GitHub', + withGoogle: 'Nadaljujte z Google', + rightTitle: 'Odklenite polni potencial LLM', + rightDesc: 'Brez napora gradite vizualno privlačne, operabilne in izboljšljive AI aplikacije.', + tos: 'Pogoji storitve', + pp: 'Politika zasebnosti', + tosDesc: 'Z registracijo se strinjate z našimi', + goToInit: 'Če računa še niste inicializirali, pojdite na stran za inicializacijo', + dontHave: 'Nimate?', + invalidInvitationCode: 'Neveljavna vabilna koda', + accountAlreadyInited: 'Račun je že inicializiran', + forgotPassword: 'Ste pozabili geslo?', + resetLinkSent: 'Povezava za ponastavitev poslana', + sendResetLink: 'Pošlji povezavo za ponastavitev', + backToSignIn: 'Nazaj na prijavo', + forgotPasswordDesc: 'Prosimo, vnesite svoj e-poštni naslov za ponastavitev gesla. Poslali vam bomo e-pošto z navodili za ponastavitev gesla.', + checkEmailForResetLink: 'Preverite svojo e-pošto za povezavo za ponastavitev gesla. Če je ne prejmete v nekaj minutah, preverite tudi mapo z neželeno pošto.', + passwordChanged: 'Prijavite se zdaj', + changePassword: 'Spremeni geslo', + changePasswordTip: 'Prosimo, vnesite novo geslo za svoj račun', + invalidToken: 'Neveljaven ali potekel žeton', + confirmPassword: 'Potrdite geslo', + confirmPasswordPlaceholder: 'Potrdite svoje novo geslo', + passwordChangedTip: 'Vaše geslo je bilo uspešno spremenjeno', + error: { + emailEmpty: 'E-poštni naslov je obvezen', + emailInValid: 'Prosimo, vnesite veljaven e-poštni naslov', + nameEmpty: 'Ime je obvezno', + passwordEmpty: 'Geslo je obvezno', + passwordLengthInValid: 'Geslo mora vsebovati vsaj 8 znakov', + passwordInvalid: 'Geslo mora vsebovati črke in številke, dolžina pa mora biti več kot 8 znakov', + registrationNotAllowed: 'Računa ni mogoče najti. Za registracijo se obrnite na skrbnika sistema.', + }, + license: { + tip: 'Preden začnete z Dify Community Edition, preberite GitHub', + link: 'Licenco odprte kode', + }, + join: 'Pridruži se', + joinTipStart: 'Vabimo vas, da se pridružite', + joinTipEnd: 'ekipi na Dify', + invalid: 'Povezava je potekla', + explore: 'Razišči Dify', + activatedTipStart: 'Pridružili ste se ekipi', + activatedTipEnd: 'ekipi', + activated: 'Prijavite se zdaj', + adminInitPassword: 'Geslo za inicializacijo administratorja', + validate: 'Potrdi', + checkCode: { + emptyCode: 'Koda je obvezna', + verificationCodePlaceholder: 'Vnesite 6-mestno kodo', + resend: 'Poslati', + verificationCode: 'Koda za preverjanje', + tips: 'Kodo za preverjanje pošljemo na {{email}}', + verify: 'Preveriti', + validTime: 'Upoštevajte, da je koda veljavna 5 minut', + checkYourEmail: 'Preverjanje e-pošte', + didNotReceiveCode: 'Niste prejeli kode?', + invalidCode: 'Neveljavna koda', + useAnotherMethod: 'Uporabite drug način', + }, + useVerificationCode: 'Uporaba kode za preverjanje', + licenseInactive: 'Licenca je neaktivna', + changePasswordBtn: 'Nastavitev gesla', + licenseExpired: 'Licenca je potekla', + resetPassword: 'Ponastavi geslo', + back: 'Hrbet', + backToLogin: 'Nazaj na prijavo', + enterYourName: 'Prosimo, vnesite svoje uporabniško ime', + licenseLost: 'Izgubljena licenca', + licenseExpiredTip: 'Licenca za Dify Enterprise za vaš delovni prostor je potekla. Če želite še naprej uporabljati Dify, se obrnite na skrbnika.', + usePassword: 'Uporaba gesla', + sendVerificationCode: 'Pošlji kodo za preverjanje', + resetPasswordDesc: 'Vnesite e-poštni naslov, ki ste ga uporabili za prijavo na Dify, in poslali vam bomo e-poštno sporočilo za ponastavitev gesla.', + setYourAccount: 'Nastavitev računa', + noLoginMethodTip: 'Obrnite se na skrbnika sistema, da dodate način preverjanja pristnosti.', + or: 'ALI', + noLoginMethod: 'Način preverjanja pristnosti ni konfiguriran', + continueWithCode: 'Nadaljujte s kodo', + withSSO: 'Nadaljujte z enotno prijavo', + licenseLostTip: 'Povezava z licenčnim strežnikom Dify ni uspela. Če želite še naprej uporabljati Dify, se obrnite na skrbnika.', + licenseInactiveTip: 'Licenca Dify Enterprise za vaš delovni prostor je neaktivna. Če želite še naprej uporabljati Dify, se obrnite na skrbnika.', +} + +export default translation diff --git a/web/i18n/sl-SI/register.ts b/web/i18n/sl-SI/register.ts new file mode 100644 index 00000000000000..928649474b4dcd --- /dev/null +++ b/web/i18n/sl-SI/register.ts @@ -0,0 +1,4 @@ +const translation = { +} + +export default translation diff --git a/web/i18n/sl-SI/run-log.ts b/web/i18n/sl-SI/run-log.ts new file mode 100644 index 00000000000000..2ac026ac8411ec --- /dev/null +++ b/web/i18n/sl-SI/run-log.ts @@ -0,0 +1,29 @@ +const translation = { + input: 'VNOS', + result: 'REZULTAT', + detail: 'PODROBNOSTI', + tracing: 'SLEDENJE', + resultPanel: { + status: 'STATUS', + time: 'PRETEČENI ČAS', + tokens: 'SKUPNI ŽETONI', + }, + meta: { + title: 'METAPODATKI', + status: 'Status', + version: 'Različica', + executor: 'Izvajalec', + startTime: 'Čas začetka', + time: 'Pretečeni čas', + tokens: 'Skupni žetoni', + steps: 'Koraki izvajanja', + }, + resultEmpty: { + title: 'Ta zagon je izpisal samo format JSON,', + tipLeft: 'prosimo, pojdite na ', + link: 'panel podrobnosti', + tipRight: ' za ogled.', + }, +} + +export default translation diff --git a/web/i18n/sl-SI/share-app.ts b/web/i18n/sl-SI/share-app.ts new file mode 100644 index 00000000000000..68ad6594fc7e73 --- /dev/null +++ b/web/i18n/sl-SI/share-app.ts @@ -0,0 +1,71 @@ +const translation = { + common: { + welcome: '', + appUnavailable: 'Aplikacija ni na voljo', + appUnknownError: 'Aplikacija ni na voljo', + }, + chat: { + newChat: 'Nov klepet', + pinnedTitle: 'Pripeto', + unpinnedTitle: 'Klepeti', + newChatDefaultName: 'Nova konverzacija', + resetChat: 'Ponastavi konverzacijo', + poweredBy: 'Poganja', + prompt: 'Poziv', + privatePromptConfigTitle: 'Nastavitve konverzacije', + publicPromptConfigTitle: 'Začetni poziv', + configStatusDes: 'Pred začetkom lahko spremenite nastavitve konverzacije', + configDisabled: + 'Nastavitve prejšnje seje so uporabljene za to sejo.', + startChat: 'Začni klepet', + privacyPolicyLeft: 'Prosimo, preberite ', + privacyPolicyMiddle: 'politiko zasebnosti', + privacyPolicyRight: ' ponudnika aplikacije.', + deleteConversation: { + title: 'Izbriši konverzacijo', + content: 'Ali ste prepričani, da želite izbrisati to konverzacijo?', + }, + tryToSolve: 'Poskusite rešiti', + temporarySystemIssue: 'Oprostite, začasna težava s sistemom.', + }, + generation: { + tabs: { + create: 'Zaženi enkrat', + batch: 'Zaženi serijo', + saved: 'Shranjeno', + }, + savedNoData: { + title: 'Še niste shranili rezultata!', + description: 'Začnite z ustvarjanjem vsebine in tukaj najdite svoje shranjene rezultate.', + startCreateContent: 'Začnite z ustvarjanjem vsebine', + }, + title: 'AI Zaključek', + queryTitle: 'Vsebina poizvedbe', + completionResult: 'Rezultat zaključka', + queryPlaceholder: 'Vnesite vsebino poizvedbe...', + run: 'Izvedi', + copy: 'Kopiraj', + resultTitle: 'AI Zaključek', + noData: 'AI vam bo tukaj zagotovil, kar želite.', + csvUploadTitle: 'Povlecite in spustite svojo CSV datoteko tukaj, ali ', + browse: 'brskajte', + csvStructureTitle: 'CSV datoteka mora ustrezati naslednji strukturi:', + downloadTemplate: 'Prenesite predlogo tukaj', + field: 'Polje', + batchFailed: { + info: '{{num}} neuspelih izvedb', + retry: 'Poskusite znova', + outputPlaceholder: 'Brez izhodne vsebine', + }, + errorMsg: { + empty: 'Prosimo, vnesite vsebino v naloženo datoteko.', + fileStructNotMatch: 'Naložena CSV datoteka ne ustreza strukturi.', + emptyLine: 'Vrstica {{rowIndex}} je prazna', + invalidLine: 'Vrstica {{rowIndex}}: vrednost {{varName}} ne sme biti prazna', + moreThanMaxLengthLine: 'Vrstica {{rowIndex}}: vrednost {{varName}} ne sme biti daljša od {{maxLength}} znakov', + atLeastOne: 'Prosimo, vnesite vsaj eno vrstico v naloženo datoteko.', + }, + }, +} + +export default translation diff --git a/web/i18n/sl-SI/tools.ts b/web/i18n/sl-SI/tools.ts new file mode 100644 index 00000000000000..57160cfe62309f --- /dev/null +++ b/web/i18n/sl-SI/tools.ts @@ -0,0 +1,153 @@ +const translation = { + title: 'Orodja', + createCustomTool: 'Ustvari prilagojeno orodje', + customToolTip: 'Izvedite več o prilagojenih orodjih Dify', + type: { + all: 'Vsa', + builtIn: 'Vgrajena', + custom: 'Prilagojena', + workflow: 'Potek dela', + }, + contribute: { + line1: 'Zanima me ', + line2: 'prispevanje orodij k Dify.', + viewGuide: 'Oglejte si vodič', + }, + author: 'Avtor', + auth: { + unauthorized: 'Za avtorizacijo', + authorized: 'Avtorizirano', + setup: 'Nastavite avtorizacijo za uporabo', + setupModalTitle: 'Nastavi avtorizacijo', + setupModalTitleDescription: 'Po konfiguraciji poverilnic bodo vsi člani znotraj delovnega prostora lahko uporabljali to orodje pri orkestraciji aplikacij.', + }, + includeToolNum: 'Vključeno {{num}} orodij', + addTool: 'Dodaj orodje', + addToolModal: { + type: 'tip', + category: 'kategorija', + add: 'dodaj', + added: 'dodano', + manageInTools: 'Upravljaj v Orodjih', + emptyTitle: 'Orodje za potek dela ni na voljo', + emptyTip: 'Pojdite na "Potek dela -> Objavi kot orodje"', + }, + createTool: { + title: 'Ustvari prilagojeno orodje', + editAction: 'Konfiguriraj', + editTitle: 'Uredi prilagojeno orodje', + name: 'Ime', + toolNamePlaceHolder: 'Vnesite ime orodja', + nameForToolCall: 'Ime za klic orodja', + nameForToolCallPlaceHolder: 'Uporablja se za strojno prepoznavo, na primer getCurrentWeather, list_pets', + nameForToolCallTip: 'Podprte so samo številke, črke in podčrtaji.', + description: 'Opis', + descriptionPlaceholder: 'Kratek opis namena orodja, npr. pridobi temperaturo za določeno lokacijo.', + schema: 'Shema', + schemaPlaceHolder: 'Vnesite svojo OpenAPI shemo tukaj', + viewSchemaSpec: 'Oglejte si OpenAPI-Swagger specifikacijo', + importFromUrl: 'Uvozi iz URL-ja', + importFromUrlPlaceHolder: 'https://...', + urlError: 'Prosimo, vnesite veljaven URL', + examples: 'Primeri', + exampleOptions: { + json: 'Vreme(JSON)', + yaml: 'Trgovina za domače ljubljenčke(YAML)', + blankTemplate: 'Prazna predloga', + }, + availableTools: { + title: 'Razpoložljiva orodja', + name: 'Ime', + description: 'Opis', + method: 'Metoda', + path: 'Pot', + action: 'Dejanja', + test: 'Testiraj', + }, + authMethod: { + title: 'Metoda avtorizacije', + type: 'Vrsta avtorizacije', + keyTooltip: 'Ključ HTTP glave, pustite kot "Authorization", če ne veste, kaj je to, ali pa nastavite na vrednost po meri', + types: { + none: 'Brez', + api_key: 'API ključ', + apiKeyPlaceholder: 'Ime HTTP glave za API ključ', + apiValuePlaceholder: 'Vnesite API ključ', + }, + key: 'Ključ', + value: 'Vrednost', + }, + authHeaderPrefix: { + title: 'Vrsta avtorizacije', + types: { + basic: 'Osnovna', + bearer: 'Imetnik', + custom: 'Prilagojena', + }, + }, + privacyPolicy: 'Politika zasebnosti', + privacyPolicyPlaceholder: 'Prosimo, vnesite politiko zasebnosti', + toolInput: { + title: 'Vnos orodja', + name: 'Ime', + required: 'Obvezno', + method: 'Metoda', + methodSetting: 'Nastavitve', + methodSettingTip: 'Uporabnik izpolni konfiguracijo orodja', + methodParameter: 'Parameter', + methodParameterTip: 'LLM izpolni med sklepanjem', + label: 'Oznake', + labelPlaceholder: 'Izberite oznake (neobvezno)', + description: 'Opis', + descriptionPlaceholder: 'Opis pomena parametra', + }, + customDisclaimer: 'Prilagojeno zavrnitev odgovornosti', + customDisclaimerPlaceholder: 'Prosimo, vnesite prilagojeno zavrnitev odgovornosti', + confirmTitle: 'Potrditi shranjevanje?', + confirmTip: 'Aplikacije, ki uporabljajo to orodje, bodo vplivane', + deleteToolConfirmTitle: 'Izbrisati to orodje?', + deleteToolConfirmContent: 'Brisanje orodja je nepovratno. Uporabniki ne bodo več imeli dostopa do vašega orodja.', + }, + test: { + title: 'Test', + parametersValue: 'Parametri in vrednosti', + parameters: 'Parametri', + value: 'Vrednost', + testResult: 'Rezultati testa', + testResultPlaceholder: 'Rezultati testa bodo prikazani tukaj', + }, + thought: { + using: 'Uporablja se', + used: 'Uporabljeno', + requestTitle: 'Zahteva za', + responseTitle: 'Odgovor iz', + }, + setBuiltInTools: { + info: 'Informacije', + setting: 'Nastavitve', + toolDescription: 'Opis orodja', + parameters: 'parametri', + string: 'niz', + number: 'številka', + required: 'Obvezno', + infoAndSetting: 'Informacije in nastavitve', + }, + noCustomTool: { + title: 'Ni prilagojenih orodij!', + content: 'Tukaj lahko dodate in upravljate svoja prilagojena orodja za gradnjo AI aplikacij.', + createTool: 'Ustvari orodje', + }, + noSearchRes: { + title: 'Oprostite, ni rezultatov!', + content: 'Nismo našli nobenih orodij, ki ustrezajo vašemu iskanju.', + reset: 'Ponastavi iskanje', + }, + builtInPromptTitle: 'Poziv', + toolRemoved: 'Orodje odstranjeno', + notAuthorized: 'Orodje ni avtorizirano', + howToGet: 'Kako pridobiti', + openInStudio: 'Odpri v Studiju', + toolNameUsageTip: 'Ime klica orodja za sklepanja in pozivanje agenta', +} + +export default translation diff --git a/web/i18n/sl-SI/workflow.ts b/web/i18n/sl-SI/workflow.ts new file mode 100644 index 00000000000000..e5141f06fb3625 --- /dev/null +++ b/web/i18n/sl-SI/workflow.ts @@ -0,0 +1,1063 @@ +const translation = { + common: { + undo: 'Razveljavi', + redo: 'Uveljavi', + editing: 'Urejanje', + autoSaved: 'Samodejno shranjeno', + unpublished: 'Nepublicirano', + published: 'Objavljeno', + publish: 'Objavi', + update: 'Posodobi', + run: 'Zaženi', + running: 'V teku', + inRunMode: 'V načinu zagona', + inPreview: 'V predogledu', + inPreviewMode: 'V načinu predogleda', + preview: 'Predogled', + viewRunHistory: 'Ogled zgodovine zagona', + runHistory: 'Zgodovina zagona', + goBackToEdit: 'Nazaj na urejevalnik', + conversationLog: 'Zapisnik pogovora', + features: 'Značilnosti', + debugAndPreview: 'Predogled', + restart: 'Ponovni zagon', + currentDraft: 'Trenutni osnutek', + currentDraftUnpublished: 'Trenutni osnutek ni objavljen', + latestPublished: 'Zadnje objavljeno', + publishedAt: 'Objavljeno ob', + restore: 'Obnovi', + runApp: 'Zaženi aplikacijo', + batchRunApp: 'Serijski zagon aplikacije', + accessAPIReference: 'Dostop do API referenc', + embedIntoSite: 'Vdelaj v spletno stran', + addTitle: 'Dodaj naslov...', + addDescription: 'Dodaj opis...', + noVar: 'Ni spremenljivke', + searchVar: 'Išči spremenljivko', + variableNamePlaceholder: 'Ime spremenljivke', + setVarValuePlaceholder: 'Nastavi vrednost spremenljivke', + needConnectTip: 'Ta korak ni povezan z ničemer', + maxTreeDepth: 'Največja omejitev je {{depth}} vozlišč na vejo', + needEndNode: 'Dodati je treba zaključni blok', + needAnswerNode: 'Dodati je treba blok z odgovorom', + workflowProcess: 'Proces delovnega toka', + notRunning: 'Še ni v teku', + previewPlaceholder: 'Vnesite vsebino v spodnje polje za začetek odpravljanja napak klepetalnika', + effectVarConfirm: { + title: 'Odstrani spremenljivko', + content: 'Spremenljivka se uporablja v drugih vozliščih. Ali jo kljub temu želite odstraniti?', + }, + insertVarTip: 'Pritisnite tipko \'/\' za hitro vstavljanje', + processData: 'Obdelava podatkov', + input: 'Vnos', + output: 'Izhod', + jinjaEditorPlaceholder: 'Vnesite \'/\' ali \'{\' za vstavljanje spremenljivke', + viewOnly: 'Samo ogled', + showRunHistory: 'Prikaži zgodovino zagona', + enableJinja: 'Omogoči podporo za Jinja predloge', + learnMore: 'Več informacij', + copy: 'Kopiraj', + duplicate: 'Podvoji', + addBlock: 'Dodaj blok', + pasteHere: 'Prilepi tukaj', + pointerMode: 'Način kazalca', + handMode: 'Način roke', + model: 'Model', + workflowAsTool: 'Potek dela kot orodje', + configureRequired: 'Potrebna konfiguracija', + configure: 'Konfiguriraj', + manageInTools: 'Upravljaj v Orodjih', + workflowAsToolTip: 'Po posodobitvi poteka dela je potrebno ponovno konfigurirati orodje.', + viewDetailInTracingPanel: 'Oglejte si podrobnosti', + syncingData: 'Sinhronizacija podatkov, le nekaj sekund.', + importDSL: 'Uvozi DSL', + importDSLTip: 'Trenutni osnutek bo prepisan. Pred uvozom izvozite delovni tok kot varnostno kopijo.', + backupCurrentDraft: 'Varnostno kopiraj trenutni osnutek', + chooseDSL: 'Izberite DSL(yml) datoteko', + overwriteAndImport: 'Prepiši in uvozi', + importFailure: 'Uvoz ni uspel', + importSuccess: 'Uvoz uspešen', + parallelRun: 'Vzporedni zagon', + parallelTip: { + click: { + title: 'Klikni', + desc: ' za dodajanje', + }, + drag: { + title: 'Povleci', + desc: ' za povezavo', + }, + limit: 'Vzporednost je omejena na {{num}} vej.', + depthLimit: 'Omejitev gnezdenja vzporednih slojev na {{num}} slojev', + }, + disconnect: 'Prekini povezavo', + jumpToNode: 'Skoči na to vozlišče', + addParallelNode: 'Dodaj vzporedno vozlišče', + parallel: 'VZPOREDNO', + branch: 'VEJA', + fileUploadTip: 'Funkcije nalaganja slik so nadgrajene na nalaganje datotek.', + featuresDocLink: 'Izvedi več', + featuresDescription: 'Izboljšajte uporabniško izkušnjo spletne aplikacije', + ImageUploadLegacyTip: 'Zdaj lahko ustvarite spremenljivke vrste datoteke v začetnem obrazcu. V prihodnje ne bomo več podpirali funkcije nalaganja slik.', + }, + env: { + envPanelTitle: 'Spremenljivke okolja', + envDescription: 'Spremenljivke okolja se uporabljajo za shranjevanje zasebnih informacij in poverilnic. So samo za branje in jih je mogoče ločiti od DSL datoteke med izvozom.', + envPanelButton: 'Dodaj spremenljivko', + modal: { + title: 'Dodaj spremenljivko okolja', + editTitle: 'Uredi spremenljivko okolja', + type: 'Vrsta', + name: 'Ime', + namePlaceholder: 'ime okolja', + value: 'Vrednost', + valuePlaceholder: 'vrednost okolja', + secretTip: 'Uporablja se za definiranje občutljivih informacij ali podatkov, s konfiguriranimi nastavitvami DSL za preprečevanje uhajanja.', + }, + export: { + title: 'Izvoziti skrivne spremenljivke okolja?', + checkbox: 'Izvozi skrivne vrednosti', + ignore: 'Izvozi DSL', + export: 'Izvozi DSL z skrivnimi vrednostmi', + }, + chatVariable: { + panelTitle: 'Spremenljivke pogovora', + panelDescription: 'Spremenljivke pogovora se uporabljajo za shranjevanje interaktivnih informacij, ki jih mora LLM zapomniti, vključno z zgodovino pogovorov, naloženimi datotekami, uporabniškimi nastavitvami. So za branje in pisanje.', + docLink: 'Obiščite naše dokumente za več informacij.', + button: 'Dodaj spremenljivko', + modal: { + title: 'Dodaj spremenljivko pogovora', + editTitle: 'Uredi spremenljivko pogovora', + name: 'Ime', + namePlaceholder: 'Ime spremenljivke', + type: 'Vrsta', + value: 'Privzeta vrednost', + valuePlaceholder: 'Privzeta vrednost, pustite prazno, če je ne želite nastaviti', + description: 'Opis', + descriptionPlaceholder: 'Opišite spremenljivko', + editInJSON: 'Uredi v JSON', + oneByOne: 'Dodaj eno po eno', + editInForm: 'Uredi v obrazcu', + arrayValue: 'Vrednost', + addArrayValue: 'Dodaj vrednost', + objectKey: 'Ključ', + objectType: 'Vrsta', + objectValue: 'Privzeta vrednost', + }, + storedContent: 'Shranjena vsebina', + updatedAt: 'Posodobljeno ob', + }, + changeHistory: { + title: 'Zgodovina sprememb', + placeholder: 'Še niste ničesar spremenili', + clearHistory: 'Počisti zgodovino', + hint: 'Namig', + hintText: 'Vaša dejanja urejanja se spremljajo v zgodovini sprememb, ki se hrani na vaši napravi med trajanjem te seje. Ta zgodovina se bo izbrisala, ko zapustite urejevalnik.', + stepBackward_one: '{{count}} korak nazaj', + stepBackward_other: '{{count}} korakov nazaj', + stepForward_one: '{{count}} korak naprej', + stepForward_other: '{{count}} korakov naprej', + sessionStart: 'Začetek seje', + currentState: 'Trenutno stanje', + nodeTitleChange: 'Naslov bloka spremenjen', + nodeDescriptionChange: 'Opis bloka spremenjen', + nodeDragStop: 'Blok premaknjen', + nodeChange: 'Blok spremenjen', + nodeConnect: 'Blok povezan', + nodePaste: 'Blok prilepljen', + nodeDelete: 'Blok izbrisan', + nodeAdd: 'Blok dodan', + nodeResize: 'Velikost bloka spremenjena', + noteAdd: 'Opomba dodana', + noteChange: 'Opomba spremenjena', + noteDelete: 'Opomba izbrisana', + edgeDelete: 'Blok prekinjen', + }, + errorMsg: { + fieldRequired: '{{field}} je obvezen', + rerankModelRequired: 'Pred vklopom modela za ponovno razvrščanje, prosimo potrdite, da je bil model uspešno konfiguriran v nastavitvah.', + authRequired: 'Potrebna je avtorizacija', + invalidJson: '{{field}} je neveljaven JSON', + fields: { + variable: 'Ime spremenljivke', + variableValue: 'Vrednost spremenljivke', + code: 'Koda', + model: 'Model', + rerankModel: 'Model za ponovno razvrščanje', + }, + invalidVariable: 'Neveljavna spremenljivka', + }, + singleRun: { + testRun: 'Testni zagon', + startRun: 'Začni zagon', + running: 'V teku', + testRunIteration: 'Iteracija testnega zagona', + back: 'Nazaj', + iteration: 'Iteracija', + }, + tabs: { + 'searchBlock': 'Iskanje bloka', + 'blocks': 'Bloki', + 'searchTool': 'Iskanje orodja', + 'tools': 'Orodja', + 'allTool': 'Vsa', + 'builtInTool': 'Vgrajena', + 'customTool': 'Prilagojena', + 'workflowTool': 'Potek dela', + 'question-understand': 'Razumevanje vprašanja', + 'logic': 'Logika', + 'transform': 'Pretvorba', + 'utilities': 'Pripomočki', + 'noResult': 'Ni najdenih zadetkov', + }, + blocks: { + 'start': 'Začetek', + 'end': 'Konec', + 'answer': 'Odgovor', + 'llm': 'LLM', + 'knowledge-retrieval': 'Pridobivanje znanja', + 'question-classifier': 'Klasifikator vprašanj', + 'if-else': 'IF/ELSE', + 'code': 'Koda', + 'template-transform': 'Predloga', + 'http-request': 'HTTP zahteva', + 'variable-assigner': 'Dodeljevalec spremenljivk', + 'variable-aggregator': 'Zbiralnik spremenljivk', + 'assigner': 'Dodeljevalec spremenljivk', + 'iteration-start': 'Začetek iteracije', + 'iteration': 'Iteracija', + 'parameter-extractor': 'Izvleček parametrov', + }, + blocksAbout: { + 'start': 'Določite začetne parametre za zagon delovnega toka', + 'end': 'Določite konec in vrsto rezultata delovnega toka', + 'answer': 'Določite vsebino odgovora v klepetalni konverzaciji', + 'llm': 'Klicanje velikih jezikovnih modelov za odgovarjanje na vprašanja ali obdelavo naravnega jezika', + 'knowledge-retrieval': 'Omogoča iskanje vsebine, povezane z uporabnikovimi vprašanji, iz baze znanja', + 'question-classifier': 'Določite pogoje za klasifikacijo uporabniških vprašanj; LLM lahko določi, kako se bo konverzacija razvijala glede na klasifikacijski opis', + 'if-else': 'Omogoča razdelitev delovnega toka na dve veji glede na pogoje if/else', + 'code': 'Izvedite del kode Python ali NodeJS za implementacijo prilagojene logike', + 'template-transform': 'Pretvorite podatke v niz z uporabo Jinja predloge', + 'http-request': 'Omogoča pošiljanje strežniških zahtev preko HTTP protokola', + 'variable-assigner': 'Združi spremenljivke več vej v eno spremenljivko za enotno konfiguracijo vozlišč nižje v poteku.', + 'assigner': 'Vozlišče za dodelitev spremenljivk se uporablja za dodelitev vrednosti pisnim spremenljivkam (kot so spremenljivke konverzacije).', + 'variable-aggregator': 'Združi spremenljivke več vej v eno spremenljivko za enotno konfiguracijo vozlišč nižje v poteku.', + 'iteration': 'Izvedite več korakov na seznamu objektov, dokler niso vsi rezultati izpisani.', + 'parameter-extractor': 'Uporabite LLM za izvleček strukturiranih parametrov iz naravnega jezika za klice orodij ali HTTP zahteve.', + }, + operator: { + zoomIn: 'Povečaj', + zoomOut: 'Pomanjšaj', + zoomTo50: 'Povečaj na 50%', + zoomTo100: 'Povečaj na 100%', + zoomToFit: 'Prilagodi velikost', + }, + panel: { + userInputField: 'Vnosno polje uporabnika', + changeBlock: 'Spremeni blok', + helpLink: 'Povezava za pomoč', + about: 'O', + createdBy: 'Ustvaril ', + nextStep: 'Naslednji korak', + addNextStep: 'Dodaj naslednji blok v tem delovnem toku', + selectNextStep: 'Izberi naslednji blok', + runThisStep: 'Zaženi ta korak', + checklist: 'Kontrolni seznam', + checklistTip: 'Poskrbite, da so vsi problemi rešeni pred objavo', + checklistResolved: 'Vsi problemi so rešeni', + organizeBlocks: 'Organiziraj bloke', + change: 'Spremeni', + optional: '(neobvezno)', + }, + nodes: { + common: { + outputVars: 'Izhodne spremenljivke', + insertVarTip: 'Vstavi spremenljivko', + memory: { + memory: 'Pomnjenje', + memoryTip: 'Nastavitve pomnjenja klepeta', + windowSize: 'Velikost okna', + conversationRoleName: 'Ime vloge v konverzaciji', + user: 'Predpona uporabnika', + assistant: 'Predpona pomočnika', + }, + memories: { + title: 'Pomnjenje', + tip: 'Pomnjenje klepeta', + builtIn: 'Vgrajeno', + }, + }, + start: { + required: 'obvezno', + inputField: 'Vnosno polje', + builtInVar: 'Vgrajene spremenljivke', + outputVars: { + query: 'Uporabniški vnos', + memories: { + des: 'Zgodovina konverzacije', + type: 'vrsta sporočila', + content: 'vsebina sporočila', + }, + files: 'Seznam datotek', + }, + noVarTip: 'Nastavite vnose, ki jih lahko uporabite v delovnem toku', + }, + end: { + outputs: 'Izhodi', + output: { + type: 'vrsta izhoda', + variable: 'izhoda spremenljivka', + }, + type: { + 'none': 'Brez', + 'plain-text': 'Navadno besedilo', + 'structured': 'Strukturirano', + }, + }, + answer: { + answer: 'Odgovor', + outputVars: 'Izhodne spremenljivke', + }, + llm: { + model: 'model', + variables: 'spremenljivke', + context: 'kontekst', + contextTooltip: 'Kot kontekst lahko uvozite Znanje', + notSetContextInPromptTip: 'Za omogočanje funkcije konteksta, prosimo, izpolnite kontekstno spremenljivko v POZIVU.', + prompt: 'poziv', + roleDescription: { + system: 'Podajte splošna navodila za konverzacijo', + user: 'Podajte navodila, poizvedbe ali katero koli besedilno vsebino za model', + assistant: 'Odzivi modela na uporabniška sporočila', + }, + addMessage: 'Dodaj sporočilo', + vision: 'vizija', + files: 'Datoteke', + resolution: { + name: 'Ločljivost', + high: 'Visoka', + low: 'Nizka', + }, + outputVars: { + output: 'Generirana vsebina', + usage: 'Podatki o uporabi modela', + }, + singleRun: { + variable: 'Spremenljivka', + }, + sysQueryInUser: 'sys.query v uporabniškem sporočilu je obvezno', + }, + knowledgeRetrieval: { + queryVariable: 'Poizvedbena spremenljivka', + knowledge: 'Znanje', + outputVars: { + output: 'Pridobljeni segmentirani podatki', + content: 'Segmentirana vsebina', + title: 'Segmentirani naslov', + icon: 'Segmentirana ikona', + url: 'Segmentiran URL', + metadata: 'Drugi metapodatki', + }, + }, + http: { + inputVars: 'Vnosne spremenljivke', + api: 'API', + apiPlaceholder: 'Vnesite URL, vstavite spremenljivko z tipko ‘/’', + notStartWithHttp: 'API mora začeti z http:// ali https://', + key: 'Ključ', + value: 'Vrednost', + bulkEdit: 'Serijsko urejanje', + keyValueEdit: 'Urejanje ključ-vrednost', + headers: 'Glave', + params: 'Parametri', + body: 'Telo', + outputVars: { + body: 'Vsebina odgovora', + statusCode: 'Statusna koda odgovora', + headers: 'Seznam glave odgovora v JSON', + files: 'Seznam datotek', + }, + }, + authorization: { + 'authorization': 'Avtorizacija', + 'authorizationType': 'Vrsta avtorizacije', + 'no-auth': 'Brez', + 'api-key': 'API-ključ', + 'auth-type': 'Vrsta avtorizacije', + 'basic': 'Osnovna', + 'bearer': 'Imetnik', + 'custom': 'Prilagojena', + 'api-key-title': 'API ključ', + 'header': 'Glava', + }, + insertVarPlaceholder: 'vnesite \'/\' za vstavljanje spremenljivke', + timeout: { + title: 'Časovna omejitev', + connectLabel: 'Časovna omejitev povezave', + connectPlaceholder: 'Vnesite časovno omejitev povezave v sekundah', + readLabel: 'Časovna omejitev branja', + readPlaceholder: 'Vnesite časovno omejitev branja v sekundah', + writeLabel: 'Časovna omejitev pisanja', + writePlaceholder: 'Vnesite časovno omejitev pisanja v sekundah', + }, + }, + code: { + inputVars: 'Vhodne spremenljivke', + outputVars: 'Izhodne spremenljivke', + advancedDependencies: 'Napredne odvisnosti', + advancedDependenciesTip: 'Dodajte nekaj prednaloženih odvisnosti, ki potrebujejo več časa za nalaganje ali niso privzeto vgrajene', + searchDependencies: 'Išči odvisnosti', + }, + templateTransform: { + inputVars: 'Vhodne spremenljivke', + code: 'Koda', + codeSupportTip: 'Podpira samo Jinja2', + outputVars: { + output: 'Pretvorjena vsebina', + }, + }, + ifElse: { + if: 'Če', + else: 'Sicer', + elseDescription: 'Uporablja se za definiranje logike, ki naj se izvede, ko pogoj "če" ni izpolnjen.', + and: 'in', + or: 'ali', + operator: 'Operater', + notSetVariable: 'Najprej nastavite spremenljivko', + comparisonOperator: { + 'contains': 'vsebuje', + 'not contains': 'ne vsebuje', + 'start with': 'se začne z', + 'end with': 'se konča z', + 'is': 'je', + 'is not': 'ni', + 'empty': 'je prazna', + 'not empty': 'ni prazna', + 'null': 'je null', + 'not null': 'ni null', + }, + enterValue: 'Vnesite vrednost', + addCondition: 'Dodaj pogoj', + conditionNotSetup: 'Pogoj NI nastavljen', + selectVariable: 'Izberite spremenljivko...', + }, + variableAssigner: { + title: 'Dodeli spremenljivke', + outputType: 'Vrsta izhoda', + varNotSet: 'Spremenljivka ni nastavljena', + noVarTip: 'Dodajte spremenljivke, ki jih želite dodeliti', + type: { + string: 'Niz', + number: 'Število', + object: 'Objekt', + array: 'Polje', + }, + aggregationGroup: 'Skupina za združevanje', + aggregationGroupTip: 'Omogočanje te funkcije omogoča agregatorju spremenljivk združevanje več naborov spremenljivk.', + addGroup: 'Dodaj skupino', + outputVars: { + varDescribe: 'Izhod {{groupName}}', + }, + setAssignVariable: 'Nastavi dodeljeno spremenljivko', + }, + assigner: { + 'assignedVariable': 'Dodeljena spremenljivka', + 'writeMode': 'Način pisanja', + 'writeModeTip': 'Način dodajanja: Na voljo samo za spremenljivke vrste polje.', + 'over-write': 'Prepiši', + 'append': 'Dodaj', + 'plus': 'Plus', + 'clear': 'Počisti', + 'setVariable': 'Nastavi spremenljivko', + 'variable': 'Spremenljivka', + }, + tool: { + toAuthorize: 'Za avtorizacijo', + inputVars: 'Vhodne spremenljivke', + outputVars: { + text: 'orodje je ustvarilo vsebino', + files: { + title: 'orodje je ustvarilo datoteke', + type: 'Podprta vrsta. Trenutno podpira samo slike', + transfer_method: 'Način prenosa. Vrednosti so remote_url ali local_file', + url: 'URL slike', + upload_file_id: 'ID naložene datoteke', + }, + json: 'orodje je ustvarilo json', + }, + }, + questionClassifiers: { + model: 'model', + inputVars: 'Vhodne spremenljivke', + outputVars: { + className: 'Ime razreda', + }, + class: 'Razred', + classNamePlaceholder: 'Vnesite ime razreda', + advancedSetting: 'Napredna nastavitev', + topicName: 'Ime teme', + topicPlaceholder: 'Vnesite ime teme', + addClass: 'Dodaj razred', + instruction: 'Navodilo', + instructionTip: 'Vnesite dodatna navodila, da bo klasifikator vprašanj lažje razumel, kako kategorizirati vprašanja.', + instructionPlaceholder: 'Vnesite vaše navodilo', + }, + parameterExtractor: { + inputVar: 'Vhodna spremenljivka', + extractParameters: 'Izvleči parametre', + importFromTool: 'Uvozi iz orodij', + addExtractParameter: 'Dodaj izvlečen parameter', + addExtractParameterContent: { + name: 'Ime', + namePlaceholder: 'Ime izvlečenega parametra', + type: 'Vrsta', + typePlaceholder: 'Vrsta izvlečenega parametra', + description: 'Opis', + descriptionPlaceholder: 'Opis izvlečenega parametra', + required: 'Obvezno', + requiredContent: 'Obvezno je uporabljeno samo kot referenca za sklepanja modela in ne za obvezno preverjanje izhoda parametra.', + }, + extractParametersNotSet: 'Parametri za izvleček niso nastavljeni', + instruction: 'Navodilo', + instructionTip: 'Vnesite dodatna navodila, da parameter extractor lažje razume, kako izvleči parametre.', + advancedSetting: 'Napredna nastavitev', + reasoningMode: 'Način sklepanja', + reasoningModeTip: 'Lahko izberete ustrezen način sklepanja glede na sposobnost modela za odgovore na navodila za klice funkcij ali pozive.', + isSuccess: 'Je uspeh. Pri uspehu je vrednost 1, pri neuspehu pa 0.', + errorReason: 'Razlog za napako', + }, + iteration: { + deleteTitle: 'Izbrisati vozlišče iteracije?', + deleteDesc: 'Brisanje vozlišča iteracije bo izbrisalo vsa podrejena vozlišča', + input: 'Vhod', + output: 'Izhodne spremenljivke', + iteration_one: '{{count}} iteracija', + iteration_other: '{{count}} iteracij', + currentIteration: 'Trenutna iteracija', + }, + note: { + addNote: 'Dodaj opombo', + editor: { + placeholder: 'Zapišite opombo...', + small: 'Majhno', + medium: 'Srednje', + large: 'Veliko', + bold: 'Krepko', + italic: 'Poševno', + strikethrough: 'Prečrtano', + link: 'Povezava', + openLink: 'Odpri', + unlink: 'Odstrani povezavo', + enterUrl: 'Vnesite URL...', + invalidUrl: 'Neveljaven URL', + bulletList: 'Označen seznam', + showAuthor: 'Pokaži avtorja', + }, + }, + }, + tracing: { + stopBy: 'Ustavljeno s strani {{user}}', + }, + chatVariable: { + modal: { + type: 'Vrsta', + objectValue: 'Privzeta vrednost', + description: 'Opis', + editTitle: 'Urejanje spremenljivke pogovora', + namePlaceholder: 'Ime spremenljivke', + valuePlaceholder: 'Privzeta vrednost, pustite prazno, da ni nastavljeno', + title: 'Dodajanje spremenljivke pogovora', + editInJSON: 'Urejanje v JSON', + value: 'Privzeta vrednost', + oneByOne: 'Dodajanje enega za drugim', + objectKey: 'Ključ', + objectType: 'Vrsta', + arrayValue: 'Vrednost', + name: 'Ime', + descriptionPlaceholder: 'Opis spremenljivke', + editInForm: 'Uredi v obrazcu', + addArrayValue: 'Dodajanje vrednosti', + }, + storedContent: 'Shranjena vsebina', + updatedAt: 'Posodobljeno na', + panelTitle: 'Spremenljivke pogovora', + button: 'Dodajanje spremenljivke', + panelDescription: 'Spremenljivke pogovora se uporabljajo za shranjevanje interaktivnih informacij, ki si jih mora LLM zapomniti, vključno z zgodovino pogovorov, naloženimi datotekami, uporabniškimi nastavitvami. So branje in pisanje.', + docLink: 'Če želite izvedeti več, obiščite naše dokumente.', + }, + changeHistory: { + nodeChange: 'Blokiranje spremenjeno', + placeholder: 'Ničesar še niste spremenili', + nodeDescriptionChange: 'Opis bloka je bil spremenjen', + nodePaste: 'Blokiranje lepljenja', + noteDelete: 'Opomba izbrisana', + nodeDragStop: 'Blok premaknjen', + nodeConnect: 'Blok povezan', + sessionStart: 'Začetek seje', + nodeDelete: 'Blokiraj izbrisane', + stepBackward_other: '{{count}} stopi nazaj', + hint: 'Namig', + noteAdd: 'Opomba dodana', + clearHistory: 'Počisti zgodovino', + stepForward_one: '{{count}} korak naprej', + stepBackward_one: '{{count}} korak nazaj', + nodeAdd: 'Blokiranje dodano', + noteChange: 'Opomba spremenjena', + hintText: 'Dejanjem urejanja se sledi v zgodovini sprememb, ki je shranjena v napravi za čas trajanja te seje. Ta zgodovina bo izbrisana, ko zapustite urejevalnik.', + stepForward_other: '{{count}} koraki naprej', + edgeDelete: 'Blok je prekinjen.', + nodeTitleChange: 'Naslov bloka spremenjen', + nodeResize: 'Spremeni velikost bloka', + title: 'Zgodovina sprememb', + currentState: 'Trenutno stanje', + }, + errorMsg: { + fields: { + code: 'Koda', + variableValue: 'Vrednost spremenljivke', + visionVariable: 'Spremenljivka vida', + model: 'Model', + rerankModel: 'Ponovno razvrsti model', + variable: 'Ime spremenljivke', + }, + invalidJson: '{{field}} je neveljaven JSON', + invalidVariable: 'Neveljavna spremenljivka', + authRequired: 'Dovoljenje je potrebno', + fieldRequired: '{{field}} je obvezno', + rerankModelRequired: 'Preden vklopite Rerank Model, preverite, ali je bil model uspešno konfiguriran v nastavitvah.', + }, + singleRun: { + startRun: 'Začni zagnati', + running: 'Tek', + testRunIteration: 'Ponovitev preskusnega zagona', + iteration: 'Ponovitev', + back: 'Hrbet', + testRun: 'Preskusni zagon', + }, + tabs: { + 'blocks': 'Bloki', + 'workflowTool': 'Potek dela', + 'transform': 'Preoblikovanje', + 'question-understand': 'Vprašanje razumeti', + 'builtInTool': 'Vgrajeno', + 'allTool': 'Ves', + 'tools': 'Orodja', + 'logic': 'Logika', + 'searchBlock': 'Iskalni blok', + 'noResult': 'Ni najdenega ujemanja', + 'customTool': 'Običaj', + 'utilities': 'Utilities', + 'searchTool': 'Orodje za iskanje', + }, + blocks: { + 'variable-aggregator': 'Spremenljivi agregator', + 'code': 'Koda', + 'parameter-extractor': 'Ekstraktor parametrov', + 'llm': 'LLM', + 'knowledge-retrieval': 'Pridobivanje znanja', + 'answer': 'Odgovoriti', + 'end': 'Konec', + 'document-extractor': 'Ekstraktor dokumentov', + 'assigner': 'Dodeljevalnik spremenljivke', + 'iteration-start': 'Začetek ponovitve', + 'template-transform': 'Predloga', + 'iteration': 'Ponovitev', + 'start': 'Začetek', + 'if-else': 'IF/ELSE', + 'list-operator': 'Operater seznama', + 'http-request': 'Zahteva HTTP', + 'variable-assigner': 'Spremenljivi agregator', + 'question-classifier': 'Klasifikator vprašanj', + }, + blocksAbout: { + 'document-extractor': 'Uporablja se za razčlenjevanje naloženih dokumentov v besedilno vsebino, ki je zlahka razumljiva LLM.', + 'list-operator': 'Uporablja se za filtriranje ali razvrščanje vsebine matrike.', + 'template-transform': 'Pretvorite podatke v niz s sintakso predloge Jinja', + 'question-classifier': 'Določite pogoje razvrščanja uporabniških vprašanj, LLM lahko določi, kako poteka pogovor na podlagi opisa klasifikacije', + 'start': 'Določanje začetnih parametrov za zagon poteka dela', + 'if-else': 'Omogoča razdelitev poteka dela na dve veji glede na pogoje if/else', + 'knowledge-retrieval': 'Omogoča poizvedovanje po besedilni vsebini, ki je povezana z uporabniškimi vprašanji iz zbirke znanja', + 'variable-assigner': 'Združite spremenljivke z več vejami v eno spremenljivko za poenoteno konfiguracijo nadaljnjih vozlišč.', + 'code': 'Izvedite kodo Python ali NodeJS za izvajanje logike po meri', + 'answer': 'Določanje vsebine odgovora v pogovoru v klepetu', + 'iteration': 'Izvedite več korakov na predmetu seznama, dokler niso prikazani vsi rezultati.', + 'http-request': 'Dovoli pošiljanje zahtev strežnika prek protokola HTTP', + 'end': 'Določanje končne in končne vrste poteka dela', + 'variable-aggregator': 'Združite spremenljivke z več vejami v eno spremenljivko za poenoteno konfiguracijo nadaljnjih vozlišč.', + 'parameter-extractor': 'Uporabite LLM za pridobivanje strukturiranih parametrov iz naravnega jezika za klicanje orodij ali zahteve HTTP.', + 'assigner': 'Vozlišče za dodeljevanje spremenljivk se uporablja za dodeljevanje vrednosti zapisljivim spremenljivkam (kot so spremenljivke pogovora).', + 'llm': 'Sklicevanje na velike jezikovne modele za odgovarjanje na vprašanja ali obdelavo naravnega jezika', + }, + operator: { + zoomOut: 'Pomanjšanje', + zoomTo100: 'Povečava na 100 %', + zoomToFit: 'Povečaj, da se prilega', + zoomIn: 'Povečava', + zoomTo50: 'Povečava na 50%', + }, + panel: { + helpLink: 'Povezava za pomoč', + organizeBlocks: 'Organiziranje blokov', + optional: '(neobvezno)', + nextStep: 'Naslednji korak', + checklist: 'Kontrolni seznam', + runThisStep: 'Zaženite ta korak', + about: 'Približno', + selectNextStep: 'Izberite Naslednji blok', + changeBlock: 'Spremeni blok', + createdBy: 'Ustvaril', + checklistTip: 'Pred objavo se prepričajte, da so vse težave odpravljene', + userInputField: 'Uporabniško polje za vnos', + checklistResolved: 'Vse težave so odpravljene', + addNextStep: 'Dodajanje naslednjega bloka v ta potek dela', + change: 'Spremeniti', + }, + nodes: { + common: { + memory: { + conversationRoleName: 'Ime vloge pogovora', + memoryTip: 'Nastavitve pomnilnika klepeta', + assistant: 'Predpona pomočnika', + user: 'Uporabniška predpona', + memory: 'Spomin', + windowSize: 'Velikost okna', + }, + memories: { + tip: 'Pomnilnik klepeta', + title: 'Spomine', + builtIn: 'Vgrajeno', + }, + outputVars: 'Izhodne spremenljivke', + insertVarTip: 'Vstavi spremenljivko', + }, + start: { + outputVars: { + memories: { + content: 'Vsebina sporočila', + des: 'Zgodovina pogovorov', + type: 'Vrsta sporočila', + }, + query: 'Uporabniški vnos', + files: 'Seznam datotek', + }, + required: 'Zahteva', + inputField: 'Vnosno polje', + noVarTip: 'Nastavitev vhodov, ki jih je mogoče uporabiti v poteku dela', + builtInVar: 'Vgrajene spremenljivke', + }, + end: { + output: { + variable: 'izhodna spremenljivka', + type: 'Vrsta izhoda', + }, + type: { + 'structured': 'Strukturiran', + 'plain-text': 'Navadno besedilo', + 'none': 'Nobena', + }, + outputs: 'Izhodov', + }, + answer: { + answer: 'Odgovoriti', + outputVars: 'Izhodne spremenljivke', + }, + llm: { + roleDescription: { + assistant: 'Odgovori modela na podlagi sporočil uporabnikov', + system: 'Podajte navodila na visoki ravni za pogovor', + user: 'Navedite navodila, poizvedbe ali kakršen koli besedilni vnos v model', + }, + resolution: { + low: 'Nizek', + high: 'Visok', + name: 'Resolucija', + }, + outputVars: { + usage: 'Informacije o uporabi modela', + output: 'Ustvarjanje vsebine', + }, + singleRun: { + variable: 'Spremenljivka', + }, + notSetContextInPromptTip: 'Če želite omogočiti funkcijo konteksta, izpolnite kontekstno spremenljivko v PROMPT.', + sysQueryInUser: 'sys.query v sporočilu uporabnika je obvezen', + model: 'model', + files: 'Datoteke', + addMessage: 'Dodaj sporočilo', + context: 'Kontekstu', + variables: 'Spremenljivke', + prompt: 'Uren', + vision: 'vid', + contextTooltip: 'Znanje lahko uvozite kot kontekst', + }, + knowledgeRetrieval: { + outputVars: { + title: 'Segmentirani naslov', + url: 'Segmentirani URL', + output: 'Pridobivanje segmentiranih podatkov', + icon: 'Segmentirana ikona', + metadata: 'Drugi metapodatki', + content: 'Segmentirana vsebina', + }, + queryVariable: 'Spremenljivka poizvedbe', + knowledge: 'Znanje', + }, + http: { + outputVars: { + headers: 'JSON seznama glav odgovorov', + body: 'Vsebina odgovora', + files: 'Seznam datotek', + statusCode: 'Koda stanja odgovora', + }, + authorization: { + 'authorization': 'Dovoljenje', + 'header': 'Glava', + 'bearer': 'Nosilec', + 'api-key-title': 'API ključ', + 'basic': 'Osnoven', + 'no-auth': 'Nobena', + 'custom': 'Običaj', + 'authorizationType': 'Vrsta dovoljenja', + 'auth-type': 'Vrsta preverjanja pristnosti', + 'api-key': 'Ključ API-ja', + }, + timeout: { + readPlaceholder: 'Vnos časovne omejitve branja v sekundah', + writePlaceholder: 'Vnesite časovno omejitev pisanja v sekundah', + writeLabel: 'Časovna omejitev pisanja', + connectLabel: 'Časovna omejitev povezave', + title: 'Timeout', + readLabel: 'Časovna omejitev branja', + connectPlaceholder: 'Vnos časovne omejitve povezave v sekundah', + }, + value: 'Vrednost', + key: 'Ključ', + notStartWithHttp: 'API se mora začeti z http:// ali https://', + body: 'Telo', + type: 'Vrsta', + inputVars: 'Vhodne spremenljivke', + bulkEdit: 'Urejanje v velikem obsegu', + insertVarPlaceholder: 'vnesite "/" za vstavljanje spremenljivke', + api: 'API', + keyValueEdit: 'Urejanje ključ-vrednost', + binaryFileVariable: 'Spremenljivka binarne datoteke', + headers: 'Glave', + apiPlaceholder: 'Vnesite URL, vnesite \'/\' vstavi spremenljivko', + extractListPlaceholder: 'Vnesite indeks elementa seznama, vnesite \'/\' vstavi spremenljivko', + params: 'Params', + }, + code: { + inputVars: 'Vhodne spremenljivke', + outputVars: 'Izhodne spremenljivke', + searchDependencies: 'Odvisnosti iskanja', + advancedDependenciesTip: 'Tukaj dodajte nekaj vnaprej naloženih odvisnosti, ki trajajo dlje časa ali niso privzeto vgrajene', + advancedDependencies: 'Napredne odvisnosti', + }, + templateTransform: { + outputVars: { + output: 'Preoblikovana vsebina', + }, + code: 'Koda', + inputVars: 'Vhodne spremenljivke', + codeSupportTip: 'Podpira samo Jinja2', + }, + ifElse: { + comparisonOperator: { + 'all of': 'vse', + 'is not': 'ni', + 'not empty': 'ni prazen', + 'start with': 'Začnite z', + 'is': 'Je', + 'null': 'je nična', + 'not exists': 'ne obstaja', + 'contains': 'Vsebuje', + 'empty': 'je prazen', + 'exists': 'Obstaja', + 'in': 'v', + 'not contains': 'ne vsebuje', + 'end with': 'Končaj z', + 'not in': 'ni v', + 'not null': 'ni nična', + }, + optionName: { + video: 'Video', + doc: 'Doc', + audio: 'Avdio', + image: 'Podoba', + url: 'Spletni naslov', + localUpload: 'Lokalno nalaganje', + }, + and: 'in', + else: 'Drugega', + enterValue: 'Vnesite vrednost', + elseDescription: 'Uporablja se za določanje logike, ki jo je treba izvesti, ko pogoj if ni izpolnjen.', + addCondition: 'Dodajanje pogoja', + if: 'Če', + select: 'Izbrati', + selectVariable: 'Izberite spremenljivko ...', + conditionNotSetup: 'Pogoj NI nastavljen', + addSubVariable: 'Podspremenljivka', + notSetVariable: 'Prosimo, najprej nastavite spremenljivko', + operator: 'Operaterja', + or: 'ali', + }, + variableAssigner: { + type: { + string: 'Niz', + object: 'Predmet', + array: 'Matrika', + number: 'Številka', + }, + outputVars: { + varDescribe: '{{groupName}} izhod', + }, + addGroup: 'Dodajanje skupine', + outputType: 'Vrsta izhoda', + title: 'Dodeljevanje spremenljivk', + noVarTip: 'Seštevanje spremenljivk, ki jih je treba dodeliti', + aggregationGroupTip: 'Če omogočite to funkcijo, lahko združevalnik spremenljivk združi več naborov spremenljivk.', + aggregationGroup: 'Združevalna skupina', + varNotSet: 'Spremenljivka ni nastavljena', + setAssignVariable: 'Nastavitev spremenljivke dodelitve', + }, + assigner: { + 'writeMode': 'Način pisanja', + 'plus': 'Plus', + 'variable': 'Spremenljivka', + 'clear': 'Jasen', + 'append': 'Dodaj', + 'assignedVariable': 'Dodeljena spremenljivka', + 'setVariable': 'Nastavi spremenljivko', + 'over-write': 'Prepisati', + 'writeModeTip': 'Način dodajanja: Na voljo samo za spremenljivke polja.', + }, + tool: { + outputVars: { + files: { + transfer_method: 'Način prenosa. Vrednost je remote_url ali local_file', + upload_file_id: 'Naloži ID datoteke', + type: 'Vrsta podpore. Zdaj podpiramo samo sliko', + url: 'URL slike', + title: 'Datoteke, ustvarjene z orodjem', + }, + json: 'JSON, ustvarjen z orodjem', + text: 'Vsebina, ustvarjena z orodjem', + }, + inputVars: 'Vhodne spremenljivke', + toAuthorize: 'Za odobritev', + }, + questionClassifiers: { + outputVars: { + className: 'Ime razreda', + }, + instruction: 'Navodilo', + classNamePlaceholder: 'Napišite ime svojega razreda', + addClass: 'Dodajanje razreda', + instructionPlaceholder: 'Napišite navodila', + topicName: 'Ime teme', + topicPlaceholder: 'Napišite ime teme', + class: 'Razred', + advancedSetting: 'Napredne nastavitve', + model: 'model', + inputVars: 'Vhodne spremenljivke', + instructionTip: 'Vnesite dodatna navodila, ki bodo klasifikatorju vprašanj pomagala bolje razumeti, kako kategorizirati vprašanja.', + }, + parameterExtractor: { + addExtractParameterContent: { + description: 'Opis', + typePlaceholder: 'Vrsta parametra izvlečka', + requiredContent: 'Zahtevano se uporablja samo kot referenca za sklepanje modela in ne za obvezno validacijo izhodnega parametra.', + required: 'Zahteva', + type: 'Vrsta', + namePlaceholder: 'Izvleček imena parametra', + descriptionPlaceholder: 'Opis parametra izvlečka', + name: 'Ime', + }, + isSuccess: 'Je uspeh.Pri uspehu je vrednost 1, pri neuspehu je vrednost 0.', + addExtractParameter: 'Dodajanje parametra izvlečka', + importFromTool: 'Uvoz iz orodij', + reasoningModeTip: 'Izberete lahko ustrezen način sklepanja glede na sposobnost modela, da se odzove na navodila za klicanje funkcij ali pozive.', + inputVar: 'Vhodna spremenljivka', + advancedSetting: 'Napredne nastavitve', + errorReason: 'Razlog za napako', + reasoningMode: 'Način sklepanja', + instruction: 'Navodilo', + instructionTip: 'Vnesite dodatna navodila, ki bodo ekstraktorju parametrov pomagala razumeti, kako izvleči parametre.', + extractParametersNotSet: 'Izvleček parametrov ni nastavljen', + extractParameters: 'Izvleček parametrov', + }, + iteration: { + ErrorMethod: { + continueOnError: 'Nadaljuj ob napaki', + removeAbnormalOutput: 'Odstranite nenormalen izhod', + operationTerminated: 'Prekinjena', + }, + output: 'Izhodne spremenljivke', + parallelMode: 'Vzporedni način', + MaxParallelismTitle: 'Največji vzporednost', + errorResponseMethod: 'Način odziva na napako', + parallelModeEnableDesc: 'V vzporednem načinu opravila v iteracijah podpirajo vzporedno izvajanje. To lahko konfigurirate na plošči z lastnostmi na desni.', + error_one: '{{štetje}} Napaka', + comma: ',', + parallelModeUpper: 'VZPOREDNI NAČIN', + parallelModeEnableTitle: 'Vzporedni način omogočen', + currentIteration: 'Trenutna ponovitev', + error_other: '{{štetje}} Napake', + input: 'Vhodni', + deleteTitle: 'Izbrisati iteracijsko vozlišče?', + parallelPanelDesc: 'V vzporednem načinu opravila v iteraciji podpirajo vzporedno izvajanje.', + deleteDesc: 'Če izbrišete iteracijsko vozlišče, boste izbrisali vsa podrejena vozlišča', + iteration_other: '{{štetje}} Ponovitev', + answerNodeWarningDesc: 'Opozorilo vzporednega načina: Vozlišča za odgovore, dodelitve spremenljivk pogovora in trajne operacije branja / pisanja v iteracijah lahko povzročijo izjeme.', + MaxParallelismDesc: 'Največja vzporednost se uporablja za nadzor števila nalog, ki se izvajajo hkrati v eni ponovitvi.', + iteration_one: '{{štetje}} Ponovitev', + }, + note: { + editor: { + medium: 'Srednja', + openLink: 'Odprt', + showAuthor: 'Pokaži avtorja', + bold: 'Smel', + strikethrough: 'Prečrtano', + large: 'Velik', + link: 'Povezava', + enterUrl: 'Vnesite URL ...', + small: 'Majhen', + italic: 'Ležeče', + invalidUrl: 'Neveljaven URL', + unlink: 'Prekini povezavo', + placeholder: 'Napišite svojo opombo ...', + bulletList: 'Seznam oznak', + }, + addNote: 'Dodaj opombo', + }, + docExtractor: { + outputVars: { + text: 'Izvlečeno besedilo', + }, + inputVar: 'Vhodna spremenljivka', + learnMore: 'Izvedi več', + supportFileTypes: 'Podporne vrste datotek: {{types}}.', + }, + listFilter: { + outputVars: { + result: 'Rezultat filtriranja', + first_record: 'Prvi zapis', + last_record: 'Zadnji zapis', + }, + extractsCondition: 'Ekstrahiranje elementa N', + selectVariableKeyPlaceholder: 'Izberite ključ podspremenljivke', + asc: 'ASC', + orderBy: 'Naročite po', + filterCondition: 'Pogoj filtra', + filterConditionKey: 'Ključ pogoja filtra', + desc: 'DESC', + limit: 'Vrh N', + filterConditionComparisonOperator: 'Operator za primerjavo pogojev filtra', + inputVar: 'Vhodna spremenljivka', + filterConditionComparisonValue: 'Vrednost pogoja filtra', + }, + }, +} + +export default translation diff --git a/web/i18n/tr-TR/common.ts b/web/i18n/tr-TR/common.ts index 0438a637ceb713..3a806845602f28 100644 --- a/web/i18n/tr-TR/common.ts +++ b/web/i18n/tr-TR/common.ts @@ -591,6 +591,10 @@ const translation = { pasteFileLinkInvalid: 'Geçersiz dosya bağlantısı', fileExtensionNotSupport: 'Dosya uzantısı desteklenmiyor', }, + license: { + expiring_plural: '{{count}} gün içinde sona eriyor', + expiring: 'Bir günde sona eriyor', + }, } export default translation diff --git a/web/i18n/tr-TR/login.ts b/web/i18n/tr-TR/login.ts index b6727082a6dd71..e742548dc5428b 100644 --- a/web/i18n/tr-TR/login.ts +++ b/web/i18n/tr-TR/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethodTip: 'Bir kimlik doğrulama yöntemi eklemek için lütfen sistem yöneticisine başvurun.', sendVerificationCode: 'Doğrulama Kodu Gönder', back: 'Geri', + licenseExpiredTip: 'Çalışma alanınız için Dify Enterprise lisansının süresi doldu. Dify\'ı kullanmaya devam etmek için lütfen yöneticinizle iletişime geçin.', + licenseLostTip: 'Dify lisans sunucusuna bağlanılamadı. Dify\'ı kullanmaya devam etmek için lütfen yöneticinizle iletişime geçin.', + licenseInactiveTip: 'Çalışma alanınız için Dify Enterprise lisansı etkin değil. Dify\'ı kullanmaya devam etmek için lütfen yöneticinizle iletişime geçin.', + licenseExpired: 'Lisansın Süresi Doldu', + licenseLost: 'Lisans Kaybedildi', + licenseInactive: 'Lisans Etkin Değil', } export default translation diff --git a/web/i18n/tr-TR/workflow.ts b/web/i18n/tr-TR/workflow.ts index e6e25f6d0e2757..50dc390d54c867 100644 --- a/web/i18n/tr-TR/workflow.ts +++ b/web/i18n/tr-TR/workflow.ts @@ -408,6 +408,7 @@ const translation = { }, type: 'Tür', binaryFileVariable: 'İkili Dosya Değişkeni', + extractListPlaceholder: 'Liste öğesi dizinini girin, \'/\' yazın değişken ekle', }, code: { inputVars: 'Giriş Değişkenleri', @@ -619,6 +620,7 @@ const translation = { filterConditionComparisonValue: 'Filtre Koşulu değeri', selectVariableKeyPlaceholder: 'Alt değişken anahtarını seçin', desc: 'DESC', + extractsCondition: 'N öğesini ayıklayın', }, }, tracing: { diff --git a/web/i18n/uk-UA/common.ts b/web/i18n/uk-UA/common.ts index c3d3ef23b3b50f..e3e4a3972212ad 100644 --- a/web/i18n/uk-UA/common.ts +++ b/web/i18n/uk-UA/common.ts @@ -592,6 +592,10 @@ const translation = { uploadFromComputerReadError: 'Не вдалося прочитати файл, будь ласка, спробуйте ще раз.', uploadFromComputerUploadError: 'Не вдалося завантажити файл, будь ласка, завантажте ще раз.', }, + license: { + expiring: 'Термін дії закінчується за один день', + expiring_plural: 'Термін дії закінчується за {{count}} днів', + }, } export default translation diff --git a/web/i18n/uk-UA/login.ts b/web/i18n/uk-UA/login.ts index cdb0b79d8e683f..e6d1d15dd53e8e 100644 --- a/web/i18n/uk-UA/login.ts +++ b/web/i18n/uk-UA/login.ts @@ -99,6 +99,12 @@ const translation = { noLoginMethodTip: 'Будь ласка, зверніться до адміністратора системи, щоб додати метод автентифікації.', resetPasswordDesc: 'Введіть адресу електронної пошти, яку ви використовували для реєстрації на Dify, і ми надішлемо вам електронний лист для скидання пароля.', resetPassword: 'Скинути пароль', + licenseLostTip: 'Не вдалося підключити сервер ліцензій Dify. Будь ласка, зверніться до свого адміністратора, щоб продовжити користуватися Dify.', + licenseExpired: 'Термін дії ліцензії минув', + licenseInactive: 'Ліцензія неактивна', + licenseLost: 'Ліцензію втрачено', + licenseInactiveTip: 'Ліцензія Dify Enterprise для вашої робочої області неактивна. Будь ласка, зверніться до свого адміністратора, щоб продовжити користуватися Dify.', + licenseExpiredTip: 'Термін дії ліцензії Dify Enterprise для вашого робочого простору закінчився. Будь ласка, зверніться до свого адміністратора, щоб продовжити користуватися Dify.', } export default translation diff --git a/web/i18n/uk-UA/workflow.ts b/web/i18n/uk-UA/workflow.ts index 663b5e4c13303c..6958e72ce29c9a 100644 --- a/web/i18n/uk-UA/workflow.ts +++ b/web/i18n/uk-UA/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: 'Тип', binaryFileVariable: 'Змінна двійкового файлу', + extractListPlaceholder: 'Введіть індекс елемента списку, введіть \'/\' вставити змінну', }, code: { inputVars: 'Вхідні змінні', @@ -618,6 +619,7 @@ const translation = { orderBy: 'Замовити по', filterConditionComparisonOperator: 'Оператор порівняння умов фільтра', filterConditionComparisonValue: 'Значення умови фільтра', + extractsCondition: 'Витягніть елемент N', }, }, tracing: { diff --git a/web/i18n/vi-VN/common.ts b/web/i18n/vi-VN/common.ts index 45282ad5d21dd5..8a25cd52f20d58 100644 --- a/web/i18n/vi-VN/common.ts +++ b/web/i18n/vi-VN/common.ts @@ -591,6 +591,10 @@ const translation = { uploadFromComputerUploadError: 'Tải lên tệp không thành công, vui lòng tải lên lại.', uploadFromComputerReadError: 'Đọc tệp không thành công, vui lòng thử lại.', }, + license: { + expiring_plural: 'Hết hạn sau {{count}} ngày', + expiring: 'Hết hạn trong một ngày', + }, } export default translation diff --git a/web/i18n/vi-VN/login.ts b/web/i18n/vi-VN/login.ts index a07c1bf807085c..ab4ab68f481b50 100644 --- a/web/i18n/vi-VN/login.ts +++ b/web/i18n/vi-VN/login.ts @@ -99,6 +99,12 @@ const translation = { usePassword: 'Sử dụng mật khẩu', resetPassword: 'Đặt lại mật khẩu', sendVerificationCode: 'Gửi mã xác minh', + licenseInactive: 'Giấy phép không hoạt động', + licenseLost: 'Mất giấy phép', + licenseInactiveTip: 'Giấy phép Dify Enterprise cho không gian làm việc của bạn không hoạt động. Vui lòng liên hệ với quản trị viên của bạn để tiếp tục sử dụng Dify.', + licenseExpired: 'Giấy phép đã hết hạn', + licenseExpiredTip: 'Giấy phép Dify Enterprise cho không gian làm việc của bạn đã hết hạn. Vui lòng liên hệ với quản trị viên của bạn để tiếp tục sử dụng Dify.', + licenseLostTip: 'Không thể kết nối máy chủ cấp phép Dify. Vui lòng liên hệ với quản trị viên của bạn để tiếp tục sử dụng Dify.', } export default translation diff --git a/web/i18n/vi-VN/workflow.ts b/web/i18n/vi-VN/workflow.ts index 1176fdd2b51b7b..b90c89cb20ca4c 100644 --- a/web/i18n/vi-VN/workflow.ts +++ b/web/i18n/vi-VN/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, binaryFileVariable: 'Biến tệp nhị phân', type: 'Kiểu', + extractListPlaceholder: 'Nhập chỉ mục mục danh sách, nhập \'/\' chèn biến', }, code: { inputVars: 'Biến đầu vào', @@ -618,6 +619,7 @@ const translation = { filterCondition: 'Điều kiện lọc', asc: 'ASC', filterConditionComparisonOperator: 'Toán tử so sánh điều kiện bộ lọc', + extractsCondition: 'Giải nén mục N', }, }, tracing: { diff --git a/web/i18n/zh-Hans/common.ts b/web/i18n/zh-Hans/common.ts index 58d56a83315e0e..207beaab8cce4a 100644 --- a/web/i18n/zh-Hans/common.ts +++ b/web/i18n/zh-Hans/common.ts @@ -591,6 +591,10 @@ const translation = { created: '标签创建成功', failed: '标签创建失败', }, + license: { + expiring: '许可证还有 1 天到期', + expiring_plural: '许可证还有 {{count}} 天到期', + }, } export default translation diff --git a/web/i18n/zh-Hans/login.ts b/web/i18n/zh-Hans/login.ts index 40697701da8858..7f64c954b1554e 100644 --- a/web/i18n/zh-Hans/login.ts +++ b/web/i18n/zh-Hans/login.ts @@ -99,6 +99,12 @@ const translation = { back: '返回', noLoginMethod: '未配置身份认证方式', noLoginMethodTip: '请联系系统管理员添加身份认证方式', + licenseExpired: '许可证已过期', + licenseExpiredTip: '您所在空间的 Dify Enterprise 许可证已过期,请联系管理员以继续使用 Dify。', + licenseLost: '许可证丢失', + licenseLostTip: '无法连接 Dify 许可证服务器,请联系管理员以继续使用 Dify。', + licenseInactive: '许可证未激活', + licenseInactiveTip: '您所在空间的 Dify Enterprise 许可证尚未激活,请联系管理员以继续使用 Dify。', } export default translation diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 1229ba8c037956..98f34672d3a846 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -369,6 +369,7 @@ const translation = { inputVars: '输入变量', api: 'API', apiPlaceholder: '输入 URL,输入变量时请键入‘/’', + extractListPlaceholder: '输入提取列表编号,输入变量时请键入‘/’', notStartWithHttp: 'API 应该以 http:// 或 https:// 开头', key: '键', type: '类型', @@ -608,6 +609,7 @@ const translation = { filterConditionComparisonOperator: '过滤条件比较操作符', filterConditionComparisonValue: '过滤条件比较值', selectVariableKeyPlaceholder: '选择子变量的 Key', + extractsCondition: '取第 N 项', limit: '取前 N 项', orderBy: '排序', asc: '升序', diff --git a/web/i18n/zh-Hant/common.ts b/web/i18n/zh-Hant/common.ts index 184331d6d53ede..f801a64d101585 100644 --- a/web/i18n/zh-Hant/common.ts +++ b/web/i18n/zh-Hant/common.ts @@ -591,6 +591,10 @@ const translation = { fileExtensionNotSupport: '不支援檔擴展名', uploadFromComputerLimit: '上傳文件不能超過 {{size}}', }, + license: { + expiring: '將在1天內過期', + expiring_plural: '將在 {{count}} 天后過期', + }, } export default translation diff --git a/web/i18n/zh-Hant/login.ts b/web/i18n/zh-Hant/login.ts index a35346e71a8bd5..6f2b8341184fc7 100644 --- a/web/i18n/zh-Hant/login.ts +++ b/web/i18n/zh-Hant/login.ts @@ -99,6 +99,12 @@ const translation = { back: '返回', resetPasswordDesc: '輸入您用於註冊 Dify 的電子郵件,我們將向您發送一封密碼重置電子郵件。', usePassword: '使用密碼', + licenseExpiredTip: '您的工作區的 Dify Enterprise 許可證已過期。請聯繫您的管理員以繼續使用 Dify。', + licenseExpired: '許可證已過期', + licenseLost: '許可證丟失', + licenseInactive: '許可證處於非活動狀態', + licenseInactiveTip: '您的工作區的 Dify Enterprise 許可證處於非活動狀態。請聯繫您的管理員以繼續使用 Dify。', + licenseLostTip: '無法連接 Dify 許可證伺服器。請聯繫您的管理員以繼續使用 Dify。', } export default translation diff --git a/web/i18n/zh-Hant/workflow.ts b/web/i18n/zh-Hant/workflow.ts index f3fbfdedc29d30..3cd7ad24996b76 100644 --- a/web/i18n/zh-Hant/workflow.ts +++ b/web/i18n/zh-Hant/workflow.ts @@ -407,6 +407,7 @@ const translation = { }, type: '類型', binaryFileVariable: '二進位檔變數', + extractListPlaceholder: '輸入清單項索引,鍵入 『/』 插入變數', }, code: { inputVars: '輸入變量', @@ -618,6 +619,7 @@ const translation = { selectVariableKeyPlaceholder: 'Select sub variable key (選擇子變數鍵)', filterConditionComparisonOperator: 'Filter Condition Comparison 運算符', filterConditionKey: '篩選條件鍵', + extractsCondition: '提取第 N 項', }, }, tracing: { diff --git a/web/package.json b/web/package.json index de01eb4d489df1..d863ba13d34867 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "dify-web", - "version": "0.11.0", + "version": "0.11.1", "private": true, "engines": { "node": ">=18.17.0" diff --git a/web/service/base.ts b/web/service/base.ts index 6cb732c55da3c4..9ee3033d8e2f3f 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -17,6 +17,7 @@ import type { WorkflowStartedResponse, } from '@/types/workflow' import { removeAccessToken } from '@/app/components/share/utils' +import { asyncRunSafe } from '@/utils' const TIME_OUT = 100000 const ContentType = { @@ -550,55 +551,78 @@ export const ssePost = ( } // base request -export const request = (url: string, options = {}, otherOptions?: IOtherOptions) => { - return new Promise((resolve, reject) => { +export const request = async(url: string, options = {}, otherOptions?: IOtherOptions) => { + try { const otherOptionsForBaseFetch = otherOptions || {} - baseFetch(url, options, otherOptionsForBaseFetch).then(resolve).catch((errResp) => { - if (errResp?.status === 401) { - return refreshAccessTokenOrRelogin(TIME_OUT).then(() => { - baseFetch(url, options, otherOptionsForBaseFetch).then(resolve).catch(reject) - }).catch(() => { - const { - isPublicAPI = false, - silent, - } = otherOptionsForBaseFetch - const bodyJson = errResp.json() - if (isPublicAPI) { - return bodyJson.then((data: ResponseError) => { - if (data.code === 'web_sso_auth_required') - requiredWebSSOLogin() - - if (data.code === 'unauthorized') { - removeAccessToken() - globalThis.location.reload() - } + const [err, resp] = await asyncRunSafe(baseFetch(url, options, otherOptionsForBaseFetch)) + if (err === null) + return resp + const errResp: Response = err as any + if (errResp.status === 401) { + const [parseErr, errRespData] = await asyncRunSafe(errResp.json()) + const loginUrl = `${globalThis.location.origin}/signin` + if (parseErr) { + globalThis.location.href = loginUrl + return Promise.reject(err) + } + // special code + const { code, message } = errRespData + // webapp sso + if (code === 'web_sso_auth_required') { + requiredWebSSOLogin() + return Promise.reject(err) + } + if (code === 'unauthorized_and_force_logout') { + localStorage.removeItem('console_token') + localStorage.removeItem('refresh_token') + globalThis.location.reload() + return Promise.reject(err) + } + const { + isPublicAPI = false, + silent, + } = otherOptionsForBaseFetch + if (isPublicAPI && code === 'unauthorized') { + removeAccessToken() + globalThis.location.reload() + return Promise.reject(err) + } + if (code === 'init_validate_failed' && IS_CE_EDITION && !silent) { + Toast.notify({ type: 'error', message, duration: 4000 }) + return Promise.reject(err) + } + if (code === 'not_init_validated' && IS_CE_EDITION) { + globalThis.location.href = `${globalThis.location.origin}/init` + return Promise.reject(err) + } + if (code === 'not_setup' && IS_CE_EDITION) { + globalThis.location.href = `${globalThis.location.origin}/install` + return Promise.reject(err) + } - return Promise.reject(data) - }) - } - const loginUrl = `${globalThis.location.origin}/signin` - bodyJson.then((data: ResponseError) => { - if (data.code === 'init_validate_failed' && IS_CE_EDITION && !silent) - Toast.notify({ type: 'error', message: data.message, duration: 4000 }) - else if (data.code === 'not_init_validated' && IS_CE_EDITION) - globalThis.location.href = `${globalThis.location.origin}/init` - else if (data.code === 'not_setup' && IS_CE_EDITION) - globalThis.location.href = `${globalThis.location.origin}/install` - else if (location.pathname !== '/signin' || !IS_CE_EDITION) - globalThis.location.href = loginUrl - else if (!silent) - Toast.notify({ type: 'error', message: data.message }) - }).catch(() => { - // Handle any other errors - globalThis.location.href = loginUrl - }) - }) + // refresh token + const [refreshErr] = await asyncRunSafe(refreshAccessTokenOrRelogin(TIME_OUT)) + if (refreshErr === null) + return baseFetch(url, options, otherOptionsForBaseFetch) + if (location.pathname !== '/signin' || !IS_CE_EDITION) { + globalThis.location.href = loginUrl + return Promise.reject(err) } - else { - reject(errResp) + if (!silent) { + Toast.notify({ type: 'error', message }) + return Promise.reject(err) } - }) - }) + globalThis.location.href = loginUrl + return Promise.reject(err) + } + else { + return Promise.reject(err) + } + } + catch (error) { + console.error(error) + return Promise.reject(error) + } } // request methods diff --git a/web/service/refresh-token.ts b/web/service/refresh-token.ts index 8bd22150414cea..b193779629e26e 100644 --- a/web/service/refresh-token.ts +++ b/web/service/refresh-token.ts @@ -1,11 +1,13 @@ import { apiPrefix } from '@/config' import { fetchWithRetry } from '@/utils' +const LOCAL_STORAGE_KEY = 'is_other_tab_refreshing' + let isRefreshing = false function waitUntilTokenRefreshed() { return new Promise((resolve, reject) => { function _check() { - const isRefreshingSign = localStorage.getItem('is_refreshing') + const isRefreshingSign = globalThis.localStorage.getItem(LOCAL_STORAGE_KEY) if ((isRefreshingSign && isRefreshingSign === '1') || isRefreshing) { setTimeout(() => { _check() @@ -22,13 +24,14 @@ function waitUntilTokenRefreshed() { // only one request can send async function getNewAccessToken(): Promise { try { - const isRefreshingSign = localStorage.getItem('is_refreshing') + const isRefreshingSign = globalThis.localStorage.getItem(LOCAL_STORAGE_KEY) if ((isRefreshingSign && isRefreshingSign === '1') || isRefreshing) { await waitUntilTokenRefreshed() } else { - globalThis.localStorage.setItem('is_refreshing', '1') isRefreshing = true + globalThis.localStorage.setItem(LOCAL_STORAGE_KEY, '1') + globalThis.addEventListener('beforeunload', releaseRefreshLock) const refresh_token = globalThis.localStorage.getItem('refresh_token') // Do not use baseFetch to refresh tokens. @@ -61,15 +64,21 @@ async function getNewAccessToken(): Promise { return Promise.reject(error) } finally { + releaseRefreshLock() + } +} + +function releaseRefreshLock() { + if (isRefreshing) { isRefreshing = false - globalThis.localStorage.removeItem('is_refreshing') + globalThis.localStorage.removeItem(LOCAL_STORAGE_KEY) + globalThis.removeEventListener('beforeunload', releaseRefreshLock) } } export async function refreshAccessTokenOrRelogin(timeout: number) { return Promise.race([new Promise((resolve, reject) => setTimeout(() => { - isRefreshing = false - globalThis.localStorage.removeItem('is_refreshing') + releaseRefreshLock() reject(new Error('request timeout')) }, timeout)), getNewAccessToken()]) } diff --git a/web/types/feature.ts b/web/types/feature.ts index 0d9b2ec18d2b9f..47e8e1aad1df79 100644 --- a/web/types/feature.ts +++ b/web/types/feature.ts @@ -4,6 +4,20 @@ export enum SSOProtocol { OAuth2 = 'oauth2', } +export enum LicenseStatus { + NONE = 'none', + INACTIVE = 'inactive', + ACTIVE = 'active', + EXPIRING = 'expiring', + EXPIRED = 'expired', + LOST = 'lost', +} + +type License = { + status: LicenseStatus + expired_at: string | null +} + export type SystemFeatures = { sso_enforced_for_signin: boolean sso_enforced_for_signin_protocol: SSOProtocol | '' @@ -15,6 +29,7 @@ export type SystemFeatures = { enable_social_oauth_login: boolean is_allow_create_workspace: boolean is_allow_register: boolean + license: License } export const defaultSystemFeatures: SystemFeatures = { @@ -28,4 +43,8 @@ export const defaultSystemFeatures: SystemFeatures = { enable_social_oauth_login: false, is_allow_create_workspace: false, is_allow_register: false, + license: { + status: LicenseStatus.NONE, + expired_at: '', + }, } diff --git a/web/types/workflow.ts b/web/types/workflow.ts index 3c0675b60572a3..34b08e878e855d 100644 --- a/web/types/workflow.ts +++ b/web/types/workflow.ts @@ -33,6 +33,7 @@ export type NodeTracing = { parent_parallel_id?: string parent_parallel_start_node_id?: string parallel_mode_run_id?: string + iteration_duration_map?: IterationDurationMap } metadata: { iterator_length: number @@ -44,6 +45,7 @@ export type NodeTracing = { name: string email: string } + iterDurationMap?: IterationDurationMap finished_at: number extras?: any expand?: boolean // for UI @@ -207,7 +209,10 @@ export type IterationNextResponse = { parallel_mode_run_id: string execution_metadata: { parallel_id?: string + iteration_index: number + parallel_mode_run_id?: string } + duration?: number } } @@ -323,3 +328,5 @@ export type ConversationVariableResponse = { total: number page: number } + +export type IterationDurationMap = Record diff --git a/web/utils/index.ts b/web/utils/index.ts index 7aa6fef0a88c09..cabad6c35c766b 100644 --- a/web/utils/index.ts +++ b/web/utils/index.ts @@ -8,10 +8,8 @@ export async function asyncRunSafe(fn: Promise): Promise<[Error] | [ try { return [null, await fn] } - catch (e) { - if (e instanceof Error) - return [e] - return [new Error('unknown error')] + catch (e: any) { + return [e || new Error('unknown error')] } } diff --git a/web/yarn.lock b/web/yarn.lock index 6f54ec23d4771b..9fddfc1948f6ea 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -6450,9 +6450,9 @@ elkjs@^0.9.0: integrity sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ== elliptic@^6.5.3, elliptic@^6.5.5: - version "6.5.7" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" - integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== + version "6.6.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.0.tgz#5919ec723286c1edf28685aa89261d4761afa210" + integrity sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA== dependencies: bn.js "^4.11.9" brorand "^1.1.0"