mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-31 17:15:32 +08:00
## Summary Fixes #12311 Changes the `reference` field initialization from `[{}]` to `[]` in session creation. ### Problem When creating a session via the SDK API, the `reference` field was incorrectly initialized as `[{}]`. This caused: - First dialogue round: Empty reference - Second dialogue round: Reference pointing to first round's data - Overall misalignment between dialogue rounds and their references ### Solution Changed the initialization to `[]` (empty list), which: - Matches the `Conversation` model's expected default - Ensures references grow correctly one-to-one with assistant responses - Aligns with the service layer's expectations ### Testing After applying this fix: 1. Create a session via `POST /api/v1/chats/{conversation_id}/sessions` 2. Send multiple questions via `POST /api/v1/chats/{conversation_id}/completions` 3. View the conversation on web - references should now align correctly with each dialogue round