Skip to content

feat(audio): timestamp-anchored chunking for audio/video ingestion - #15868

Closed
dale053 wants to merge 298 commits into
infiniflow:mainfrom
dale053:feat/timestamp-anchored-audio-video-chunks
Closed

dale053 wants to merge 298 commits into
infiniflow:mainfrom
dale053:feat/timestamp-anchored-audio-video-chunks

Conversation

@dale053

@dale053 dale053 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Closes #15867

What problem does this PR solve?

Audio and video ingestion (rag/app/audio.py, rag/app/picture.py) produced a single flat chunk containing the full transcript with no timing metadata. Whisper-compatible ASR APIs return per-segment start/end timestamps, but sequence2txt_model.py used response_format="json" and discarded that structure, while audio.py called tokenize() on the raw string with no positional data attached to the resulting chunk.

This meant retrieval against long recordings (calls, lectures, meetings) returned the entire transcript with no way to locate or play back the relevant moment.

Type of change

  • New Feature (non-breaking change which adds functionality)

Changes

File What changed
rag/llm/sequence2txt_model.py Added transcription_with_timestamps() to Base (fallback returns a single untimed segment). GPTSeq2txt overrides it using response_format="verbose_json" + timestamp_granularities=["segment"] to extract real start/end per segment. XinferenceSeq2txt overrides it via its raw HTTP path. All other providers inherit the safe fallback.
api/db/services/llm_service.py Added LLMBundle.transcription_with_timestamps() wrapper, matching the pattern of the existing transcription() method.
rag/app/audio.py chunk() now calls transcription_with_timestamps(). When timing is present, _build_windowed_chunks() groups segments into configurable fixed-duration windows (default 60 s, overridable via parser_config["chunk_duration_seconds"]). Each chunk carries start_time_flt, end_time_flt, chunk_order_int, and doc_type_kwd="audio". Falls back to the original single-chunk path when the provider returns no timestamps — fully backward-compatible.
rag/nlp/search.py Added start_time_flt and end_time_flt to the default _source projection so they are fetched on every retrieval call. Added the fields to all three chunk-dict assembly sites.
api/apps/restful_apis/chunk_api.py Both the single-chunk GET path and the search-results loop now expose start_time, end_time, and doc_type in the API response. No index migration needed — ES/Infinity auto-type _flt-suffixed fields as float.

Backward compatibility

  • Existing audio chunks stored without timestamps simply omit start_time_flt/end_time_flt; both fields are optional (None) in the response.
  • Providers without timestamp support (Tencent Cloud, QWen, ZhipuAI, etc.) receive the default Base.transcription_with_timestamps() which delegates to the existing transcription() and returns a single untimed segment — the chunking path is identical to before.

writinwaters and others added 30 commits May 25, 2026 20:23
…15219)

### What problem does this PR solve?

Minimum Python version increased to 3.13.

### Type of change


- [x] Documentation Update
…t. (infiniflow#15218)

### What problem does this PR solve?

Fix: The prompt variable for the agent operator disappears after input.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
… loop nesting) (infiniflow#14761)

## Summary

Fixes the confirmed asyncio anti-patterns from infiniflow#14755. Only the three
verified bugs are addressed; patterns already correctly using
`asyncio.new_event_loop()` in a fresh thread are left untouched.

### Changes

**`api/apps/restful_apis/tenant_api.py` — fire-and-forget
`send_invite_email`**

`asyncio.create_task()` was called without storing the `Task` reference.
CPython's GC can collect an unfinished task, silently cancelling it and
swallowing exceptions. Fixed by storing the task in a module-level
`_background_tasks: set[Task]` with a `done_callback` to discard it on
completion — the standard Python idiom for safe background tasks.

**`api/apps/restful_apis/agent_api.py` — fire-and-forget
`background_run`**

Same root cause in the webhook "Immediately" execution path. Same fix
applied.

**`rag/llm/chat_model.py` (`LocalLLM._stream_response`) —
`asyncio.get_event_loop()` on running loop**

`asyncio.get_event_loop()` returns Quart's running event loop when
called from an async context.
Calling `loop.run_until_complete()` on it raises `RuntimeError`.
Replaced with `asyncio.new_event_loop()` so the generator
uses a dedicated fresh loop, closed in a `finally` block.

## What was NOT changed

- `llm_service._sync_from_async_stream` and
`evaluation_service._sync_from_async_gen`: both already correctly use
`asyncio.new_event_loop()` inside a fresh thread.
- `llm_service._run_coroutine_sync`: only caller is `rag/app/resume.py`
(sync context), so `thread.join()` is correct there.
- `requests` in agent tools: sync methods dispatched through thread
pools; httpx migration is a separate, larger refactor.

## Test plan

- [ ] Invite a team member and confirm the email is sent with no task
warnings in logs.
- [ ] Trigger a webhook agent in "Immediately" mode; confirm canvas
state is persisted after background run.
- [ ] Verify `LocalLLM` (Jina backend) chat and streaming work
end-to-end.

Closes infiniflow#14755

---------

Co-authored-by: Zhichang Yu <[email protected]>
…orking infiniflow#15175 (infiniflow#15177)

### What problem does this PR solve?

Fix [Bug]: Save parser configs in dataset configuration page is not
working infiniflow#15175

### Type of change

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

### What problem does this PR solve?

extend restful api suite

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Other (please describe): test
### What problem does this PR solve?

Closes infiniflow#15142.

ZhipuAI lists `glm-ocr` as an OCR model, but the Go driver still
returned `no such method` from `OCRFile`. This wires the advertised
model to Z.AI's documented `layout_parsing` endpoint and returns the
`md_results` Markdown output through the existing `OCRFileResponse.Text`
field.

This PR also adds focused tests for URL input, raw file-content base64
input, and validation errors.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

### Test

- [x] `go test -vet=off ./internal/entity/models -run
'TestZhipuAIOCRFile'`
### What problem does this PR solve?

Closes infiniflow#15167.

The Baidu Go provider advertises OCR support through
`paddleocr-vl-0.9b`, but `BaiduModel.OCRFile` dereferenced required
inputs before validating them. Calling OCR with a missing API config,
API key, or model name could panic instead of returning a normal error.

This PR adds explicit input validation for those required values.

### Type of change

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

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

Add a Go driver for **FuturMix** (https://futurmix.ai/docs), one of the
unchecked providers on the umbrella tracking issue infiniflow#14736. FuturMix is
documented as an "OpenAI-compatible API" aggregator over Claude / GPT /
Gemini / DeepSeek (~22 models per their `/models` page).

Until this PR, a tenant who configured `futurmix` as a model provider in
the Go layer fell through to the default branch of
`internal/entity/models/factory.go` and got the dummy driver.

---------

Co-authored-by: sxxtony <[email protected]>
Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

The Go DeepInfra driver returned a stub error for `Rerank()` even though
DeepInfra serves reranker models at `POST /v1/inference/{model}` with
`query`, `documents`, and a `scores[]` response.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: Cursor <[email protected]>
…ow#15201)

### What problem does this PR solve?

Creating or updating an agent via `POST /api/v1/agents` and `PUT
/api/v1/agents/{agent_id}` did not persist `canvas_type` because the
handler `req` dict never assigned the field before
`UserCanvasService.save` / `update_by_id`.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

Co-authored-by: Cursor <[email protected]>
Fix: empty file with better message
### What problem does this PR solve?

Fix: Fixed metadata issue

- The dataset's built-in metadata is now active, but it appears to be
disabled in the individual file configuration.

### Type of change

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

### What problem does this PR solve?

extend restful api suite

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Other (please describe): test
## Summary

Closes infiniflow#15165.

Implements the AWS Bedrock model provider for the Go API server, tracked
under infiniflow#14736. Adds Converse + Converse-Stream chat and foundation-model
listing, with SigV4 signing over a hand-rolled `net/http` path that
matches the established pattern in `internal/entity/models/` (no new
direct `go.mod` deps).

## Linked tracker

Tracked under infiniflow#14736 (Implement model providers of RAGFlow API server in
Go). Closes infiniflow#15165.
## Summary
- Wire the Go TokenHub provider through the model factory.
- Harden TokenHub request handling for chat, streaming, embeddings, and
model listing.
- Add focused TokenHub unit coverage for factory wiring and provider
behavior.

## Notes
- Refs infiniflow#14736.
- Follows up infiniflow#15159.

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

  This PR adds HuaweiCloud provider integration in RAGFlow.

  Supported capabilities:

  - [x] Chat / Think Chat / Stream Chat / Stream Think Chat
  - [x] Embedding
  - [x] Rerank
  - [x] Model listing
  - [x] Provider connection checking

  Verified examples from the CLI:

  ```
  check instance 'test' from 'HuaweiCloud';

  chat with 'deepseek-v4-flash@test@HuaweiCloud' message 'hello';

  think chat with 'deepseek-v4-flash@test@HuaweiCloud' message 'hello';

  stream chat with 'deepseek-v4-flash@test@HuaweiCloud' message 'hello';

stream think chat with 'deepseek-v4-flash@test@HuaweiCloud' message
'hello';

embed text 'what is rag' 'who are you' with 'bge-m3@test@HuaweiCloud'
dimension 1024;

rerank query 'what is rag' document 'rag is retrieval augmented
generation' 'rag need llm' 'famous rag
project includes ragflow' with 'bge-reranker-v2-m3@test@HuaweiCloud' top
3;

  list supported models from 'HuaweiCloud' 'test';

  LIST MODELS FROM 'HuaweiCloud' 'test';
```
  ### Type of change

  - [x] New Feature
  - [x] Provider integration
Closes infiniflow#15040.

ModelScope was listed unchecked in the Go-rewrite tracker infiniflow#14736 and
already had an llm_factories.json entry (tags: LLM) but no Go driver, so
the new Go API server could not route ModelScope instances. The Python
side has supported it through the OpenAI-compatible base at
rag/llm/chat_model.py:618 (ModelScopeChat), which requires a
user-supplied base URL and appends /v1.

This adds:
- internal/entity/models/modelscope.go: self-hosted OpenAI-compatible
driver with chat (sync + SSE stream with idle-timeout cancellation),
list_models, and check_connection. Auth header is optional, matching the
xinference pattern, so deployments without auth and auth-enabled
deployments both work. Base URL is normalized so users can configure
either the root endpoint or the /v1 endpoint.
- internal/entity/models/modelscope_test.go: 12 tests covering name, URL
normalization, factory routing, chat happy path / auth header /
reasoning_content extraction, stream happy path / stream=false rejection
/ idle cancellation, list_models + check_connection, missing-base-URL
clear error, and the no-such-method sentinels.
- conf/models/modelscope.json: shipped config (class: "local",
url_suffix v1/chat/completions and v1/models).
- internal/entity/models/factory.go: case "modelscope" →
ModelScopeModel.
- internal/service/llm.go: ModelScope added to the selfDeployed map
alongside Ollama, Xinference, LocalAI, LM-Studio, GPUStack — the Python
side requires user-supplied URL with no default, so the Go side
classifies it the same way.

Follow-on issues will add Embed and Rerank, in line with how Novita,
NVIDIA, TogetherAI, and other providers landed method-by-method.

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

implement provider `OrcaRouter`
**The following functionalities are now supported:**

**Cohere:**
- [x] Chat / Think Chat / Stream Chat / Stream Think Chat
- [x] Model listing
- [x] TTS
- [ ] Balance


### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Jin Hai <[email protected]>
…iflow#15248)

### What problem does this PR solve?

- Update version tags in README files (including translations) from
v0.25.5 to v0.25.6
- Modify Docker image references and documentation to reflect new
version
- Update version badges and image descriptions
- Maintain consistency across all language variants of README files

### Type of change

- [x] Documentation Update
### What problem does this PR solve?

Initial draft: v0.25.6 release notes.

### Type of change

- [x] Documentation Update
## Summary
- add the xAI `models` URL suffix used by the existing Go `ListModels`
implementation
- return a clear error when the xAI models suffix is missing
- add focused xAI model-listing and connection-check regression tests

## What changed
- Added `url_suffix.models` to `conf/models/xai.json`.
- Normalized the configured models suffix before building the request
URL.
- Covered config loading, successful model listing, upstream errors,
API-key validation, missing suffix handling, and `CheckConnection`
delegation.

## Why
`XAIModel.ListModels` already builds requests from `URLSuffix.Models`,
and `CheckConnection` delegates to that method. The bundled xAI config
did not define that suffix, which left the model-listing path unable to
call the provider `/models` endpoint from the existing provider config.

## Validation
- `go test ./internal/entity/models -run TestXAI -count=1`
- `go test ./internal/entity -count=1`
- `git diff HEAD~1..HEAD --check`

## Notes
- `go test ./internal/entity/models -count=1` currently fails in
unchanged Astraflow coverage: `TestAstraflowEmbedReturnsNoSuchMethod`
panics before reaching any xAI assertions.

---------

Co-authored-by: Jin Hai <[email protected]>
## Summary
- Add LongCat model-list support through the documented
OpenAI-compatible models endpoint.

## What changed
- Add the LongCat `models` URL suffix for `/openai/v1/models`.
- Implement `ListModels` for the LongCat Go driver.
- Delegate `CheckConnection` to the lightweight model-list request.
- Add focused regression coverage for successful, malformed, oversized,
and missing-key responses.

## Why
LongCat documents a models endpoint under the OpenAI-compatible API
surface, but the Go driver still returned `no such method` for model
listing and connection checks.

## Validation
- `go test ./internal/entity/models -run TestLongCat -count=1`
- `go test -race ./internal/entity/models -run TestLongCat -count=1`
- `go test ./internal/entity -count=1`
- `git diff --check`

## Notes
- Related to the broader Go model provider tracking in infiniflow#14736, but this
PR only handles LongCat model listing.
- `go test ./internal/entity/models -count=1` is currently blocked by an
unrelated Astraflow test panic outside this LongCat change.

---------

Co-authored-by: Jin Hai <[email protected]>
…w#15233)

## Summary
- route hosted MinerU.Net and PaddleOCR.Net provider names to their
existing Go drivers
- add regression coverage for loading the hosted OCR provider configs
through ProviderManager

## What changed
- Added canonical provider-name aliases for the hosted OCR provider
display names.
- Covered both bundled configs with a focused provider-manager test.

## Why
The hosted provider configs use display names with `.Net`, while model
factory dispatch lowercases the provider name. Without aliases, those
configs fall through to `DummyModel` instead of using the existing
MinerU and PaddleOCR drivers.

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

v0.25.6 release notes draft updated.

### Type of change

- [x] Documentation Update
### What problem does this PR solve?

Fix: The Creativity parameter of chat was not saved.
### Type of change

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

### What problem does this PR solve?

extend restful api suite

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Other (please describe): test
## Summary
- add the VolcEngine `models` URL suffix used by the existing Go
`ListModels` implementation
- return a clear error when the VolcEngine models suffix is missing
- add focused VolcEngine model-listing regression tests

## What changed
- Added `url_suffix.models` to `conf/models/volcengine.json`.
- Normalized the configured models suffix before building the request
URL.
- Covered config loading, successful model listing, upstream errors, and
missing suffix handling.

## Why
`VolcEngine.ListModels` already builds requests from `URLSuffix.Models`,
but the bundled VolcEngine config did not define that suffix. That left
the model-listing path unable to call the documented `/models` endpoint
from the existing provider config.

Fixes infiniflow#14701

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

This PR adds Qiniu provider integration for the Go model driver layer in
RAGFlow.

  Supported capabilities:

  - [X] Chat
  - [X] Think Chat
  - [X] Stream Chat
  - [X] Stream Think Chat
  - [X] Model listing
  - [X] Provider configuration and factory registration

  Verified examples from the CLI:

  ```
  login user '***' password '***';

  ADD PROVIDER 'qiniu';

  CREATE PROVIDER 'qiniu' INSTANCE 'test' KEY '***';

chat with 'deepseek/deepseek-v3.1-terminus-thinking@test@qiniu' message
'hello';

think chat with 'deepseek/deepseek-v3.1-terminus-thinking@test@qiniu'
message 'hello';

stream chat with 'deepseek/deepseek-v3.1-terminus-thinking@test@qiniu'
message 'hello, what are you';

stream think chat with
'deepseek/deepseek-v3.1-terminus-thinking@test@qiniu' message 'hello,
what are you';

stream think chat with 'qwen3-max-2026-01-23@test@qiniu' message 'hello,
what are you';

  LIST MODELS FROM 'qiniu' 'test';

```

  ### Type of change

  - [X] New Feature
  - [X] Provider integration
### What problem does this PR solve?

Closes infiniflow#15090.

Adds GiteeAI support to the Go model-provider layer so GiteeAI chat
models can be routed through the Go API server using the same
OpenAI-compatible chat, streaming, model listing, and connection-check
flow used by other SaaS providers.

GiteeAI is implemented as a separate provider from the existing `gitee`
provider.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

## Summary

- Added a GiteeAI Go model driver.
- Added the GiteeAI provider catalog with default base URL
`https://ai.gitee.com/v1`.
- Registered `giteeai` in the model factory separately from `gitee`.
- Added focused provider tests for sync chat, streaming chat, model
listing, connection checks, base URL override, SSE parsing, `[DONE]`
handling, and unsupported methods.

## What changed

- Implemented `ChatWithMessages` for `POST /chat/completions`.
- Implemented `ChatStreamlyWithSender` with SSE parsing, `delta`
extraction, `finish_reason`, `[DONE]`, and `<think>` tag handling.
- Implemented `ListModels` for `GET /models`.
- Implemented `CheckConnection` by delegating to `ListModels`.
- Returned standard `no such method` errors for unsupported embedding,
rerank, image-to-text, ASR, and TTS paths.

## Tests

```bash
go test -vet=off ./internal/entity/models -run 'TestGiteeAI' -count=1
go test -vet=off ./internal/entity -run 'Test.*Provider|Test.*Model' -count=1
```

---------

Co-authored-by: Jin Hai <[email protected]>
euvre and others added 17 commits June 8, 2026 19:08
…nfiniflow#15780)

### What problem does this PR solve?

Table parser metadata aggregation previously only ran when
`table_column_mode` was set to `manual`. In auto mode (default), all
columns default to `"both"` role, meaning they should also be aggregated
into document-level metadata for UI/chat filters. Additionally, the task
snapshot could be stale — `table_column_names` are written to KB
`parser_config` during `chunk()` but the task may have been created
before that.

Changes:
- Renames `aggregate_table_manual_doc_metadata` →
`aggregate_table_doc_metadata`
- Supports both `"manual"` and `"auto"` `table_column_mode` (defaults to
`"auto"`)
- Reloads `table_column_names` from KB DB when missing from task
snapshot
- Removes the manual-only guard in `task_executor` and refactored
`post_processor`
- Updates all tests with new function name and adds auto mode test cases

### Type of change

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

### What problem does this PR solve?

fix: Resolve error when checking pipeline parsing result

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…ow#15773)

### What problem does this PR solve?

Fix: Add a waiting status to the messages on the chat page.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?

Fix LM-Studio provider connection verification so embedding checks await
the async wrapper correctly and log the full traceback on failures.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Fix OpenRouter key JSONDecodeError
…5528)

