### What problem does this PR solve?
Revert broken agent completion by #9631.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
fix: validate chunk type before processing to prevent AttributeError (#9698)
### What problem does this PR solve?
This PR fixes a critical bug in the session listing endpoint where the
application crashes with an `AttributeError` when processing chunk data
that contains non-dictionary objects.
**Error before fix:**
```json
{
"code": 100,
"data": null,
"message": "AttributeError(\"'str' object has no attribute 'get'\")"
}
```
**Root cause:**
The code assumes all items in the `chunks` array are dictionary objects
and directly calls the `.get()` method on them. However, in some cases,
the chunks array contains string objects or other non-dictionary types,
causing the application to crash when attempting to call `.get()` on a
string.
**Solution:**
Added type validation to ensure each chunk is a dictionary before
processing. Non-dictionary chunks are safely skipped, preventing the
crash while maintaining functionality for valid chunk data.
This fix improves the robustness of the session listing endpoint and
ensures users can retrieve their conversation sessions without
encountering server errors due to data format inconsistencies.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
fix: Create conversation sessions will lost prologue (#9666)
### What problem does this PR solve?
When create conversation,the prologue hasn't save in conversation.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?
Fix Multiple conversations cause the reference list to grow indefinitely
due to Python's mutable default argument behavior.
Explicitly initialize reference as empty list when creating new sessions
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?
Fix search app AI summary ERROR: 'dict' object has no attribute 'split'.
#9649
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Refactoring: Agent completions API change response structure (#9631)
### What problem does this PR solve?
Resolve #9549 and #9436 , In v0.20.x,Agent completions API changed a
lot,such as without reference and so on
### Type of change
- [x] Refactoring
fix(sdk): add default empty dict for metadata_condition (#9640)
### What problem does this PR solve?
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
---------
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
fix:passing empty database array when updating assistant (#9570)
### What problem does this PR solve?
When the `dataset_ids` parameter is omitted in the **update assistant**
request, Passing an empty array `[]` triggers a misleading
message"Dataset use different embedding models", while omitting the
field does not.
To fix this, we:
- Provide a default empty list: `ids = req.get("dataset_ids", [])`.
- Replace the `is not None` check with a truthy check: `if ids:`.
**Files changed**
`api/apps/sdk/chat.py`
- L153: `ids = req.get("dataset_ids")` → `ids = req.get("dataset_ids",
[])`
- L156: `if ids is not None:` → `if ids:`
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Feat: reference should also be list after 0.20.x (#9582)
### What problem does this PR solve?
In 0.19.0 reference is list,and it should be a list,otherwise last
conversation's reference will be lost
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?
Refactor OpenAI to enable audio parsing.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring
Fix: ensure update_progress loop always waits between iterations (#9528)
Move stop_event.wait(6) into finally block so that even when an
exception occurs, the loop still sleeps before retrying. This prevents
busy looping and excessive error logs when Redis connection fails.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?
- Update search_app.py to use SearchService instead of
KnowledgebaseService for duplicate
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?
Add embedded search functionality.
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
---------
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
Feat: add SMTP support for user invitation emails (#9479)
### What problem does this PR solve?
Add SMTP support for user invitation emails
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
Feat: conversation completion can specify different model (#9485)
### What problem does this PR solve?
Conversation completion can specify different model
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
Fix: KB folder may not there while creating virtual file (#9431)
### What problem does this PR solve?
KB folder may not there while creating virtual file. #9423
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Fix: update broken create agent session due to v0.20.0 changes (#9445)
### What problem does this PR solve?
Update broken create agent session due to v0.20.0 changes. #9383
**NOTE: A session ID is no longer required to interact with the agent.**
See: #9241, #9309.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Feat: Fixed the issue where some fields in the chat configuration could not be displayed #3221 (#9430)
### What problem does this PR solve?
Feat: Fixed the issue where some fields in the chat configuration could
not be displayed #3221
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
Feat: allows setting multiple types of default models in service config (#9404)
### What problem does this PR solve?
Allows set multiple types of default models in service config.
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
Fix KeyError in session listing endpoint when accessing conversation reference (#9419)
- Add type and boundary checks for conv["reference"] access
- Prevent KeyError: 0 when reference list is empty or malformed
- Ensure reference is list type before indexing
- Handle cases where reference items are None or missing chunks
- Maintains backward compatibility with existing data structures
This resolves crashes in /api/v1/agents/<agent_id>/sessions endpoint
when conversation reference data is not properly structured.
### What problem does this PR solve?
This PR fixes a critical `KeyError: 0` that occurs in the
`/api/v1/agents/<agent_id>/sessions` endpoint when the system attempts
to access conversation reference data that is not properly structured.
**Background Context:**
The `list_agent_session` method in `api/apps/sdk/session.py` assumes
that `conv["reference"]` is always a properly indexed list with valid
dictionary structures. However, in real-world scenarios, this data can
be:
- Not a list type (could be None, string, or other types)
- An empty list when `chunk_num` tries to access index 0
- Contains None values or malformed dictionary structures
- Missing expected "chunks" keys in reference items
**Impact Before Fix:**
When malformed reference data is encountered, the API crashes with:
```json
{
"code": 100,
"data": null,
"message": "KeyError(0)"
}
```
**Solution:**
Added comprehensive safety checks including type validation, boundary
checking, null safety, and structure validation to ensure the API
gracefully handles all reference data formats while maintaining backward
compatibility.
### 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):
Fix:TypeError: OllamaCV.chat() got an unexpected keyword argument 'stop' (#9363)
### What problem does this PR solve?
https://github.com/infiniflow/ragflow/issues/9351
Support filter argument before invoking
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
---------
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
### What problem does this PR solve?
All models pass the mock response tests, which means that if a model can
return the correct response, everything should work as expected.
However, not all models have been fully tested in a real environment,
the real API_KEY. I suggest actively monitoring the refactored models
over the coming period to ensure they work correctly and fixing them
step by step, or waiting to merge until most have been tested in
practical environment.
### Type of change
- [x] Refactoring
Fix: handle missing dataset_ids when creating chat assistant (#9324)
- Root cause: accessing req.get("dataset_ids") returns None when the key
is absent, causing KeyError.
- Fix: use req.get("dataset_ids", []) to default to empty list.
Revert: revert token_required decorator of agent_bot completions and inputs (#9332)
### What problem does this PR solve?
Revert token_required decorator of agent_bot completions and inputs.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring