Commit Graph

7381 Commits

Author SHA1 Message Date
zhifu gao
06e36d24f4 feat(stt): add FunASR / SenseVoice provider (#16473)
### 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>
2026-07-15 19:02:05 +08:00
Wang Qi
2223a514de Fix cancel ingest task, it will be stilling running and show internal server error (#836) (#16945) 2026-07-15 18:33:51 +08:00
Wang Qi
3b26688d68 Fix rename file only update the first linked dataset (#831) (#16947) 2026-07-15 18:33:26 +08:00
Jack
3d65e8d124 Revert frontend changes from PR #16873 (#16948) 2026-07-15 17:49:37 +08:00
euvre
70a49c947d Remove unused /datasets/<id>/embedding endpoint (#16936) 2026-07-15 17:42:41 +08:00
Wang Qi
77d35a3387 Fix agentbot cannot upload file (#828) (#16946) 2026-07-15 17:30:10 +08:00
buua436
4391e03886 refa: optimize knowledge compilation concurrency (#16933)
### What problem does this PR solve?

Improve concurrency in the knowledge compilation pipeline:

- Run Compile LLM requests concurrently while preserving ordered
commits.
- Run merge flush tasks concurrently while keeping ES writes ordered.
- Improve concurrency for local deduplication, chain validation, and ES
deduplication.
- Remove temporary debugging instrumentation and unused timing
variables.

### Type of change

- [x] Refactor (no functional change)
2026-07-15 16:24:35 +08:00
Lynn
63c010cd04 Fix: code-rabbit review comment (#16940) 2026-07-15 15:44:08 +08:00
Haruko386
166ed3c159 Json: add some aliyun models (#16926)
### Summary

As title
2026-07-15 15:42:54 +08:00
balibabu
33e224cc4f Feat: Modify the Chinese translation file for the knowledge compilation template. (#16941)
### Summary

Feat: Modify the Chinese translation file for the knowledge compilation
template.
2026-07-15 15:34:57 +08:00
Lynn
51fa76295f Fix: sort memory by create_time desc (#16942) 2026-07-15 15:00:39 +08:00
euvre
5184373a97 refactor: remove localStorage persistence for system model settings (#16934) 2026-07-15 14:58:32 +08:00
Jack
e543ff02c4 Feat: nats message processing refactor and support built in DSL (#16873) 2026-07-15 14:53:16 +08:00
maoyifeng
e082e69951 fix ci : only run web ci (#16939)
### Summary

fix  ci : only run web ci
2026-07-15 14:51:10 +08:00
chanx
30cc00bed2 feat(dataflow-result): scroll to and highlight newly created chunk (#16937) 2026-07-15 14:33:36 +08:00
Haruko386
14d361aa51 refactor: remove unused getInputElementsFromText function (#16927)
### Summary

Removed unused function getInputElementsFromText and its associated
comments.
2026-07-15 11:38:52 +08:00
Haruko386
a19af34d31 fix: unable to use agent in agent (#16910)
### Summary

As title

#### Agent:
<img width="3707" height="2030" alt="image"
src="https://github.com/user-attachments/assets/68480004-9c79-4302-ae22-eb3375b7fac9"
/>

#### Data_operations
<img width="3716" height="2044" alt="image"
src="https://github.com/user-attachments/assets/068cc1a6-1ba5-4746-a447-a706d2149ef5"
/>
2026-07-15 10:58:59 +08:00
Haruko386
215d291cfa fix: support email send for go backend (#16895)
### Summary

As title

<img width="3761" height="2036" alt="image"
src="https://github.com/user-attachments/assets/775f8c2a-784e-4713-bcf0-c26bfc368dac"
/>


<img width="1256" height="2760" alt="d2aeeb50dd11cc8dc76bc4743425680e"
src="https://github.com/user-attachments/assets/80f9c572-549d-427f-8e48-35dc04cfa98a"
/>
2026-07-15 10:56:36 +08:00
Haruko386
654279a745 fix: support code_execute for go backend (#16903)
### Summary

As title

<img width="3764" height="2033" alt="image"
src="https://github.com/user-attachments/assets/3f5084c2-0a04-4a44-bb31-a39a59c2a91f"
/>
2026-07-15 10:55:39 +08:00
Haruko386
3339040987 fix: add GetInputForm for string_transform (#16900)
### Summary

As title:

#### merge:
<img width="2972" height="1473" alt="image"
src="https://github.com/user-attachments/assets/2171e31f-13f4-4799-a6d0-1b9326210658"
/>

---
#### split
<img width="858" height="416" alt="image"
src="https://github.com/user-attachments/assets/f89d39e3-da85-4349-a53c-e27a17cc9dfa"
/>
2026-07-15 10:54:18 +08:00
Hz_
276941f7b4 fix(go-agent): add VariableAssigner input form (#16902)
## Summary

- Add the runtime input form for VariableAssigner components
- Allow the component input-form endpoint to resolve VariableAssigner
nodes

## Testing

- `bash build.sh --test ./internal/agent/component/...`
2026-07-15 10:47:49 +08:00
VincentLambert
5cf95d2c0f Fix: admin password update crashes for SSO users (500 'NoneType' object has no attribute 'split') (#16914)
### What problem does this PR solve?

Setting a password from the admin panel for an SSO-provisioned account
(OIDC/OAuth/GitHub) returns a **500** with:

```
'NoneType' object has no attribute 'split'
```

**Root cause** — SSO-provisioned accounts have no local password, so
`usr.password` is `None` (the `User.password` column is `null=True`). In
`UserMgr.update_user_password` (`admin/server/services.py`), the "same
password" optimization calls:

```python
if check_password_hash(usr.password, psw):
```

`werkzeug.security.check_password_hash(None, psw)` internally does
`pwhash.split("$")`, which raises `AttributeError: 'NoneType' object has
no attribute 'split'` → surfaced as a 500.

**Repro**
1. Configure an SSO channel (OIDC/OAuth) under `oauth` in the service
config.
2. Log in once via SSO so the account is auto-provisioned (created
without a local password).
3. In the admin panel, set/change that user's password.
4. → 500 `'NoneType' object has no attribute 'split'`.

**Fix** — guard the equality check with `usr.password`. A passwordless
(SSO) user skips the comparison and goes straight to setting the new
password, which is the desired behavior (it gives them a password
fallback in addition to SSO).

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dev-20260715
2026-07-14 23:30:35 +08:00
rayhan
75d9efa27c fix: remediate urllib3 CVEs (#16907) 2026-07-14 22:57:29 +08:00
Jin Hai
b506d8ec5f Go: add more frameworks (#16915)
### Summary

1. Add hooks for server init
2. Add hooks for router init
3. Add jaeger and otel related config

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-14 22:20:26 +08:00
Jin Hai
c242669a9d Go: fix bugs (#16911)
### Summary

1. Fix 'list users' in admin CLI
2. Change 3 slow test cases priority.

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-14 21:58:33 +08:00
Lynn
bd7a3bb878 Fix: align go provider apis with python apis (#16867)
### Summary

As title.

---------

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
Co-authored-by: Wang Qi <wangq8@outlook.com>
2026-07-14 21:06:11 +08:00
Wang Qi
55d5879622 Fix file link-to-datasets to suport both replace and add (#817) (#16908) 2026-07-14 20:12:31 +08:00
chanx
376a9057a8 fix(setting-model): keep newly saved instance card expanded after name save (#16904) 2026-07-14 20:11:45 +08:00
Wang Qi
3087eb854c Fix Agent bot 2 permission bugs (#818) (#16909) 2026-07-14 20:11:16 +08:00
hyotaek kim
760203be42 fix(agent): preserve zero temperature setting (#16897)
### Summary

- Preserve an explicitly enabled `temperature=0` in the Agent LLM
configuration.
  - Continue excluding invalid negative temperature values.
  - Add a focused regression test to the existing Agent LLM test file.

  Fixes #16683
2026-07-14 20:10:51 +08:00
Jin Hai
26161ce844 Go: refactor (#16906)
### Summary

remove and merge code

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-14 19:29:34 +08:00
Paul Y Hui
a5a6dcfd5d Fix: Refine the git ignore file to exclude dependencies (#16882)
### Summary
Refined the git ignore file to exclude the dependencies when working new PR.
2026-07-14 19:10:51 +08:00
euvre
22dd1ad401 fix: resolve provider name case mismatch and 301 redirect in Go mode (#16889) 2026-07-14 17:05:21 +08:00
euvre
315e5725c2 Fix: Search mind map not displaying (#16866) 2026-07-14 17:04:47 +08:00
Jin Hai
eb506221c3 Update dockerfile (#16893)
### Summary

To reuse docker building cache

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-14 16:08:15 +08:00
chanx
e5bc644c18 fix(tree-select): avoid incorrect node selection when value is empty (#16898)
### Summary

fix(tree-select): avoid incorrect node selection when value is empty

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-14 15:53:54 +08:00
balibabu
ee142794ac Feat: Use G6 to display mind map data. (#16899)
### Summary

Feat: Use G6 to display mind map data.
2026-07-14 15:53:37 +08:00
Julian
3dd454190c Update knowledge base configuration instructions (#15345) 2026-07-14 15:36:43 +08:00
Hz_
ea18ab3ba0 fix(go-agent): align ExeSQL component inputs with Python (#16896)
## Summary

- Resolve configured ExeSQL SQL references before tool invocation.
- Align ExeSQL parameters, defaults, JSON tags, and tool schema with
Python.
- Preserve SQL string literals and restore Canvas output fields.

## Testing

- `bash build.sh --test ./internal/agent/tool/...`
- `bash build.sh --test ./internal/agent/component/...`
- `bash build.sh --test ./internal/agent/runtime/...`

<img width="2039" height="1041" alt="image"
src="https://github.com/user-attachments/assets/9f4beca7-ca28-4641-adda-0570415fcaa1"
/>
2026-07-14 15:02:28 +08:00
Haruko386
7a20920b12 fix: unable to send email for py backend (#16888)
### Summary

As title

Can send email now
<img width="2313" height="1941" alt="image"
src="https://github.com/user-attachments/assets/c129b3c7-7e40-4bdd-8430-f3b402b9cab1"
/>
<img width="1256" height="2760" alt="f6ba88c56fe3945a6d28564fc4d4c54f"
src="https://github.com/user-attachments/assets/ae2dbe0c-e2d4-494f-8b86-03e959ef4808"
/>
2026-07-14 14:59:06 +08:00
Haruko386
9289a183a2 fix: support keenable component (#16884)
### Summary

As title


<img width="3763" height="2042" alt="image"
src="https://github.com/user-attachments/assets/0bcf2d41-9475-4d22-b8f0-64a527e22aba"
/>
2026-07-14 14:57:22 +08:00
balibabu
654fc8851a Feat: Add a three-level dropdown menu to the talk page message box. (#16886)
### Summary

Feat: Add a three-level dropdown menu to the talk page message box.
2026-07-14 13:45:31 +08:00
balibabu
4b7c5b338e Feat: Adjust the timeline style. (#16894)
### Summary

Feat: Adjust the timeline style.
2026-07-14 13:45:02 +08:00
Haruko386
3fe9d291fb fix: support doc generator component (#16858)
### Summary

As title

<img width="3165" height="2011" alt="image"
src="https://github.com/user-attachments/assets/6947aa4f-5dfd-4d8c-b6af-82015b1f1537"
/>

---

<img width="3735" height="1721" alt="image"
src="https://github.com/user-attachments/assets/3a7ec8e8-d5b9-4195-bba9-c435218f6142"
/>
2026-07-14 13:17:30 +08:00
Jin Hai
13236698a6 Update test framework (#16875)
### Summary

1. add colorful print
2. update the test priority

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-14 12:42:58 +08:00
dependabot[bot]
f7f89b24cf build(deps): bump json-repair from 0.35.0 to 0.60.1 (#16887) 2026-07-14 12:41:41 +08:00
balibabu
999eb533a9 Feat: Adjust the color and size of the graph based on the data. (#16868) dev-20260714 2026-07-14 10:20:31 +08:00
Zhichang Yu
d279aee1ff Go ports of workflow and chunker fixes (#16878)
Ports two Python fixes to Go: the variable_ref_patt underscore/colon fix
(#16792) and the TokenChunker upstream-chunks fix (#16825). Keeps Go
behavior aligned with upstream Python.
2026-07-13 23:32:07 +08:00
Yash Raj Pandey
e54e7ec7ef Fix: TokenChunker discards TitleChunker chunks when output_format is 'chunks' (#16825)
Fixes #16812

### Problem
In the `rag/flow` ingestion pipeline, when `TitleChunker` feeds
`TokenChunker`, the chapter-aware chunks are silently discarded and the
parser's raw flat json is re-chunked instead.

`TitleChunker` emits `output_format="chunks"` and writes its
chapter-aware output to the `chunks` field
(`rag/flow/chunker/title_chunker/common.py`,
`set_output("output_format", "chunks")`). But `TokenChunker._invoke`
only handles `output_format` in `["markdown", "text", "html"]`, then
falls through to the `# json` path which reads
`from_upstream.json_result`. There is no branch for `"chunks"`, so
`from_upstream.chunks` is never read.

Downstream effects reported in #16812: PageIndex/TOC extraction receives
flat line-level text instead of structured chapter blocks
(incorrect/duplicate/missing chapters), and retrieval quality degrades
because chunks are no longer aligned to document structure.

### Fix
Select the source list based on `output_format`, mirroring the exact
pattern already used in `title_chunker/common.py`:

```python
json_result = (from_upstream.chunks if from_upstream.output_format == "chunks" else from_upstream.json_result) or []
```

`chunks` items share the same dict shape as `json_result` items (both
consumed via `.get("text")`, `.get("doc_type_kwd")`, etc.), so they flow
through the existing token-sizing path unchanged. One-line change, no
behavior change for the `json`/`markdown`/`text`/`html` paths.

### Test
Adds `rag/flow/tests/test_token_chunker.py`, an isolated unit test that
runs the real `TokenChunker._invoke` (heavy deps stubbed; real pydantic
schema used when available) and asserts that with
`output_format="chunks"` the upstream `chunks` are consumed rather than
the raw parser `json`.

Verified RED -> GREEN: the test fails against the current code (reads
the raw json) and passes with the fix.

Signed-off-by: Yash Raj Pandey <yashpn62@gmail.com>
2026-07-13 22:04:56 +08:00
Taranum Wasu
d48fd37ff1 fix(agent): allow underscores in variable_ref_patt component_id (#16758) (#16792)
## Summary

`ComponentBase.variable_ref_patt` (and its duplicate in
`agent.canvas.Graph.get_value_with_variable`) is the regex the canvas
runtime uses to find `cpn_id@var_nm` template refs in component prompts.

The `cpn_id` half was constrained to `[a-zA-Z:0-9]+`, which silently
dropped underscores. Component ids emitted by the frontend all contain
underscores (`userfillup_abc`, `retrieval_xyz`, `llm_0`, `message_0`,
…), so any template ref like `{userfillup_abc@line}` failed to match.
The placeholder then leaked through to the LLM verbatim, and the Agent
answered only its system-prompt directive.

This is exactly the "unconsidered await response" symptom in #16758:

```
Begin(Task) -> Await response -> Agent -> Message
```

Widen `cpn_id` from `[a-zA-Z:0-9]+` to `[a-zA-Z0-9_]+`. Bare `{line}`
(no cpn_id) remains unrecognised so it stays literal until the user
wires it up — matching the existing `VARIABLE_REF_PATTERN` shape used by
`agent.dsl_migration` for the same purpose.

## Changes

- `agent/component/base.py` — fix `variable_ref_patt` class attribute.
- `agent/canvas.py` — same fix applied to the inline regex inside
`Graph.get_value_with_variable` (kept as the literal regex to avoid
coupling the two unrelated sites).
-
`test/testcases/test_web_api/test_canvas_app/test_variable_ref_pattern_unit.py`
— new regression test pinning both the regex shape and end-to-end
resolution.

## Regression coverage

```
test_variable_ref_patt_matches_underscored_component_ids     PASSED
test_variable_ref_patt_still_matches_legacy_ids              PASSED
test_get_input_elements_from_text_resolves_underscored_id    PASSED
test_string_format_substitutes_underscored_ref                PASSED
test_variable_ref_patt_does_not_match_bare_var_name          PASSED
```

All five regression tests fail against the pre-fix regex (verified via
`git stash` round trip — drop fix, tests fail, restore fix, tests pass).

The two targeted existing tests in the same directory
(`test_fillup_unit.py`, `test_iterationitem_unit.py`) continue to pass.

## Repro before the fix

```python
import re
patt = r"\{* *\{([a-zA-Z:0-9]+@[A-Za-z0-9_.-]+|sys\.[A-Za-z0-9_.]+|env\.[A-Za-z0-9_.]+)\} *\}*"
list(re.finditer(patt, "{userfillup_abc@line}"))
# => []   # <-- bug
```

## Repro after the fix

```python
import re
patt = r"\{* *\{([a-zA-Z0-9_]+@[A-Za-z0-9_.-]+|sys\.[A-Za-z0-9_.]+|env\.[A-Za-z0-9_.]+)\} *\}*"
list(re.finditer(patt, "{userfillup_abc@line}"))
# => [<re.Match object; span=(0, 24), match='{userfillup_abc@line}'>]
```

Fixes #16758

## Test plan

- [x] New unit tests pass
- [x] Reverse-apply the fix and confirm the regression tests fail (they
do)
- [x] `test_fillup_unit.py` (existing sibling suite) still passes
- [x] `test_iterationitem_unit.py` (existing sibling suite) still passes
- [ ] Project CI green

---------

Co-authored-by: Taranum01 <taranum01@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 22:03:48 +08:00