## Summary
- keep Moonshot chat calls in non-streaming mode and streaming calls in
SSE mode
- make Moonshot model listing and balance checks use bodyless GET
requests
- add focused Moonshot request/response regression tests
### What problem does this PR solve?

**Verified from CLI**
```
RAGFlow(user)> chat with 'mimo-v2.5@test@xiaomi' message 'who r u'
Answer: Hello! I'm MiMo-v2.5, a large language model developed by Xiaomi's LLM Core Team. You can think of me as a friendly AI assistant ready to help you answer questions, have conversations, or work on creative tasks. My context window can handle up to 1 million tokens, so we can dive into pretty long discussions or documents if you'd like. What can I help you with today?
Time: 3.831830

RAGFlow(user)> stream chat with 'mimo-v2.5@test@xiaomi' message 'who r u'
Answer:  there! I'm MiMo-v2.5, an AI assistant created by the Xiaomi LLM Core Team. I'm here to chat, help out, answer questions, or just have a friendly conversation. Think of me as a helpful buddy with a pretty big memory (1 million tokens worth!). What can I do for you today?😊
Time: 2.421630

RAGFlow(user)> think chat with 'mimo-v2.5@test@xiaomi' message 'who r u'
Thinking: The user is asking a simple question about who I am. According to my system prompt, I should:
- Identify myself as **MiMo-v2.5**
- State that I was developed by the **Xiaomi LLM Core Team**
- Answer in first person and be warm and conversational
Answer: Hey there! 👋

I'm **MiMo**, an AI assistant created by the **Xiaomi LLM Core Team**. Think of me as a friendly chat buddy who's here to help you with all sorts of questions and tasks!

I love having conversations, answering questions, brainstorming ideas, and helping people figure things out. Whether you want to chat, need help with something specific, or just want to explore ideas together — I'm here for it! 😊

What can I help you with today?
Time: 6.651589

RAGFlow(user)> tts with 'mimo-v2.5-tts@test@xiaomi' text 'hello? show yourself' play format 'wav' param '{"voice": "Chloe"}'
SUCCESS

RAGFlow(user)> asr with 'mimo-v2.5-asr@test@xiaomi' audio './internal/test.wav' param '{"language": "zh"}'
+------------------------------------------------------------------------------------------------------------------------+
| text                                                                                                                   |
+------------------------------------------------------------------------------------------------------------------------+
| 1 The examination and testimony of the experts enabled the commission to conclude that five shots may have been fired. |
+------------------------------------------------------------------------------------------------------------------------+
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring
## Summary

Fixes typoed model-provider URL suffix keys and adds strict nested
decoding so future URL suffix config mistakes fail during provider
loading instead of being silently ignored.
## Summary
- keep MiniMax chat calls in non-streaming mode and streaming calls in
SSE mode
- make MiniMax model listing and connection checks use a bodyless GET
/v1/models
- add focused MiniMax request/response regression tests
## Summary

Normalizes Qwen model-family names before reasoning extraction so
provider-prefixed Qwen models use the existing `<think>...</think>`
fallback.
Delete not supported model providers list
## What problem does this PR solve?

Go test files are never compiled in CI — only production binaries via
`go build`. This allowed a missing `"sort"` import in
`metadata_filter_test.go` to be merged without detection.

## Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)

## Changes

- Add `go test -count=1 ./internal/...` step after Go build in CI
workflow
- Fix missing `"sort"` import in `metadata_filter_test.go` (pre-existing
compile error)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
### What problem does this PR solve?

Support model list for VolcEngine.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
…e detection) (infiniflow#15489)

### What problem does this PR solve?

`is_english()` in `rag/nlp/__init__.py` compiles a **single-character**
regex class and `fullmatch`es it against each item:

```python
pattern = re.compile(r"[`a-zA-Z0-9\s.,':;/\"?<>!\(\)\-]")   # no quantifier
...
eng = sum(1 for t in texts if pattern.fullmatch(t.strip()))
```

For a **string** argument the text is first split into single characters
(`texts = list(texts)`), so each `fullmatch` sees one character and
works. But for a **list** argument each item is a whole multi-character
string, and `fullmatch` of a one-character pattern against a
multi-character string always fails — so `is_english()` returns `False`
for **any** list, regardless of content.

```python
is_english("This is English")                              # True   (ok)
is_english(["The quick brown fox jumps.", "Hello world."]) # False  (bug — should be True)
is_english(["这是中文。"])                                    # False  (right answer, wrong reason)
```

Many call sites pass lists and were therefore silently always-`False`,
e.g.:

- `rag/llm/chat_model.py:1088`, `rag/llm/cv_model.py:168,1155` —
`is_english([ans])` when an answer is truncated at `max_tokens`, so an
English reply gets the Chinese "······由于长度的原因,回答被截断了,要继续吗?" continuation
suffix instead of the English one.
- `rag/app/book.py` — `remove_contents_table(...,
eng=is_english([...sections...]))`, so English books have their contents
table stripped in Chinese mode.
- `common/doc_store/es_conn_base.py:339`,
`rag/utils/opensearch_conn.py:733` — `is_english(txt.split())` in
highlight handling.
- plus `rag/app/qa.py`, `rag/flow/parser/utils.py`,
`common/doc_store/infinity_conn_base.py`.

### Fix

Add a `+` quantifier so an all-English multi-character item matches:

```python
pattern = re.compile(r"[`a-zA-Z0-9\s.,':;/\"?<>!\(\)\-]+")
```

The string path is unchanged (single characters still match) and
non-English lists still return `False`. Adds
`test/unit_test/rag/test_is_english.py`; the two list cases fail before
this change and pass after.

### Type of change

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

Used the Claude CLI while working on this.
…infiniflow#15787)

## Problem

`TestXiaomiNewModelWithCustomDefaultTransport` panics on Go 1.25:

```
panic: interface conversion: http.RoundTripper is models.roundTripperFunc, not *http.Transport
```

In Go 1.25, `http.DefaultTransport` is no longer `*http.Transport`, so
the unchecked type assertion in `NewXiaomiModel` panics when the test
replaces it with a `roundTripperFunc`.

## Fix

Use a safe type assertion with fallback to a new `http.Transport`,
matching the pattern already used in `modelscope.go`.

## Verification

```bash
go test -run TestXiaomiNewModelWithCustomDefaultTransport ./internal/entity/models/...
# PASS
```

Internal contributors only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
### What problem does this PR solve?

```
RAGFlow(user)> list models;
+---------------------------+------------+-------------+--------------------+---------------------------------------------+
| alias                     | max_tokens | model_types | name               | thinking                                    |
+---------------------------+------------+-------------+--------------------+---------------------------------------------+
|                           | 1048576    | [chat]      | deepseek-v4-flash  | map[clear_thinking:true default_value:true] |
|                           | 1048576    | [chat]      | deepseek-v4-pro    | map[clear_thinking:true default_value:true] |
|                           | 1024000    | [chat]      | minimax-m3         | map[clear_thinking:true default_value:true] |
|                           | 64000      | [vision]    | glm-4.5v           | map[clear_thinking:true default_value:true] |
| [baai/bge-m3]             | 8192       | [embedding] | bge-m3             |                                             |
| [baai/bge-reranker-v2-m3] | 1024       | [rerank]    | bge-reranker-v2-m3 |                                             |
|                           |            | [tts]       | step-audio-tts-3b  |                                             |
| [qwen/qwen3-asr-1.7b]     |            | [asr]       | qwen3-asr-1.7b     |                                             |
| [paddleocr-vl-1.5]        |            | [ocr]       | paddleocr-vl-0.9b  |                                             |
+---------------------------+------------+-------------+--------------------+---------------------------------------------+
RAGFlow(user)> show model 'minimax-m3';
+--------------+---------------------------------------------+
| field        | value                                       |
+--------------+---------------------------------------------+
| name         | minimax-m3                                  |
| max_tokens   | 1024000                                     |
| model_types  | [chat]                                      |
| thinking     | map[clear_thinking:true default_value:true] |
| class        |                                             |
| alias        |                                             |
| ModelTypeMap |                                             |
+--------------+---------------------------------------------+
RAGFlow(user)> show model 'baai/bge-m3';
+--------------+---------------+
| field        | value         |
+--------------+---------------+
| model_types  | [embedding]   |
| thinking     |               |
| class        |               |
| alias        | [baai/bge-m3] |
| ModelTypeMap |               |
| name         | bge-m3        |
| max_tokens   | 8192          |
+--------------+---------------+
```

---------

Signed-off-by: Jin Hai <[email protected]>
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. labels Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 15245bd8-daa9-4794-8a41-fe32428c2735

📥 Commits

Reviewing files that changed from the base of the PR and between 16a4dbc and 6dc45cd.

📒 Files selected for processing (3)
  • api/apps/restful_apis/chunk_api.py
  • api/db/services/llm_service.py
  • rag/llm/sequence2txt_model.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • api/db/services/llm_service.py
  • api/apps/restful_apis/chunk_api.py
  • rag/llm/sequence2txt_model.py

📝 Walkthrough

Walkthrough

Adds segment-timestamped ASR, groups segments into fixed-duration audio windows, propagates start/end timing through search retrieval, and exposes start_time, end_time, and doc_type on chunk API responses.

Changes

Audio Timestamp Support

Layer / File(s) Summary
ASR timestamped transcription
rag/llm/sequence2txt_model.py
Added transcription_with_timestamps(audio_path, **kwargs) to Base with fallback to untimed transcription; implemented provider parsing in GPTSeq2txt and XinferenceSeq2txt, returning lists of {text, start, end} segments.
Audio windowed chunk construction
rag/app/audio.py
Added _SUPPORTED_EXTS, _DEFAULT_WINDOW_SECONDS, and _build_windowed_chunks() to group segments into fixed-duration windows; updated chunk() to use parser_config["chunk_duration_seconds"], validate extensions, call transcription_with_timestamps(), and return windowed chunks when timestamps exist or a single concatenated chunk otherwise.
LLM service timestamp wrapper
api/db/services/llm_service.py
Added LLMBundle.transcription_with_timestamps(audio) delegating to the model, summing per-segment token counts, logging used_tokens, and returning segments.
Search result timestamp fields
rag/nlp/search.py
Extended Dealer.search source projection to include start_time_flt and end_time_flt. Dealer.retrieval, retrieval_by_toc, and retrieval_by_children now include these fields in emitted chunk dicts via .get(...).
API chunk response serialization
api/apps/restful_apis/chunk_api.py
Extended Chunk model with start_time, end_time, doc_type. list_chunks populates these fields in both fetch-by-id and search-index branches from start_time_flt, end_time_flt, and doc_type_kwd.

🎯 3 (Moderate) | ⏱️ ~25 minutes

A rabbit hopped through whispers of time,
Segments now seekable, timestamps sublime!
From model to window, from search back to you,
Audio chunks tell when and where, tried and true. 🐇⏱️🎵

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive PR includes incomplete implementations: video extraction via ffmpeg (picture.py), timestamp_granularity parser propagation, index schema changes, and frontend/SDK components are not present. Complete the video path (picture.py ffmpeg extraction), propagate timestamp_granularity config through parser.py, add schema mappings, and implement SDK/frontend exposure for a full feature delivery.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely describes the main change: timestamp-anchored chunking for audio/video ingestion.
Description check ✅ Passed The PR description is comprehensive, includes problem statement, change summary, backward compatibility notes, and fulfills the template requirements.
Linked Issues check ✅ Passed Changes implement core requirements: transcription_with_timestamps() in sequence2txt_model.py (Base, GPTSeq2txt, XinferenceSeq2txt), audio.py windowed chunking with timing metadata, and search.py field propagation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/infiniflow/ragflow/issues/comments/4661084782","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/infiniflow/ragflow/pull/15868?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `1d40c17f-5fc0-4fd2-b497-5c76fc219f51`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between 87b8062df45bd0b9601a083f713ab1d81426fa6a and 16a4dbc1ef50e8fd8fd417119ec80a4028c2932b.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (5)</summary>\n> \n> * `api/apps/restful_apis/chunk_api.py`\n> * `api/db/services/llm_service.py`\n> * `rag/app/audio.py`\n> * `rag/llm/sequence2txt_model.py`\n> * `rag/nlp/search.py`\n> \n> </details>\n> \n> ```ascii\n>  ____________________________________________________________________________________________________________________________________________\n> < Every great developer you know got there by solving problems they were unqualified to solve until they actually did it. - Patrick McKenzie >\n>  --------------------------------------------------------------------------------------------------------------------------------------------\n>   \\\n>    \\   (\\__/)\n>        (•ㅅ•)\n>        /   づ\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=infiniflow/ragflow&utm_content=15868)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
rag/llm/sequence2txt_model.py (1)

109-151: ⚠️ Potential issue | 🟠 Major

Implement DashScope timestamp support for QWenSeq2txt.transcription_with_timestamps

Base.transcription_with_timestamps() falls back to a single segment with start=0.0/end=0.0, and rag/app/audio.py treats that as “no timing” (no windowed chunking). QWenSeq2txt currently overrides only transcription() and does not implement transcription_with_timestamps(), so Qwen audio transcription won’t return segments.

DashScope Qwen ASR supports timestamp output via asr_options (e.g., enable_words) and returns timing fields like begin_time/end_time. Add a transcription_with_timestamps() override for QWenSeq2txt that calls MultiModalConversation with the right asr_options, parses the timestamped response into [{ "text", "start", "end" }], and returns those segments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/llm/sequence2txt_model.py` around lines 109 - 151, Add a
transcription_with_timestamps override on the QWenSeq2txt class that calls
dashscope.MultiModalConversation.call (same as transcription) but enables
timestamped output via asr_options (e.g., enable_words=True or the provider's
timestamp flag) and parses resp["output"]["choices"][0]["message"].content to
extract each word/segment's text plus begin_time/end_time into a list of dicts
[{"text": ..., "start": float(begin_time), "end": float(end_time)}]; return that
list and the token count (use num_tokens_from_string on the concatenated text).
Keep error handling similar to transcription but ensure you return per-segment
timestamps rather than the Base fallback single segment.
🧹 Nitpick comments (2)
rag/app/audio.py (1)

112-125: ⚡ Quick win

Consider adding logging for the windowed chunking flow.

The new timestamp-aware chunking flow branches based on has_timing (line 115), but there's no log statement indicating which path was taken. Adding a log statement would help operators understand whether windowed chunking or fallback single-chunk mode was used during ingestion. As per coding guidelines, new flows should include logging.

📝 Suggested logging additions
         has_timing = any(s.get("end", 0.0) > 0.0 for s in segments)
         if has_timing:
+            logging.info("Audio transcription returned timestamps; using windowed chunking (window=%ss)", window_seconds)
             chunks = _build_windowed_chunks(doc, segments, window_seconds, is_english)
         else:
+            logging.info("Audio transcription has no timestamps; falling back to single-chunk concatenation")
             # Provider returned no timestamps — fall back to single chunk (backward-compat)
             full_text = " ".join(s.get("text", "") for s in segments).strip()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/app/audio.py` around lines 112 - 125, After computing has_timing from
