fix: drop latin-1 decode in source title and userIds#306
Conversation
40e1d41 to
2e2584c
Compare
| @@ -393,8 +393,8 @@ def _process_sources( | |||
| def _decode_latin_1(s: str) -> str: | |||
| try: | |||
| return s.encode('latin-1').decode('utf-8') | |||
There was a problem hiding this comment.
So we encode a string in latin-1 and decode using utf-8 again. Why do we do that?
There was a problem hiding this comment.
I had forgotten too 🙈
blaming the lines points to this issue for which the fix was made: #71
and it was probably related to the issue that the title was transported from context_chat PHP to backend in the headers which only support latin-1 mostly, finding back the sources for it, these two links pop up:
python/cpython#105505 (comment)
https://stackoverflow.com/questions/4400678/what-character-encoding-should-i-use-for-a-http-header/4410331#4410331
now that we don't have that limitation after reversal of the indexing direction, it can be dropped.
thanks for the enquiry :)
There was a problem hiding this comment.
after dropping the conversion, it seems to work fine:
ccb=# select cmetadata from langchain_pg_embedding ;
cmetadata
----------------------------------------------------------------------------------------------------------------
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 0}
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 1365}
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 2907}
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 4138}
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 5963}
{"type": "application/pdf", "title": "files/河马.pdf", "source": "files__default: 19455", "start_index": 7259}
(6 rows)
blaming the lines points to this issue for which the fix was made: #71 and it was probably related to the issue that the title was transported from context_chat PHP to backend in the headers which only support latin-1 mostly, finding back the sources for it, these two links pop up: python/cpython#105505 (comment) https://stackoverflow.com/questions/4400678/what-character-encoding-should-i-use-for-a-http-header/4410331#4410331 now that we don't have that limitation after reversal of the indexing direction, it can be dropped. Signed-off-by: kyteinsky <kyteinsky@gmail.com>
2e2584c to
48090b2
Compare
## 5.4.0 - 2026-06-24 ### Highlights - The indexing direction has been reversed now. Instead of the context_chat PHP app sending documents to the context_chat_backend ExApp, the ExApp downloads the documents from the server according to a list obtained from the PHP app. This also means that the `occ context_chat:scan` command serves no purpose and has been removed. Indexing should be smoother and run continuously now. - Kubernetes support to scale the CPU computation - Separate docker images for CPU, CUDA and ROCM (uses Vulkan) instead of one heavy CUDA/CPU image - CUDA 12.8 is shipped in the CUDA image so the host drivers should be updated to this at the minimum. ### Added - add network embedding batching (#276) @fcharlaix-opendsi - add kubernetes support and reverse content/indexing flow (#284) @kyteinsky @marcelklehr - add gh workflows for docker builds and do separate cpu, cuda and rocm (vulkan) images (#295) @kyteinsky ### Changed - update readme according to the latest changes (#300) @kyteinsky - bump llama_cpp_python to 0.3.23 (#301) @kyteinsky - move task types to the backend (#321) @kyteinsky - adjust comment in Dockerfile regarding RTX5090 support (#316) @kyteinsky ### Fixed - improve loadSources error handling (#288) @kyteinsky - fix(pgvector): add chunking to prevent long list of args in queries (#290) @kyteinsky - fix(pgvector): make doc deletion query faster (#289) @kyteinsky - drop latin-1 decode in source title and userIds (#306) @kyteinsky - handle validation errors of files and content providers individually (#308) @kyteinsky - prevent race condition in vectordb tables creation (#308) @kyteinsky - pass actual error in the error object (#308) @kyteinsky - add container hostname to /etc/hosts to silence sudo warning (#311) @sanzakicesarr ## 🤖 AI (if applicable) - [ ] The content of this PR was partly or fully generated using AI Signed-off-by: kyteinsky <kyteinsky@gmail.com>
fixing this issue: