async def update_chunk(
            id: UUID = Path(...),
            chunk_update: UpdateChunk = Body(...),
            # TODO: Run with orchestration?
            auth_user=Depends(self.providers.auth.auth_wrapper()),
        ) -> WrappedChunkResponse:
            """Update an existing chunk's content and/or metadata.

            The chunk's vectors will be automatically recomputed based on the
            new content. Users can only update chunks they own unless they are
            superusers.
            """
            # Get the existing chunk to get its chunk_id
            existing_chunk = await self.services.ingestion.get_chunk(
                chunk_update.id
            )
            if existing_chunk is None:
                raise R2RException(f"Chunk {chunk_update.id} not found", 404)

            workflow_input = {
                "document_id": str(existing_chunk["document_id"]),
                "id": str(chunk_update.id),
                "text": chunk_update.text,
                "metadata": chunk_update.metadata
                or existing_chunk["metadata"],
                "user": auth_user.model_dump_json(),
            }

            logger.info("Running chunk ingestion without orchestration.")
            from core.main.orchestration import simple_ingestion_factory

            # TODO - CLEAN THIS UP

            simple_ingestor = simple_ingestion_factory(self.services.ingestion)
            await simple_ingestor["update-chunk"](workflow_input)

            return ChunkResponse(  # type: ignore
                id=chunk_update.id,
                document_id=existing_chunk["document_id"],
                owner_id=existing_chunk["owner_id"],
                collection_ids=existing_chunk["collection_ids"],
                text=chunk_update.text,
                metadata=chunk_update.metadata or existing_chunk["metadata"],
                # vector = existing_chunk.get('vector')
            )
Update an existing chunk's content and/or metadata.

            The chunk's vectors will be automatically recomputed based on the
            new content. Users can only update chunks they own unless they are
            superusers.
            
py/core/main/api/v3/chunks_router.py