seq2txt_mdl.transcription_with_timestamps and before branching, add a log
statement (using the module logger, e.g., logger.info) that records which path
was taken: "windowed chunking" when has_timing is true (include len(segments)
and window_seconds) and "fallback single-chunk" when false (include
len(segments)); place the log just before calling _build_windowed_chunks(doc,
segments, window_seconds, is_english) or before the fallback tokenize/doc
adjustments so operators can see which branch executed.

Source: Coding guidelines

rag/llm/sequence2txt_model.py (1)

45-52: ⚡ Quick win

Add logging for the new transcription flow.

The coding guidelines require logging for new flows in **/*.py files. Consider adding a debug or info log statement when falling back to the default single-segment behavior, similar to how other methods in this file log provider responses.

📝 Suggested logging addition
 def transcription_with_timestamps(self, audio_path, **kwargs):
     """Return a list of {"text": str, "start": float, "end": float} segments.

     Providers that support verbose_json (Whisper-compatible) override this.
     The default falls back to a single segment with no timing.
     """
+    logging.debug("transcription_with_timestamps: falling back to single untimed segment for provider %s", self.__class__.__name__)
     text, _ = self.transcription(audio_path, **kwargs)
     return [{"text": text, "start": 0.0, "end": 0.0}]

As per coding guidelines: "Add logging for new flows" applies to **/*.py.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/llm/sequence2txt_model.py` around lines 45 - 52, The fallback in
transcription_with_timestamps currently returns a single segment without
emitting any log; update transcription_with_timestamps to log a debug/info
message when it falls back to the default single-segment behavior by calling the
module/class logger (same logger used elsewhere in this file) and include
context such as the audio_path and that transcription(...) returned only text
(reference transcription_with_timestamps and transcription functions), so
reviewers can trace when the non-verbose path was used.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/apps/restful_apis/chunk_api.py`:
- Around line 426-431: The ValidationError happens because final_chunk contains
keys "start_time", "end_time", and "doc_type" but the Pydantic model Chunk
doesn't declare them; update the Chunk model (class Chunk) to declare these
fields (e.g., start_time: Optional[float] = None, end_time: Optional[float] =
None, doc_type: Optional[str] = "" or None) so Chunk(**final_chunk) will
validate, and ensure types/defaults match how final_chunk is constructed (using
start_time_flt/end_time_flt and doc_type_kwd); alternatively, if you prefer not
to change the model, remove those keys before instantiating Chunk or use model
config to allow extra fields consistently.

