LocalAI/core/http/react-ui/src/hooks
Daniel Liljeberg fc3980dadd
fix: inject text-file content into chat completions messages (#9896)
Non-image/non-audio file attachments (txt, md, csv, json) were being
  stored in the 'files' metadata field but never added to the message
  content array sent to /v1/chat/completions. Images and audio correctly
  received content blocks; files did not.

  Fix: push a text content block into messageContent when textContent is
  present, matching the pattern used for image_url and audio_url.

  Also fixes Home.jsx addFiles which never called file.text() at all,
  meaning files attached on the home screen had empty textContent even
  before reaching useChat.js.

  Note: PDF files use file.text() which returns raw bytes rather than
  parsed text. Proper PDF support would require PDF.js or server-side
  extraction and is not part of this fix.

Signed-off-by: Daniel Liljeberg <damien_@hotmail.com>
2026-05-20 01:00:32 +02:00
..
useAgentChat.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
useAudioPeaks.js feat: add LocalVQE backend and audio transformations UI (#9640) 2026-05-04 22:07:11 +02:00
useAutocomplete.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
useChat.js fix: inject text-file content into chat completions messages (#9896) 2026-05-20 01:00:32 +02:00
useCodeMirror.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
useConfigMetadata.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
useDebounce.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
useDistributedMode.js feat(distributed): per-node backend installation from the gallery 2026-04-26 22:05:18 +00:00
useGalleryEnrichment.js feat(react-ui): polish Manage page with kebab menus and gallery rows 2026-04-26 20:33:49 +00:00
useMCPClient.js fix(ui): Move routes to /app to avoid conflict with API endpoints (#8978) 2026-03-13 21:38:18 +01:00
useMediaCapture.js feat: add biometrics UI (#9524) 2026-04-24 08:50:34 +02:00
useMediaHistory.js feat: add LocalVQE backend and audio transformations UI (#9640) 2026-05-04 22:07:11 +02:00
useModels.js fix(react-ui): stop Manage page from blanking on auto-refresh; show real model use cases 2026-04-26 19:35:39 +00:00
useObjectUrl.js feat: add LocalVQE backend and audio transformations UI (#9640) 2026-05-04 22:07:11 +02:00
useOperations.js feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
useResources.js feat(ui): move to React for frontend (#8772) 2026-03-05 21:47:12 +01:00
useUserMap.js feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
useVramEstimate.js feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00