refactor: enhance API service to include non-image files in requests and improve chat message synchronization logic

This commit is contained in:
cogwheel0
2025-08-26 11:21:26 +05:30
parent 494427dd04
commit 8692bf3bb6
2 changed files with 16 additions and 2 deletions

View File

@@ -2442,6 +2442,14 @@ class ApiService {
debugPrint('DEBUG: Including tool_ids in SSE request: $toolIds');
}
// Include non-image files at the top level as expected by Open WebUI
if (allFiles.isNotEmpty) {
data['files'] = allFiles;
debugPrint(
'DEBUG: Including non-image files in request: ${allFiles.length}',
);
}
// Don't add session_id or id - they break SSE streaming!
// The server falls back to task-based async when these are present