In `@api/db/services/llm_service.py`:
- Around line 226-230: Wrap the body of LLMBundle.transcription_with_timestamps
to use Langfuse tracing like the other LLM methods: call start_observation(...)
before invoking self.mdl.transcription_with_timestamps(audio), capture the
returned segments, compute used_tokens and call observation.generation.update({
"tokens": used_tokens, "llm_name": self.model_config["llm_name"], ... }) then
call observation.generation.end(); ensure any exceptions end the observation
appropriately and that logging.info still records used_tokens and llm_name; use
the same observation metadata/keys as in transcription/describe/encode to
maintain consistency.

In `@rag/llm/sequence2txt_model.py`:
- Line 260: The list comprehension at the return (processing the segments list)
assumes each segment has "text", "start", and "end" keys and will raise KeyError
on malformed provider data; change it to use defensive dict access like
s.get("text", "") and s.get("start"/"end", 0.0), strip the text safely, and
coerce start/end to floats (e.g., float(s.get("start", 0.0)) with a fallback for
non-numeric values) so the return [{"text": ..., "start": ..., "end": ...} for s
in segments] is robust against missing or bad fields.
- Around line 83-84: The except Exception: pass that swallows provider errors
before falling back to untimed transcription should log the caught exception
first; update the except block in sequence2txt_model.py (the block handling
timestamped transcription failure) to call the module or instance logger (e.g.,
logger.exception(...) or logger.error(..., exc_info=True)) with a clear message
about failing to obtain timestamps, then continue to the existing untimed
transcription fallback. Ensure you reference the same logger used elsewhere in
the module (or create one with logging.getLogger(__name__)) so the error and
stack trace are recorded before proceeding.
- Around line 261-262: The bare "except Exception: pass" in the try/except that
calls the Xinference timestamped transcription must be replaced with a logged
exception before falling back to untimed transcription; locate the try block in
sequence2txt_model.py that invokes the Xinference endpoint (e.g., the
timestamped transcription logic inside the Sequence2TxtModel or
transcribe_with_timestamps function), catch Exception as e and call the module
logger (or processLogger) with logger.exception(...) or logger.error(...,
exc_info=True) including a clear message about Xinference timestamp failure,
then continue to the existing fallback path.

