Add AstraDB RAG Flow guide

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-03 00:17:58 -03:00
commit 52154581d6
18 changed files with 3682 additions and 16 deletions

View file

@ -0,0 +1,29 @@
const DownloadableJsonFile = ({ source, title }) => {
const handleDownload = (event) => {
event.preventDefault();
fetch(source)
.then((response) => response.blob())
.then((blob) => {
const url = window.URL.createObjectURL(
new Blob([blob], { type: "application/json" })
);
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", title);
document.body.appendChild(link);
link.click();
link.parentNode.removeChild(link);
})
.catch((error) => {
console.error("Error downloading file:", error);
});
};
return (
<a href={source} download={title} onClick={handleDownload}>
{title}
</a>
);
};
export default DownloadableJsonFile;