Follow-up to #16468.
PR #16468 fixed the Python
(`api/db/joint_services/tenant_model_service.py
split_model_name`) and Go (`internal/service/model_service.go
parseModelName`)
parsers to right-anchor the '@'-split on the composite
"model_name@instance@provider" key, but the matching helper in the
front-end
(`web/src/utils/llm-util.ts parseModelValue`) was missed.
parseModelValue used `split('@')` (anchored on the first '@'), which
silently
mangles composite keys whose model_name itself contains '@' (e.g. LM
Studio
embedding IDs like `text-embedding-nomic-embed-text-v1.5@q8_0`):
text-embedding-nomic-embed-text-v1.5@q8_0@lmstudio@LM-Studio
became
model_name: text-embedding-nomic-embed-text-v1.5
model_instance: q8_0@lmstudio
model_provider: LM-Studio
`PATCH /api/v1/models/default` then sent those to the server, which
returned
HTTP 200 with body `{"code": 102, "message": "Instance 'q8_0@lmstudio'
not
found for provider 'LM-Studio'"}`. The UI swallowed the body-level error
code, so the failure was silent: no toast, the Embedding field stayed
empty.
This change makes parseModelValue do a right-anchored split that mirrors
the
Python `split_model_name` `rsplit('@', 2)` exactly:
- 3-part form: model_name@instance@provider -> same three fields.
- 2-part form: model_name@provider -> model_instance defaults to
"default"
(matching Python).
- 4+-part form (embedded '@' in model name): last two fields are
anchored
as instance and provider, everything to the left is the bare model name.
`parseModelUuid` is updated to the same right-anchored split so the
factoryId portion of `model_name@factory_id[#instance]` keeps the last
'@'
as the separator even when the model name itself contains '@'.
Adds jest cases under `web/src/utils/tests/llm-util.test.ts` (12 total)
covering the plain 3-part, 2-part, 4-part, multi-'@' name,
buildModelValue
round-trip and parseModelUuid variants.
Note for reviewers: the front-end is bundled into the published docker
image, so a release containing this fix will need `docker compose build
--no-cache ragflow-cpu` (or equivalent) for it to be visible to end
users.
Refs #16468, #16467
Both backends serve GET /api/v1/language. Frontend calls it once and
caches. By this way, front end can know the backend is go or python and
thus can determine which part of logic to load.
---------
Co-authored-by: Claude <noreply@anthropic.com>
### Summary
We have updated our model driver to work with go.
It is based on OpenAI-API-Compatible model provider.
Draft
#15519
Our old model provider
#13425
### Summary
Adds FunASR as a self-hosted speech-to-text provider through its
OpenAI-compatible `/v1/audio/transcriptions` endpoint.
This is a focused replacement for #15526 by @Rene0422 and relates to
#15448. The unrelated Markdown parser changes from the previous branch
are intentionally removed so this PR contains only the FunASR provider
integration.
- register FunASR as a `SPEECH2TEXT` factory;
- add `FunASRSeq2txt` with `sensevoice` and `http://localhost:8000/v1`
defaults, an optional API key, URL normalization, and inherited
transcription handling;
- wire FunASR into the current local-provider schema with a prefilled
local URL and official documentation link;
- discover the server's `/v1/models` dynamically and expose every
returned model as speech-to-text in the model picker;
- use RAGFlow's existing default provider icon fallback instead of
referencing a missing `funasr` asset;
- list FunASR in the supported-provider documentation;
- add focused backend and frontend regression tests.
### Validation
- focused backend pytest suite -> `7 passed`
- real CPU `funasr-server` + RAGFlow provider smoke test -> discovered
`fun-asr-nano`, `sensevoice`, and `paraformer`; transcribed a real WAV
as `我现在在录一段测试音频` (`10` tokens, `0.504s`)
- `ruff check` and `ruff format --check` on the changed Python files
- `python3 -m py_compile` on the provider and its test
- JSON parse and a semantic assertion for exactly one enabled FunASR
`SPEECH2TEXT` factory
- focused frontend Jest test -> `2 passed`
- ESLint and Prettier on all changed TypeScript files
- `npm run build` -> production build succeeded (`14,181` modules
transformed)
- `git diff --check`
### Deployment
Run FunASR separately and point the RAGFlow provider at it:
```bash
pip install funasr
funasr-server --device cuda --model sensevoice
```
The API key remains optional because the stock local server does not
require authentication. A key can still be supplied when the endpoint is
protected by a gateway.
---------
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Co-authored-by: LauraGPT <LauraGPT@users.noreply.github.com>
### What problem does this PR solve?
- Clear stale pipeline IDs and generated data when updating documents
without `pipeline_id`.
- Support tree compilation results in pipeline workflows.
- Update compilation templates in place while preserving existing
template IDs.
- Improve duplicate-template validation messages.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
Co-authored-by: Jin Hai <haijin.chn@gmail.com>