---

Outside diff comments:
In `@rag/llm/sequence2txt_model.py`:
- Around line 109-151: Add a transcription_with_timestamps override on the
QWenSeq2txt class that calls dashscope.MultiModalConversation.call (same as
transcription) but enables timestamped output via asr_options (e.g.,
enable_words=True or the provider's timestamp flag) and parses
resp["output"]["choices"][0]["message"].content to extract each word/segment's
text plus begin_time/end_time into a list of dicts [{"text": ..., "start":
float(begin_time), "end": float(end_time)}]; return that list and the token
count (use num_tokens_from_string on the concatenated text). Keep error handling
similar to transcription but ensure you return per-segment timestamps rather
than the Base fallback single segment.

---

Nitpick comments:
In `@rag/app/audio.py`:
- Around line 112-125: After computing has_timing from
seq2txt_mdl.transcription_with_timestamps and before branching, add a log
statement (using the module logger, e.g., logger.info) that records which path
was taken: "windowed chunking" when has_timing is true (include len(segments)
and window_seconds) and "fallback single-chunk" when false (include
len(segments)); place the log just before calling _build_windowed_chunks(doc,
segments, window_seconds, is_english) or before the fallback tokenize/doc
adjustments so operators can see which branch executed.

In `@rag/llm/sequence2txt_model.py`:
- Around line 45-52: The fallback in transcription_with_timestamps currently
returns a single segment without emitting any log; update
transcription_with_timestamps to log a debug/info message when it falls back to
the default single-segment behavior by calling the module/class logger (same
logger used elsewhere in this file) and include context such as the audio_path
and that transcription(...) returned only text (reference
transcription_with_timestamps and transcription functions), so reviewers can
trace when the non-verbose path was used.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1d40c17f-5fc0-4fd2-b497-5c76fc219f51

📥 Commits

Reviewing files that changed from the base of the PR and between 87b8062 and 16a4dbc.

📒 Files selected for processing (5)
  • api/apps/restful_apis/chunk_api.py
  • api/db/services/llm_service.py
  • rag/app/audio.py
  • rag/llm/sequence2txt_model.py
  • rag/nlp/search.py

Comment thread api/apps/restful_apis/chunk_api.py Resolved
Comment thread api/db/services/llm_service.py Resolved
Comment thread rag/llm/sequence2txt_model.py Resolved
Comment thread rag/llm/sequence2txt_model.py Resolved
Comment thread rag/llm/sequence2txt_model.py Resolved
@JinHai-CN

Copy link
Copy Markdown
Member

@dale053 would you please fix the conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Timestamp-anchored chunking for audio and video ingestion with seekable retrieval