From 8c63f0ee8d337eb9c855f2b380c301e8a1aa162e Mon Sep 17 00:00:00 2001 From: John Watson Date: Tue, 17 Dec 2024 08:41:51 -0800 Subject: [PATCH] Markdown support + UI for non-knowledge-base-answers (#82) * markdown file handler, small refactorings, make the file delete immediately submit a request to the reconciler to delete the file * "delete an empty data source with an empty global storage" * "maybe ask to delete from docstore" * fix deleting from doc store * "markdown rendering" * wip on markdown tables * "now we're thinking with styled-components" * "css styling of the markdown tables" * update lock file * use markdown for docling pdf, minor ui changes to source card * readme updates * wip on icon for no source nodes * "now we're thinking with colors" * "styling/coloration of the not-a-kb-response response" * "now we're thinking with inference models" * Set inference model when chatting with model directly * it ain't round * fill a little more of the "circle" * it's still not a circle, but it's a little bigger * mock the model api for the test --------- Co-authored-by: Elijah Williams Co-authored-by: Michael Liu --- .DS_Store | Bin 0 -> 10244 bytes README.md | 33 +- .../rag/configuration/AppConfiguration.java | 2 +- .../cai/rag/files/RagFileService.java | 9 +- .../cai/rag/files/RagFileServiceTest.java | 3 +- llm-service/.DS_Store | Bin 0 -> 6148 bytes .../JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.json | 96832 ++++++++++++++++ .../JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.md | 594 + .../JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.txt | 165 + llm-service/app/ai/indexing/base.py | 3 +- .../app/ai/indexing/readers/markdown.py | 99 + llm-service/app/ai/indexing/readers/pdf.py | 5 +- .../app/ai/indexing/summary_indexer.py | 96 +- llm-service/app/ai/vector_stores/qdrant.py | 7 +- .../app/routers/index/data_source/__init__.py | 10 +- .../app/routers/index/sessions/__init__.py | 29 +- llm-service/app/services/chat.py | 6 +- llm-service/app/services/chat_store.py | 7 +- ui/package.json | 4 +- ui/pnpm-lock.yaml | 860 + ui/src/api/chatApi.ts | 1 + ui/src/api/ragQueryApi.ts | 1 + ui/src/components/images/Images.ts | 2 + ui/src/components/images/ic-models.svg | 3 + .../ChatMessages/ChatBodyController.test.tsx | 7 + .../ChatOutput/ChatMessages/ChatMessage.tsx | 43 +- .../ChatOutput/Sources/MetaData.tsx | 5 +- .../ChatOutput/Sources/SourceCard.tsx | 70 +- .../ChatOutput/Sources/SourceNodes.tsx | 36 +- .../ChatOutput/Sources/sourceCard.css | 53 + 30 files changed, 98867 insertions(+), 118 deletions(-) create mode 100644 .DS_Store create mode 100644 llm-service/.DS_Store create mode 100644 llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.json create mode 100644 llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.md create mode 100644 llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.txt create mode 100644 llm-service/app/ai/indexing/readers/markdown.py create mode 100644 ui/src/components/images/ic-models.svg create mode 100644 ui/src/pages/RagChatTab/ChatOutput/Sources/sourceCard.css diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..930ad4b76a5c492d4abf0640bb9a0349e31313a9 GIT binary patch literal 10244 zcmeHMYitx%6h3DPbY|MZv_PS5N*4+SOIwzL6nRLu4=PficKhbB?Cy;1!0b%fncecR zroS{1j3z2EzW%8}4JIZg^22D7a}s0Z1;Q zW}c`_=Kzig`?AfK(?W76^(jsd=tI#zVxWN2`!G`{+2+e>Aq5;zzyW>B=$}xKTPIwY zs{^(P8RP*20Ry))z|QV95QT%#OXv2&^LrL_Fu|eLLzH_|PJsc$(oH}LP7%Tey-54rBJC>DOi;fGu*lLFG;x#%88}P!&Qg0Cths$) zZBZWzjaKx*EW6Z$TZFh!gjh}p#~)*cY^JD|h6&0UdLg@i6!lUHJ+L1-po>_FLDyWH z(pZsp8O_ilD^1)+26BScBGk8k50#vBC;V@4H929Kt`~`1L#brZ;w7bWsaz%>i;X*z zF)!g|-S$N02&?rwj+M-p6Ujl-n2c*HIvm?en6{DO08=+e<>-)U>&|4mleKl1V`Jil ztjJ1St2uvuOKWRmcx$9(sxf?i%a*O%8^b$VB2!a}yt01tuD42* zt)jgzAJu7)2OXVR()pWEU1)b?!#{E z!2uk^VI0BZIELeR5>Mf2Jcs9T3LnQO@ELp-pTpqgtDCl)O7KX=>9@E&{sAH$dAw%@}K@Du!wfJ?BP z+;k0w$yL|m26EL1w%}IWhI?=?MzNh7w+9blFFt~Ocm$7O98X|^+}6T0+Bk`4$#owi z=Y0a7#Ha8AK8=^~MSKZg##gu#zm4w*2b^`whw~08B!0NCTjpXJ+j4BSDl(@o=j%ON z`z=}#by{_EwC=hvK6gDV=^)+0-9;JgQ=-sK7_o0@hLf~zkIhBVJAl^;_9P0Sx~R32 z_Bvf;Cq3`Jq!3Zg5j`9gqgDP8*_;Q*_acS3Qkp}Gb}uH4%A0o|Qm8FK7R getRagDocuments(Long dataSourceId) { diff --git a/backend/src/test/java/com/cloudera/cai/rag/files/RagFileServiceTest.java b/backend/src/test/java/com/cloudera/cai/rag/files/RagFileServiceTest.java index d94a6d1c..a085f200 100644 --- a/backend/src/test/java/com/cloudera/cai/rag/files/RagFileServiceTest.java +++ b/backend/src/test/java/com/cloudera/cai/rag/files/RagFileServiceTest.java @@ -215,7 +215,8 @@ private RagFileService createRagFileService( tracker == null ? RagFileUploader.createNull() : RagFileUploader.createNull(tracker), RagFileIndexReconciler.createNull(), prefix, - dataSourceRepository); + dataSourceRepository, + RagFileDeleteReconciler.createNull()); } private long newDataSourceId() { diff --git a/llm-service/.DS_Store b/llm-service/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8b4813270d8ae5be3a18d75aa2bbde6756457f48 GIT binary patch literal 6148 zcmeHKOHRWu5Pfbd6(~X#5)vDvT!2X2Ae6FT%>e@a(3YlcR9XbP?70J1;4~bD6}+*n z(zvii2xg@5vz>Y4_}PkM0H(FNH?Oj z<2NcGYuDgvrO5HfwfkJZ^dg&eJK3zm2-zN|^!VKxYe1E;Ir4IpISQh7(8i2;$J`Th z++c(Z{ebfnaQ4x&oQ%;^3~L+}D7+OV*NOr{wfG@`4`Ihh<*%Ea27cTh2NE zTsY-uyAsc9D^ced_spAF)y6^e3v;hWv#F*Er~?090iM}nTMdU=ssgHjDzH*Oz7G*y zF!5M8w4V+Z_6k6(vD+H!^0O$M$YbKMaL6Y# + +Figure 2.2: Measured current dependence of b4 in various 80 mm aperture and short dipoles for RHIC. The curves are the average of the up and down ramp and for each magnets are shifted by an amount 80 that start from zero at 2 kAmp. long they they + + + +## History of b6 Saturation in RHIC Dipoles + +Figure 2.3: Measured current dependence of b6 in various 80 mm aperture and short dipoles for RHIC. The curves are the average of the up and down ramp and for each magnets they are shifted by an amount s0 that start from zero at 2 kAmp. long they + + + +## History of al Saturation in RHIC Dipoles + +Figure 2.4: Measured current dependence of 01 in various 80 mm aperture and short dipoles for RHIC. The curves are the average of the up and ramp and for each magnets are shifted by an amount so that start from zero at 2 kAmp. long they down they + + + +Table 2.1: Average of the up and down ramp in the magnet DRAOOI. Moreover the harmonics are subtracted by the value of this average at 2 kAmp s0 that have a zero value at 2kAmp. Please see the following processing for the details DRAOO1.24023 27-APR-92 12.22.20 they + +| | IF | STF | 62 | 4 | 66 | @1 | +|-------|--------|--------|--------|--------|--------|--------| +| kAmp | T/kA | % | 10-4 | 10-4 | 10-4 | 10-4 | +| 1.000 | 0.7702 | 0.069 | -1.395 | 0.450 | -0.300 | 0.015 | +| 1.200 | 0.7700 | 0.049 | -1.270 | 0.440 | -0.175 | 0.010 | +| 1.400 | 0.7700 | 0.047 | -1.135 | 0.445 | -0.400 | 0.015 | +| 1.600 | 0.7699 | 0.033 | -0.905 | 0.345 | -0.440 | 0.020 | +| 1.800 | 0.7698 | 0.025 | -0.570 | 0.250 | -0.285 | 0.040 | +| 2.000 | 0.7696 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7694 | -0.025 | 0.860 | -0.220 | -0.045 | -0.030 | +| 2.400 | 0.7695 | -0.023 | 2.080 | -0.610 | -0.055 | -0.065 | +| 2.600 | 0.7690 | -0.084 | 3.770 | -1.105 | -0.915 | -0.095 | +| 2.800 | 0.7687 | ~0.124 | 6.005 | -1.830 | 0.145 | -0.155 | +| 3.000 | 0.7680 | -0.217 | 9.005 | -2.810 | 0.250 | -0.245 | +| 3.200 | 0.7674 | -0.290 | 12.725 | ~3.710 | 0.155 | -0.325 | +| 3.400 | 0.7665 | -0.401 | 17.035 | -4.815 | 0.015 | -0.410 | +| 3.600 | 0.7652 | ~0.582 | 21.605 | -5.985 | 0.240 | -0.495 | +| 3.800 | 0.7633 | -0.825 | 26.095 | -7.015 | 0.515 | -0.580 | +| 4.000 | 0.7609 | ~1.129 | 30.430 | -7.795 | 0.320 | -0.610 | +| 4.200 | 0.7583 | -1.477 | 34.425 | -8.265 | 0.325 | -0.615 | +| 4.400 | 0.7549 | -1.910 | 37.920 | -8.430 | -0.335 | -0.615 | +| 4.600 | 0.7517 | -2.336 | 40.730 | -8.545 | -0.195 | ~0.585 | +| 4.800 | 0.7476 | -2.862 | 42.470 | -8.360 | -0.890 | -0.500 | +| 5.000 | 0.7433 | -3.421 | 42.840 | -8.120 | -0.575 | -0.355 | +| 5.200 | 0.7383 | -4.072 | 41.855 | -7.760 | -0.640 | -0.110 | +| 5.400 | 0.7328 | -4.780 | 40.095 | -7.340 | -1.210 | 0.165 | +| 5.600 | 0.7273 | ~5.497 | 38.205 | -6.925 | ~1.145 | 0.430 | +| 5.800 | 0.7215 | ~6.249 | 36.015 | ~6.655 | -0.495 | 0.665 | + +Table 2.2: Average of the up and down ramp in the magnet DRAOO2. Moreover the harmonics are subtracted by the value of this average at 2 s0 that have a zero value at 2kAmp. Please see the following processing for the details DRA002.23583 28-APR-92 09.25.43 kAmp they + +| | TF | 8TF | 62 10-4 | 64 10-4 | 66 10-4 | @1 10-4 | +|-------|--------|--------|-----------|-----------|-----------|-----------| +| kAmp | T/kA | 9 | | 0.340 | 0.150 | -0.035 | +| 1.000 | 0.7698 | 0.027 | -1.080 | | | | +| 1.200 | 0.7697 | 0.016 | -1.000 | 0.280 | 0.895 | -0.010 | +| 1.400 | 0.7695 | -0.01 | -0.935 | 0.420 | -0.430 | -0.015 | +| 1.600 | 0.7695 | -0.013 | -0.765 | 0.150 | 0.620 | 0.000 | +| 1.800 | 0.7692 | -0.049 | -0.505 | 0.175 | 1.150 | -0.015 | +| 2.000 | 0.7696 | 0 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7692 | -0.05 | 0.760 | -0.250 | 0.515 | -0.005 | +| 2.400 | 0.7685 | -0.139 | 1.815 | -0.555 | 0.395 | -0.025 | +| 2.600 | 0.7686 | -0.132 | 3.345 | -1.110 | 1.035 | -0.040 | +| 2.800 | 0.7682 | 0.185 | 5.425 | -1.765 | 0.635 | -0.065 | +| 3.000 | 0.7679 | -0.22 | 8.170 | -2.460 | 0.455 | -0.085 | +| 3.200 | 0.7668 | -0.364 | 11.605 | -3.310 | 0.680 | -0.130 | +| 3.400 | 0.7657 | -0.503 | 15.610 | 4.495 | 0.800 | -0.185 | +| 3.600 | 0.7643 | -0.681 | 19.870 | ~5.470 | 1.260 | -0.240 | +| 3.800 | 0.7626 | -0.914 | 24.100 | -6.385 | 0.870 | -0.290 | +| 4.000 | 0.7605 | -1.175 | 28.200 | -7.040 | 0.245 | -0.350 | +| 4.200 | 0.7576 | -1.558 | 32.020 | -7.575 | 0.280 | -0.375 | +| 4.400 | 0.7547 | -1.94 | 35.365 | ~7.850 | 0.615 | -0.400 | +| 4.600 | 0.7508 | -2.44 | 37.960 | ~7.790 | 0.075 | -0.415 | +| 4.800 | 0.7469 | -2.95 | 39.535 | -7.750 | 0.530 | -0.385 | +| 5.000 | 0.7427 | -3.5 | 39.655 | -7.425 | -0.890 | -0.305 | + +Table 2.3: Average of the up and down ramp in the magnet DRA003. Moreover the harmonics are subtracted by the value of this average at 2 kAmp so that have a zero value at 2kAmp. Please see the following processing for the details DRAO03.22993 28-APR-92 09.36.51 they + +| | TF- | STF | 62 | 64 | 66 | @1 | +|-------|--------|--------|--------|--------|--------|--------| +| kAmp | T/kA | % | 10-4 | 10-4 | 10-4 | 10-4 | +| 1.000 | 0.7696 | 0.076 | -1.215 | 0.385 | -0.690 | -0.045 | +| 1.200 | 0.7691 | 0.015 | -1.155 | 0.405 | ~0.270 | -0.015 | +| 1.400 | 0.7693 | 0.032 | -1.035 | 0.375 | -0.195 | 0.000 | +| 1.600 | 0.7696 | 0.076 | -0.855 | 0.255 | -0.050 | 0.015 | +| 1.800 | 0.7691 | 0.016 | -0.545 | 0.215 | -0.350 | 0.005 | +| 2.000 | 0.7690 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7691 | 0.006 | 0.850 | -0.275 | -0.065 | -0.025 | +| 2.400 | 0.7688 | -0.033 | 2.015 | -0.685 | 0.225 | -0.050 | +| 2.600 | 0.7688 | -0.026 | 3.665 | -1.180 | 0.230 | -0.085 | +| 2.800 | 0.7683 | -0.092 | 5.840 | -1.730 | 0.260 | ~0.125 | +| 3.000 | 0.7678 | -0.159 | 8.760 | -2.565 | 0.360 | -0.170 | +| 3.200 | 0.7669 | -0.280 | 12.380 | 3.545 | 0.295 | -0.240 | +| 3.400 | 0.7664 | -0.344 | 16.600 | -4.580 | 0.730 | -0.320 | +| 3.600 | 0.7649 | -0.539 | 21.080 | -5.615 | 0.650 | -0.380 | +| 3.800 | 0.7631 | ~0.769 | 25.520 | -6.600 | 0.595 | -0.415 | +| 4.000 | 0.7607 | -1.087 | 29.745 | -7.275 | 0.675 | -0.415 | +| 4.200 | 0.7578 | -1.465 | 33.640 | 7.720 | 0.395 | ~0.405 | +| 4.400 | 0.7545 | -1.884 | 37.055 | -7.930 | 0.190 | -0.365 | +| 4.600 | 0.7514 | -2.293 | 39.760 | -7.915 | 0.065 | -0.275 | +| 4.800 | 0.7473 | ~2.824 | 41.435 | -7.745 | -0.005 | ~0.105 | +| 5.000 | 0.7430 | -3.379 | 41.790 | -7.525 | -0.250 | 0.240 | +| 5.200 | 0.7379 | -4.041 | 40.780 | -7.200 | -0.325 | 0.755 | + +Table 2.4: Average of the up and down ramp in the magnet DRAOO4. Moreover the harmonics are subtracted by the value of this average at 2 kAmp so that have a zero value at 2kAmp. Please see the following processing for the details DRAOO4.24344 28-APR-92 09.42.54 they + +| I | TF | 8TF | 62 | & | 66 | 01 | +|-------|--------|--------|--------|--------|--------------|------------| +| kAmp | T/kA | % | 10-4 | 10-4 | -0.165 10 -4 | 0.000 10-4 | +| 1.000 | 0.7721 | 0.005 | -0.405 | 0.130 | | | +| 1.200 | 0.7720 | -0.011 | ~0.350 | 0.210 | ~0.050 | -0.005 | +| 1.400 | 0.7722 | 0.018 | -0.315 | 0.165 | -0.225 | -0.010 | +| 1.600 | 0.7722 | 0.013 | -0.270 | 0.100 | -0.140 | -0.005 | +| 1.800 | 0.7722 | 0.006 | -0.185 | 0.075 | -0.150 | -0.020 | +| 2.000 | 0.7721 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7720 | -0.017 | 0.380 | -0.130 | -0.085 | -0.005 | +| 2.400 | 0.7718 | -0.045 | 1.110 | -0.355 | -0.110 | -0.005 | +| 2.600 | 0.7715 | ~0.079 | 2.245 | -0.725 | 0.085 | -0.010 | +| 2.800 | 0.7713 | -0.105 | 3.925 | -1.255 | 0.220 | -0.020 | +| 3.000 | 0.7708 | -0.174 | 6.230 | -1.900 | 0.255 | -0.030 | +| 3.200 | 0.7699 | -0.289 | 9.070 | -2.670 | 0.300 | -0.030 | +| 3.400 | 0.7691 | -0.390 | 12.230 | ~3.490 | 0.445 | -0.035 | +| 3.600 | 0.7676 | ~0.588 | 15.545 | -4.340 | 0.675 | -0.045 | +| 3.800 | 0.7660 | -0.789 | 19.010 | -5.055 | 0.315 | -0.060 | +| 4.000 | 0.7636 | -1.103 | 22.635 | -5.515 | 0.270 | -0.065 | +| 4.200 | 0.7611 | -1.422 | 26.180 | ~5.680 | 0.095 | -0.085 | +| 4.400 | 0.7580 | -1.826 | 29.350 | ~5.615 | -0.045 | -0.065 | +| 4.600 | 0.7543 | -2.301 | 31.900 | ~5.400 | -0.435 | -0.010 | +| 4.800 | 0.7502 | -2.841 | 33.680 | -5.255 | -0.625 | 0.060 | +| 5.000 | 0.7455 | -3.451 | 34.935 | -5.155 | -0.855 | 0.160 | +| 5.200 | 0.7403 | ~4.113 | 35.700 | -4.880 | -1.160 | 0.280 | +| 5.400 | 0.7349 | -4.813 | 35.940 | ~4.605 | -1.145 | 0.395 | + +Table 2.5: Average of the up and down ramp in the magnet DRBOO5. Moreover the harmonics are subtracted by the value of this average at 2 kAmp s0 that have a zero value at 2kAmp. Please see the following processing for the details DRBOO5.25013 27-APR-92 11.13.36 they + +| | IF | STF | 62 | 64 | 66 | 01 | +|-------------|---------------|---------------|--------|---------------|---------------|---------------| +| kAmp | TlkA | % | 10 4 | 10-4 | 10-4 | 0.055 10-4 | +| 1.000 | 0.7073 | 0.035 | -0.100 | ~0.075 | -0.005 | | +| 1.200 | 0.7073 | 0.029 | -0.055 | -0.030 | 0.025 | 0.035 | +| 1.400 | 0.7072 | 0.016 | -0.010 | -0.020 | 0.005 | 0.040 | +| 1.600 | 0.7072 | 0.019 | 0.000 | 0.025 | -0.090 | 0.020 | +| 1.800 | 0.7070 | -0.004 | 0.010 | -0.025 | 0.000 | 0.010 | +| 2.000 | 0.7071 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7071 | 0.001 | -0.025 | 0.055 | 0.000 | -0.005 | +| 2.400 | 0.7069 | -0.025 | -0.045 | 0.070 | -0.045 | -0.010 | +| 2.600 | 0.7069 | -0.028 | -0.075 | -0.005 | -0.030 | -0.010 | +| 2.800 | 0.7068 | ~0.042 | -0.175 | -0.010 | 0.005 | -0.010 | +| 3.000 | 0.7066 | ~0.058 | ~0.410 | -0.015 | -0.045 | -0.020 | +| 3.200 | 0.7063 | ~0.11l | -0.875 | -0.140 | -0.025 | -0.020 | +| 3.400 | 0.7057 | -0.187 | -1.570 | -0.240 | -0.090 | -0.040 | +| 3.600 | 0.7049 | -0.311 | -2.360 | -0.440 | -0.045 | -0.055 | +| 3.800 | 0.7039 0.7029 | -0.442 -0.582 | -3.205 | ~0.670 -0.895 | -0.085 -0.210 | -0.075 -0.100 | +| 4.000 | | | ~4.080 | | | | +| 4.200 | 0.7014 | -0.798 | -4.930 | -1.245 | -0.075 | -0.140 | +| 4.400 | 0.6994 | 1.081 | ~5.715 | -1.705 | -0.110 | -0.215 | +| 4.600 | 0.6969 | -1.432 | -6.395 | -2.245 | -0.125 | -0.305 | +| 4.800 | 0.6937 | -1.881 | -6.550 | ~2.945 | -0.160 | -0.405 | +| 5.000 | 0.6906 | -2.331 | -6.065 | -3.590 | ~0.230 | -0.530 | +| 5.200 | 0.6872 | -2.803 | ~5.110 | 4.060 | -0.285 | -0.675 | +| 5.400 | 0.6835 | -3.334 | -3.845 | -4.460 | -0.380 | -0.845 | +| 5.600 5.800 | 0.6796 | -3.878 | ~2.445 | ~4.585 | 0.440 | -1.060 | +| | 0.6753 | ~4.494 | -1.055 | -4.630 | -0.510 | -1.300 | + +Table 2.6: Average of the up and down ramp in the magnet DRBOO6 . Moreover the harmonics are subtracted by the value of this average at 2 kAmp so that have a zerO value at 2kAmp. Please see the following processing for the details DRBOO6.22743 27-APR-92 14.09,46 they + +| | TF. | 8TF | 62 | & | 66 | | +|-------|--------|--------|--------|--------|--------------|--------| +| kAmp | T/kA | % | 10 -4 | 10-4 | 10 -4 | 10-4 | +| 1.000 | 0.7082 | 0.019 | -0.010 | -0.055 | -0.040 | 0.025 | +| 1.200 | 0.7082 | 0.012 | 0.015 | -0.030 | 0.060 | 0.030 | +| 1.400 | 0.7084 | 0.048 | 0.030 | 0.015 | -0.055 | 0.010 | +| 1.600 | 0.7078 | -0.047 | 0.040 | -0.040 | -0.010 | 0.020 | +| 1.800 | 0.7077 | 0.048 | 0.010 | -0.055 | 0.015 | 0.010 | +| 2.000 | 0.7081 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7082 | 0.016 | -0.035 | -0.055 | 0.035 | -0.005 | +| 2.400 | 0.7080 | -0.019 | -0.085 | 0.000 | -0.005 | 0.010 | +| 2.600 | 0.7076 | ~0.064 | -0.165 | -0.075 | 0.045 | -0.015 | +| 2.800 | 0.7072 | -0.124 | -0.310 | -0.075 | 0.015 | -0.025 | +| 3.000 | 0.7071 | -0.144 | -0.585 | -0.135 | 0.005 | -0.030 | +| 3.200 | 0.7071 | -0.144 | -1.065 | -0.200 | -0.025 | -0.045 | +| 3.400 | 0.7068 | -0.181 | -1.765 | -0.380 | -0.065 | -0.080 | +| 3.600 | 0.7060 | -0.294 | -2.585 | -0.565 | 0.025 | -0.105 | +| 3.800 | 0.7052 | -0.407 | -3.485 | -0.750 | -0.070 0.120 | -0.155 | +| 4.000 | 0.7042 | -0.544 | -4.440 | -0.995 | | -0.225 | +| 4.200 | 0.7022 | -0.832 | -5.380 | -1.345 | -0.115 | ~0.310 | +| 4.400 | 0.7004 | -1.092 | -6.300 | -1.735 | -0.090 | -0.450 | +| 4.600 | 0.6983 | -1.387 | -7.130 | -2.310 | -0.150 | -0.590 | +| 4.800 | 0.6950 | 1.842 | 7.420 | -3.005 | -0.190 | -0.760 | +| 5.000 | 0.6917 | -2.310 | -7.055 | -3.680 | -0.215 | ~0.945 | +| 5.200 | 0.6889 | -2.711 | -6.180 | -4.225 | -0.305 | -1.185 | +| 5.400 | 0.6853 | ~3.211 | -4.990 | -4.580 | -0.335 | -1.470 | +| 5.600 | 0.6806 | -3.876 | -3.615 | -4.770 | -0.400 | -1.785 | +| 5.800 | 0.6767 | -4.438 | -2.305 | -4.795 | -0.440 | ~2.125 | + +Table 2.7: Average of the up and down ramp in the magnet DRCOO7. Moreover the harmonics are subtracted by the value of this average at 2 kAmp so that have a Zero value at 2kAmp. Please see the following processing for the details DRCOO7.23553 27-APR-92 14.36.35 they + +| | TF | STF % | 62 10-4 | 4 10-4 | 66 10-4 | 01 10-4 | +|-------|--------|---------|-----------|----------|-----------|-----------| +| kAmp | T/kA | | | -0.040 | -0.040 | -0.015 | +| 1.000 | 0.7087 | 0.050 | -0.085 | | | | +| 1.200 | 0.7086 | 0.028 | -0.025 | -0.055 | 0.075 | 0.000 | +| 1.400 | 0.7085 | 0.025 | 0.000 | -0.020 | -0.035 | 0.000 | +| 1.600 | 0.7085 | 0.020 | 0.010 | -0.020 | 0.005 | -0.005 | +| 1.800 | 0.7085 | 0.016 | 0.025 | -0.065 | 0.000 | -0.005 | +| 2.000 | 0.7084 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7084 | 0.002 | -0.005 | -0.075 | 0.060 | 0.005 | +| 2.400 | 0.7083 | ~0.009 | -0.050 | -0.010 | -0.015 | -0.005 | +| 2.600 | 0.7081 | -0.038 | -0.100 | -0.025 | -0.045 | 0.000 | +| 2.800 | 0.7081 | -0.040 | -0.195 | -0.075 | 0.050 | -0.005 | +| 3.000 | 0.7079 | -0.070 | -0.370 | -0.100 | 0.015 | -0.005 | +| 3.200 | 0.7077 | -0.099 | -0.680 | -0.150 | -0.025 | -0.005 | +| 3.400 | 0.7073 | -0.144 | -1.100 | -0.255 | 0.015 | -0.010 | +| 3.600 | 0.7067 | -0.228 | -1.525 | -0.400 | 0.025 | -0.015 | +| 3.800 | 0.7063 | 0.293 | -1.915 | -0.540 | -0.020 | ~0.015 | +| 4.000 | 0.7053 | -0.426 | -2.250 | -0.640 | -0.075 | -0.015 | +| 4.200 | 0.7041 | -0.599 | -2.415 | -0.875 | -0.045 | -0.005 | +| 4.400 | 0.7026 | -0.818 | ~2.345 | -1.095 | -0.050 | -0.005 | +| 4.600 | 0.7005 | -1.103 | -1.800 | -1.490 | 0.015 | -0.005 | +| 4.800 | 0.6980 | -1.467 | ~0.775 | -1.950 | 0.045 | -0.020 | +| 5.000 | 0.6950 | -1.883 | 0.345 | ~2.400 | -0.050 | -0.080 | + +Table 2.8: Average of the up and down ramp in the magnet DRCO08. Moreover the harmonics are subtracted by the value of this average at 2 kAmp S0 that have a ZeIO value at 2kAmp. Please see the following processing for the details DRCOO8.25463 27-APR-92 14.57.02 they + +| I | TF | 8TF | 3 | 64 | 66 | 01 | +|-------|--------|--------|--------|--------|-------------|-------------| +| kAmp | T/kA | % | 10-4 | 10 -4 | -0.065 10-4 | -0.005 10-4 | +| 1.000 | 0.7086 | 0.035 | -0.080 | 0.060 | | | +| 1.200 | 0.7086 | 0.036 | -0.010 | -0.020 | 0.135 | 0.010 | +| 1.400 | 0.7084 | 0.018 | 0.025 | -0.030 | 0.065 | 0.010 | +| 1.600 | 0.7086 | 0.038 | 0.025 | 0.025 | -0.030 | 0.000 | +| 1.800 | 0.7084 | 0.011 | 0.015 | -0.030 | 0.075 | 0.005 | +| 2.000 | 0.7083 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7082 | -0.014 | -0.020 | -0.025 | 0.080 | 0.000 | +| 2.400 | 0.7081 | -0.030 | -0.055 | -0.015 | 0.025 | -0.015 | +| 2.600 | 0.7081 | -0.036 | -0.110 | -0.045 | 0.060 | -0.025 | +| 2.800 | 0.7079 | -0.060 | -0.210 | -0.080 | 0.020 | -0.030 | +| 3.000 | 0.7079 | -0.061 | -0.395 | -0.095 | 0.045 | -0.040 | +| 3.200 | 0.7075 | -0.112 | -0.710 | -0.170 | 0.040 | -0.045 | +| 3.400 | 0.7072 | -0.159 | -1.140 | -0.255 | 0.005 | -0.065 | +| 3.600 | 0.7067 | -0.231 | -1.565 | -0.410 | 0.045 | -0.065 | +| 3.800 | 0.7060 | -0.323 | -1.970 | -0.550 | 0.040 | -0.075 | +| 4.000 | 0.7052 | -0.433 | -2.310 | -0.665 | -0.030 | -0.075 | +| 4.200 | 0.7041 | -0.600 | -2.505 | -0.825 | -0.070 | -0.065 | +| 4.400 | 0.7024 | -0.831 | ~2.445 | ~1.140 | 0.020 | -0.060 | +| 4.600 | 0.7004 | -1.112 | -1.915 | -1.400 | -0.045 | -0.055 | +| 4.800 | 0.6980 | -1.450 | -0.880 | -1.895 | 0.005 | -0.080 | +| 5.000 | 0.6951 | -1.868 | 0.465 | -2.370 | -0.010 | -0.120 | +| 5.200 | 0.6918 | -2.326 | 1.815 | -2.775 | -0.080 | -0.205 | + +Table 2.9: Average of the up and down ramp in the magnet DRDOO9. Moreover the harmonics are subtracted by the value of this average at 2 kAmp so that have a Zero value at 2kAmp. Please see the following processing for the details DRDOO9.101L4 30-APR-92 14.08.26 they + +| I | IF | STF | 3 | 64 | 66 | 01 | +|-------|--------|---------|--------|---------|-------|--------| +| kAmp | T/kA | % | 10-4 | 10-4 | 10-4 | 10-4 | +| 2.000 | 0.7076 | 0.000 | 0.0u0 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7074 | -0.022 | -0.145 | -0.050 | 0.065 | -0.015 | +| 2.400 | 0.7073 | -0.032 | -0.290 | -0.060 | 0.065 | -0.010 | +| 2.600 | 0.7071 | -0.063 | -0.405 | 0.145 | 0.155 | -0.005 | +| 2.800 | 0.7069 | -0.092 | -0.480 | -0.205 | 0.120 | -0.020 | +| 3.000 | 0.7066 | ~0.134 | ~0.480 | -0.280 | 0.105 | -0.030 | +| 3.200 | 0.7063 | -0.187 | ~0.400 | -0.420 | 0.110 | -0.055 | +| 3.400 | 0.7057 | -0.266 | -0.230 | -0.475 | 0.055 | -0.110 | +| 3.600 | 0.7047 | ~-0.411 | 0.050 | '-0.650 | 0.180 | -0.185 | +| 3.800 | 0.7036 | -0.568 | 0.425 | -0.795 | 0.255 | -0.275 | +| 4.000 | 0.7021 | -0.772 | 0.960 | -0.910 | 0.325 | -0.415 | +| 4.200 | 0.7002 | -1.037 | 1.730 | -1.110 | 0.385 | -0.625 | +| 4.400 | 0.6979 | -1.368 | 2.840 | -1.270 | 0.415 | -0.985 | +| 4.600 | 0.6950 | -1.780 | 4.330 | -1.,320 | 0.610 | -1.490 | +| 4.800 | 0.6917 | -2.239 | 5.925 | -1.265 | 0.665 | -1.985 | +| 5.000 | 0.6883 | -2.731 | 7.330 | -1.195 | 0.730 | -2.545 | +| 5.200 | 0.6845 | -3.261 | 8.325 | -1.060 | 0.745 | 3.110 | +| 5.400 | 0.6805 | -3.824 | 8.730 | -1.080 | 0.735 | -3.610 | +| 5.600 | 0.6763 | ~4.418 | 8.610 | -0.985 | 0.675 | 4.085 | +| 5.800 | 0.6720 | ~5.022 | 8.175 | -0.935 | 0.655 | -4.470 | +| 6.000 | 0.6676 | ~5.647 | 7.535 | -0.870 | 0.640 | -4.810 | +| 6.200 | 0.6632 | -6.273 | 6.875 | -0.795 | 0.605 | ~5.100 | +| 6.400 | 0.6589 | -6.880 | 6.275 | -0.725 | 0.550 | ~5.285 | +| 6.600 | 0.6547 | -7.477 | 5.675 | -0.645 | 0.455 | ~5.375 | + +## 3. Calculations + +In this section we present the results of the POISSON calculations for all magnets built and tested 50 namely DRAOOI through DRDOO9. We have ignored the effect of cryostat wall on field harmonics, which is present in all magnets. The most recent short magnets are discussed in reference 4 Just as in the case of measurements, we have shifted the harmonics to start them from zero, however, in the case of calculations are made zero at zero current (i.e., for %u calculations) instead of 2 kAlong far , long they + +The magnets DRAOOI, DRAOO2 and DRAOO3 were built at BBC with an identical iron Cross section. A POISSON model for them is shown in 3.1 and the results of calculations are given in Table 3.1. These magnets have a 5 mm gap between the coil and yoke. The POISSON model is made as per the drawings obtained from BBC. Fig; + +The magnet DRAOO4 was built at BNL with some modifications in the the DRA0O3 CrOSS sectionA POISSON model for DRAOO4 is shown in 3.2 and the results of calculations are given in Table 3.2. This magnet also has a 5 mm gap between the coil and yoke. The iron yoke model is based on the drawing No. 22-242.04-4 Revision B. Fig: + +The magnets DRBOO5 and DRBOO6 were built at BNL with an identical iron crOSS section. A POISSON model for them is shown in 3.3 and the results of calculations are given in Table 3.3. These magnets have a 10 mm gap between the coil and The model is based on the drawing No. 22-398.05-5. The is made of non-magnetic stainless steel. Fig; yoke. yoke key + +The magnets DRCOO7 and DRCOO8 were built at BNL with an identical iron cross section. A POISSON model for them is shown in Fig. 3.4 and the results of calculations are given in Table 3.4. These magnets have à 10 mm gap between the coil and As in the case of DRBOO5, the iron model is based on the drawing No. 22-398.05-5. The only difference between the DRBOO5 (or DRBOO6) and DRCOO7 (or DRCOO8) is that the material is changed from non-magnetic stainless steel to low carbon magnet steel. yoke. key + +The magnet DRDOO9 was built at BNL with a new iron Cross section. A POISSON model for it is shown in 3.5 and the results of calculations are given in Table 3.5. This magnet, like all other dipoles starting from DRBOO5, has a 10 mm gap between the coil and the The POISSON model for the is based on the drawing No. 22-714.02-5 Revision A Fig; yoke. yoke + +Figure 3.1: POISSON model for the 80 mm aperture RHIC arc dipole magnets DRAOOI\_ DRAOO2 and DRAOU3 . The model is made as per the drawings obtained from BBC. + + + +Table 3.1: Results of POISSON calculations for magnets DRAOOI, DRAOO2 DRAOO3. The result file is DRA123.LOG;4. and + +| kAmp | Bo Tesla | IF T/kA | 62 10-4 | 64 10-4 | 66 10 4 | 68 10-4 | bso 10-4 | 612 10-4 | +|--------|------------|-----------|-----------|-----------|-----------|-----------|------------|------------| +| 0 | 0 | 0 | 0 | 0.000 | 0.000 | 0 | 0 | 0 | +| 2 | 1.5102 | -0.03071 | 0.237 | -0.073 | 0.022 | -0.003 | 0 | 0 | +| 3 | 2.2622 | -0.16619 | 6.257 | -1.835 | 0.405 | -0.078 | 0.014 | -0.001 | +| 4 | 2.9899 | -1.04152 | 24.994 | -6.354 | 0.732 | -0.07 | 0 | 0.008 | +| 4.5 | 3.3305 | -2.01454 | 34.027 | -7.150 | 0.209 | 0.029 | -0.01 | 0.014 | +| 5 | 3.6479 | -3.41015 | 35.953 | -6.971 | -0.449 | 0.065 | -0.015 | 0.024 | +| 5.5 | 3.9362 | -5.25105 | 32.215 | -6.131 | -0.727 | 0.116 | -0.016 | 0.037 | +| 6 | 4.2058 | 7.19666 | 27.423 | ~5.170 | -0.812 | 0.159 | -0.019 | 0.052 | +| 7 | 4.7095 | -10.9285 | 18.742 | -3.643 | ~0.899 | 0.192 | -0.03 | 0.079 | +| 8 | 5.1882 | -14.1402 | 13.319 | ~2.283 | -0.946 | 0.208 | -0.04 | 0.103 | + +Figure 3.2: POISSON model for the 80 mm aperture RHIC arc dipole magnet DRAOO4. The iron model is based on the drawing No. 22 242.04-4 Revision B. yoke + + + +Table 3.2: Results of POISSON calculations for magnet DRAOO4. The result file is DRA4.LOG;5. + +| | Bo | TF | 62 10-4 | 64 10-4 | 66 | 68 10-4 | b1o | 612 10-4 | +|-------|--------|-----------|---------------|-----------|--------|--------------|--------|------------| +| kAmp | Tesla | T/kA | | | 10-4 | | 10-4 | | +| 0.000 | 0.0000 | 0.00000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 1.000 | 0.7551 | ~0.02383 | 0.041 | 0.004 | 0.003 | 0.001 | 0.000 | 0.000 | +| 2.000 | 1.5101 | -0.03165 | 0.245 | 0.063 | 0.021 | -0.003 | 0.000 | 0.000 | +| 3.000 | 2.2625 | -0.15058 | 5.678 | -1.623 | 0.363 | ~0.071 | 0.013 | -0.001 | +| 4.500 | 3.3411 | -1.70004 | 32.365 | ~5.865 | -0.018 | 0.026- | -0.015 | 0.013 | +| 5.000 | 3.6617 | ~3.04059 | 35.491 35.453 | ~5.797 | -0.798 | 0.029 -0.003 | -0.029 | 0.022 | +| 5.500 | 3.9565 | -4.75846 | | ~5.272 | -1.318 | | -0.045 | 0.033 | +| 6.000 | 4.2283 | -6.69863 | 34.234 | 4.161 | -1.473 | -0.011 | -0.056 | 0.046 | +| 7.000 | 4.7250 | -10.63282 | 25.556 | -2.493 | -1.430 | 0.046 | -0.059 | 0.075 | +| 8.000 | 5.1998 | -13.94705 | 17.941 | ~1.ll1 | -1.315 | 0.109 | -0.058 | 0.101 | + +Figure 3.3: POISSON model for the 80 mm aperture RHIC arc dipole magnets DRBOO5 and DRBOO6 . The model is based on the drawing No. 22-398.05-5. The is made of non-magnetic stainless steel. yoke key + + + +Table 3.3: Results of POISSON calculations for magnets DRBOO5 and DRBOO6. The result file is DRB5.LOG;1. + +| I kAmp | Bo | TF | 62 | 64 10-4 | 66 | 68 | 610 | b12 10-4 | +|----------|--------|----------|--------|-----------|--------|--------|--------|------------| +| | Tesla | T/kA | 10-4 | | 10-4 | 10-4 | 10-4 | | +| 0.000 | 0.0000 | 0.00000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 1.000 | 0.7074 | ~0.02261 | 0.020 | 0.001 | 0.003 | 0.001 | -0.001 | 0.000 | +| 2.000 | 1.4148 | -0.02600 | -0.003 | -0.002 | 0.001 | 0.001 | 0.000 | 0.000 | +| 3.000 | 2.1218 | -0.04791 | -0.196 | -0.031 | -0.003 | -0.001 | -0.001 | 0.000 | +| 4.000 | 2.8200 | -0.36729 | -3.051 | -0.787 | -0.103 | -0.019 | -0.004 | 0.002 | +| 4.500 | 3.1541 | -0.94530 | -6.476 | -1.918 | -0.208 | -0.048 | -0.008 | 0.005 | +| 5.000 | 3.4682 | -1.97496 | -8.774 | -3.974 | -0.383 | -0.082 | -0.015 | 0.010 | +| 5.500 | 3.7665 | -3.22082 | 7.239 | ~5.422 | 0.599 | -0.101 | -0.020 | 0.017 | +| 6.000 | 4.0439 | 4.75201 | ~5.051 | ~5.753 | -0.748 | -0.121 | -0.022 | 0.026 | +| 7.000 | 4.5449 | -8.24351 | ~5.612 | -5.254 | -0.791 | -0.127 | -0.020 | 0.051 | + +Figure 3.4: POISSON model for the 80 mm aperture RHIC arc dipole magnets DRCOO7 and DRCOO8. The iron model is based on the drawing No 22-398.05-5. The is made of low carbon magnetic steel. yoke key + + + +Table 3.4: Results of POISSON calculations for magnets DRCOO7 and DRCOO8 . The result file is DRC7.log;2. + +| kAmp | Bo Tesla | TF T/kA | 62 10-4 | 64 10-4 | 66 10-4 | 68 10-4 | 61o 10 -4 | 612 10-4 | +|-------------|------------|-----------|-----------|-----------|-----------|-----------|-------------|------------| +| 0.000 | 0 | 0.00000 | 0 | 0.000 | 0.000 | 0 | 0 | 0 | +| 1.000 | 0.7074 | -0.02247 | 0.021 | 0.001 | 0.002 | 0.001 | 0 | 0 | +| 2.000 | 1.4149 | -0.02530 | 0.003 | -0.001 | 0.002 | 0.001 | -0.001 | 0 | +| 3.000 | 2.122 | -0.03943 | -0.053 | -0.006 | 0.000 | 0 | 0 | 0 | +| 4.000 | 2.824 | -0.22915 | -0.622 | -0.376 | ~0.033 | -0.007 | -0.002 | 0.001 | +| 4.500 | 3.1628 | -0.67301 | -1.444 | -1.073 | -0.064 | -0.026 | -0.004 | 0.004 | +| 5.000 5.500 | 3.4851 | -1.49560 | 0.751 | -2.393 | -0.119 | -0.038 | -0.008 | 0.008 | +| | 3.7835 | -2.78350 | 2.179 | -3.804 | -0.340 | -0.06 | 0.014 | 0.015 | +| 6.000 | 4.0558 | ~4.47243 | 1.595 | ~4.542 | -0.556 | -0.092 | -0.018 | 0.025 | +| 7.000 | 4.5525 | ~8.09129 | -1.519 | -4.469 | -0.665 | -0.108 | -0.017 | 0.05 | +| 7.500 | 4.7913 | -9.71831 | -2.708 | ~4.160 | -0.637 | -0.103 | -0.016 | 0.062 | +| 8.000 | 5.0274 | -11.18983 | -3.509 | -3.835 | -0.601 | -0.096 | -0.014 | 0.073 | + +Figure 3.5: POISSON model for the 80 mm aperture RHIC arc dipole magnet DRDOO9. The model is based on the drawing No. 22-714.02-5 Revision A yoke + + + +Table 3.5: The results of POISSON calculations for the RHIC magnet DRDOO9 . The results are stored on file DRD9.LOG;2. + +| kAmp | Bo Tesla | TF TlkA | 62 10-4 | 64 10-4 | 66 10-4 | b8 10 -4 | 610 10-4 | 10-4 b1? | +|--------|------------|-----------|-----------|-----------|-----------|------------|------------|------------| +| 0 | 0 | 0 | 0 | 0.000 | 0 | 0 | 0 | 0 | +| 1.415 | 1.0004 | -0.02482 | 0.04 | 0.004 | 0.002 | 0.001 | -0.001 | 0 | +| 2 | 1.414 | -0.02715 | 0.03 | 0.007 | 0.002 | 0.001 | 0 | 0 | +| 3 | 2.12 | -0.07239 | 0.533 | -0.090 | 0.037 | -0.007 | 0.001 | 0 | +| 4 | 2.8081 | -0.72783 | 3.105 | -0.437 | 0.243 | -0.055 | 0.003 | 0.003 | +| 4.5 | 3.1306 | -1.62474 | 6.527 | -0.550 | 0.477 | -0.095 | 0.001 | 0.008 | +| 4.75 | 3.2833 | -2.25619 | 8.585 | -0.442 | 0.582 | -0.107 | -0.005 | 0.012 | +| 5 | 3.4295 | -3.00662 | 9.396 | -0.446 | 0.618 | -0.116 | -0.01 | 0.017 | +| 5.25 | 3.5702 | -3.83722 | 8.863 | -0.563 | 0.599 | -0.119 | -0.015 | 0.022 | +| 5.5 | 3.7072 | -4.68668 | 7.873 | -0.635 | 0.567 | -0.117 | -0.018 | 0.027 | +| 6 | 3.9721 | -6.3851 | 5.264 | -0.602 | 0.511 | -0.097 | -0.018 | 0.039 | +| 7 | 4.4806 | -9.48737 | 1.663 | ~0.380 | 0.381 | -0.058 | -0.013 | 0.061 | +| 8 | 4.9688 | -12.1708 | 0.178 | -0.333 | 0.254 | -0.033 | -0.009 | 0.082 | + +## 4. Calculations versus Measurements + +In this section we compare measurements and the calculations for the current dependence of the field harmonics (b2 and b4 only) in all magnets . The calculations are done for the saturation induced harmonics with the computer codes POISSON, PEZD and MDP. Tle current dependence on the feld harmonics maj also come due to a small coil deformation as a result of the Lorentz force on the coil. This has not been included in the calculations. The b6 harmonic could not be obtained to the desired accuracy in the earlier magnets (DRAOOI through DRCO08) to make any meaningful comparison. In the latest magnet DRDO09, the agreement between the calculations and measurements for the current dependence of b6 is better than 4 unit. long long + +In Fig. 4.1 and 4.2 we have plotted computed and measured b2 and b4 as a function of current for the three magnets DRAOOI, DRAO02 and DRA003, made with the same iron cross-section. Tle calculations are made with the code POISSON, PEZD and MDP. Fig + +In 4.3 and 4.4 we have done the same comparison between the calculations and measurements for the magnet DRAOO4. The calculations are made with the code POISSON, PEZD and MDP. FigFig; + +In 4.5 and 4.6 b2 and b4 are plotted for magnets DRBOO5 and DRBOO6 for the calculations and measurements. The calculations are made with the code POISSON, PEZD and MDP. Fig; Fig. + +In the case of magnets DRCOO7 and DRCO08 the calculations are made with POISSON and PEZD The computed and measured b2 and b4 are plotted in Fig. 4.7 and Fig. 4.8. + +In 4.9 and Fig- 4.10 we have done the same comparison between the calculations and measurements for the magnet DRDOO9. The calculations are made with the code POISSON and PEZD Fig + +## Computed and measured b2 in DRAOOI , DRAOO2 and DRAOO3 + +Figure 4.1: Computed and measured b2 variation as a function of current in the 80 mm aperture RHIC afC dipole magnets DRA0OI, DRAOO2 and DRAOO3. These three magnets are made with the same iron cross section. The calculations are made with the codes POISSON, PEZD and MDP. + + + +## Computed and measured b4 in DRAOOI, DRAOO2 and DRAOO3 + +Figure 4.2: Computed and measured b4 variation as a function of current in the 80 mm aperture RHIC arc dipole magnets DRA0OI, DRAOO2 and DRAOO3 . These three magnets are made with the same iron cross section. The calculations are made with the codes POISSON, PEZD and MDP. + + + +## Computed and measured b2 in DRAOO4 + +[GUPTARHICDIPIDRA4 RESO;5 2 0PARHI81PPRA88 2E2,5592 + +Figure 4.3: Computed and measured b2 variation as a function of current in the 80 mm aperture RHIC arc dipole magnet DRAOO4. The calculations are made with the codes POISSON, PEZD and MDP. + + + +- 4 IGUPTAMEASURE RHICIDRAOO4A4 HARM:2 +- 4 +- 4 + +Table 2.5: Average of the up and down ramp in the magnet DRBOO5. Moreover the harmonics are subtracted by the value of this average at 2 s0 that have a zero value at 2kAmp. Please see the following processing for the details DRBOO5.25013 27-APR-92 11.13.36 kAmp they + +| | TF | STF | 62 | < | 66 | 01 | +|-------|--------|--------|--------|--------|--------|--------| +| kAmp | T/kA | % | 10-4 | 10-4 | 10-4 | 10-4 | +| 1.000 | 0.7073 | 0.035 | -0.100 | -0.075 | -0.005 | 0.055 | +| 1.200 | 0.7073 | 0.029 | -0.055 | -0.030 | 0.025 | 0.035 | +| 1.400 | 0.7072 | 0.016 | ~0.010 | -0.020 | 0.005 | 0.040 | +| 1.600 | 0.7072 | 0.019 | 0.000 | 0.025 | -0.090 | 0.020 | +| 1.800 | 0.7070 | -0.004 | 0.010 | -0.025 | 0.000 | 0.010 | +| 2.000 | 0.7071 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | +| 2.200 | 0.7071 | 0.001 | -0.025 | 0.055 | 0.000 | -0.005 | +| 2.400 | 0.7069 | -0.025 | -0.045 | 0.070 | 0.045 | -0.010 | +| 2.600 | 0.7069 | -0.028 | ~0.075 | -0.005 | -0.030 | -0.010 | +| 2.800 | 0.7068 | -0.042 | -0.175 | -0.010 | 0.005 | -0.010 | +| 3.000 | 0.7066 | ~0.058 | -0.410 | -0.015 | -0.045 | -0.020 | +| 3.200 | 0.7063 | 0.1ll | -0.875 | -0.140 | -0.025 | -0.020 | +| 3.400 | 0.7057 | -0.187 | -1.570 | -0.240 | -0.090 | -0.040 | +| 3.600 | 0.7049 | ~0.311 | -2.360 | -0.440 | -0.045 | ~0.055 | +| 4.000 | 0.7029 | -0.582 | -4.080 | -0.895 | -0.210 | -0.100 | +| 4.200 | 0.7014 | -0.798 | -4.930 | -1.245 | -0.075 | -0.140 | +| 4.400 | 0.6994 | -1.081 | ~5.715 | -1.705 | -0.110 | -0.215 | +| 4.600 | 0.6969 | -1.432 | ~6.395 | -2.245 | -0.125 | -0.305 | +| 4.800 | 0.6937 | -1.881 | -6.550 | -2.945 | -0.160 | -0.405 | +| 5.000 | 0.6906 | -2.331 | -6.065 | -3.590 | -0.230 | -0.530 | +| 5.200 | 0.6872 | -2.803 | ~5.110 | -4.060 | -0.285 | -0.675 | +| 5.400 | 0.6835 | -3.334 | -3.845 | ~4.460 | -0.380 | -0.845 | +| 5.600 | 0.6796 | -3.878 | -2.445 | -4.585 | -0.440 | -1.060 | +| 5.800 | 0.6753 | ~4.494 | -1.055 | -4.630 | -0.510 | -1.300 | + +- 8 2 +- 8 2 + +## Computed and measured 64 in DRAOO4 + +- EGUPTSRHICDIPBRA884PEPRES:2 + +Figure 4.4: Computed and measured b4 variation as a function of current in the 80 mm aperture RHIC arc dipole magnet DRAOO4. The calculations are made with the codes POISSON, PE2D and MDP. + + + +- 8 [GUPTAMEASURE RHICIDRAOOZA4 HARM:2 + +## Computed and measured b2 in DRBOO5 and DRBOO6 + +Figure 4.5: Computed and measured b2 variation as a function of current in the 80 mm aperture RHIC arc dipole magnets DRBOO5 and DRBOO6. These two magnets are made with the same iron cross section. The calculations are made with the codes POISSON, PE2D and MDP . + + + +## Computed and measured b4 in DRBOO5 and DRBOO6 + +Figure 4.6: Computed and measured b4 variation as a function of current in the 80 mm aperture RHIC arc dipole magnets DRBOO5 and DRBOO6 . These two magnets are made with the same iron cross section. The calcu lations are made with the codes POISSON, PEZD and MDP. + + + +## Computed and measured b2 in DRCOO7 and DRCOO8 + +Figure 4.7: Computed and measured b2 variation as a function of current in the 80 mm aperture RHIC afC dipole magnets DRCOO7 and DRCOO8. These two magnets are made with the same iron cross section. The calcu lations are made with the codes POISSON and PEZD. + + + +## Computed and measured b4 in DRCOO7 and DRCOO8 + +Figure 4.8: Computed and measured b4 variation as a function of current in the 80 mm aperture RHIC arc dipole magnets DRCOO7 and DRCO08. These magnets are made with the same iron cross section. The calcu lations are made with the codes POISSON and PE2D\_ two + + + +## Computed and measured 62 in DRDOO9 + +Figure 4.9: Computed and measured b2 variation as a function of current in the 80 mm aperture RHIC arc dipole magnet DRDOO9. The calculations are made with the codes POISSON and PE2D- + + + +Computed and measured b4 in DRDOO9 + +Figure 4.10: Computed and measured b4 variation as a function of current in the 80 mm aperture RHIC arc dipole magnet DRDOO9. The calculations are made with the codes POISSON and PEZD + + + +## 5. DRE cross section + +For the sake of completeness we present the expected and computed harmonics in the next series of magnets DREOIl and DREO12. The only difference in the yoke design between DRDOO9 and DREOIl is the presence of a : diameter saturation suppressor hole at a radius of 7.5 cm and at an angle of 330 degree. It has been described in detail in reference 5. Computed harmonics are obtained from the POISSON calculations and the expected harmonics are obtained by first taking the measured harmonics in the magnet DRDOO9, and then empirically adding to them the differences between the calculations and measurements in DRDO09. The results are given in 5.1. long Fig; + +Figure 5.1: Expected and computed saturation induced harmonics in the dipole DRFOII with saturation suppressor hole. Computed harmonics are obtained from the POISSON calculations and the expected harmonics are obtained by first taking the measured harmonics in the magnet DRDO09, and then empirically adding to them the differences between the calculations and measurements in DRDOO9. long + + + +## 6 . Discussion + +One can see from Fig. 2.1 that we have been able t0 reduce the current dependence of the sextupole harmonic (b2) by over an order of magnitude between 2 kA and 5 kA. The value of design current in the arc dipole for RHIC operation is ~5 kA. In the first magnet DRAOO1, the maximum variation in the b2 harmonic between the 2 kA and 5 kA current was over 42 unit and in the most recent short magnet this variation is reduced to under 2 unit. In the dipole magnet DREOll, we expect this to be under 2 unit as well. Similarly one can see from 2.2 that b4 variation has also been reduced by over an order of magnitude between 2 kA and 5 kA. In the first magnet DRAOOI, the maximum variation in the b4 harmonic between the 2 kA and 5 kA current was over 8 unit and in the most recent short magnet this variation is reduced to under 1/2 unit. In the dipole magnet DREOll, we expect the current dependent variation in the b4 harmonic to be under 1/2 unit as well. In the following paragraph we shall discuss what has been done to achieve this. We shall only discuss the features which were important from the iron saturation of view only and mechanical changes in the would be ignored. long long Fig; long long design point + +DRAOOI, DRAOO2 and DRA0O3 dipoles were constructed by BBC. They had a 5mm radial gap between coil and and had a notch at the location. A small gap and a notch both give a large iron saturation and hence we had over 42 unit of b2 harmonic and -8 unit of b4 DRAOO4 had the same basic feature except for some small changes near the outer surface of iron. These changes do not alter the iron saturation significantly. pole yoke pole + +To reduce iron saturation; the radial gap between the coil and was increased from 5mm to lOmm and the coil-yoke locating notch was moved from to midplane in the magnets DRBOO5 and DRBOO6. This brought b2 saturation down from +42 unit to -6 unit and b4 saturation from -8.5 unit to -3.6 unit. As before, these are the maximum deviation between 2 kA and 5 kA. This magnet had a non-magnetic stainless steel midplane In the magnets DRCOO7 and DRCO08, the material of this was changed from non-magnetic stainless steel to magnetic low carbon steel This change reduced b2 saturation to -2.5 unit and b4 saturation to -2.4 unit. In between a short magnet was built where the 5 mm midplane notch was modified to a 5mm iron tooth That reduced b2 saturation to +8 unit and b4 to -1.1 unit. However, the tooth idea was not adopted in DRCOO7 because of its mechanical complications. yoke pole yoke key. key key key. + +Neither the midplane notch nor the tooth (better magnetically but worse mechanically) was preferred for the production magnets. It is believed that a locating notch would be better able to define the location of the coil. As mentioned earlier, notch is bad magnetically. That in itself would make an already unacceptable saturation worse\_ pole pole pole + +Therefore, a detailed study was undertaken to modify the cross section to significanty change the magnetics of the with the desired mechanical properties. After considering a large number of variations, the one chosen for DRDOO9 was the one in which the location of the bypass hole was changed. This, with a notch and stainless steel actually improved the iron saturation (in b4 harmonic) relative to DRBOO5 instead of making it worse. The b2 saturation became +7 unit and b4 -1.3 unit. yoke pole key, + +Finally a small saturation suppressor hole was added to practically eliminate all b2 and b4 saturation in DREOII cross section Before we discuss that, let uS examine the differences between the calculations and measurements as are given in Table 6.1. These calculations are done with the code POISSON and ignore cryostat. Typically, at 5 kA cryostat induced b2 is ~+1.5 unit and b4 is ~-0.1 unit. Moreover, as mentioned earlier; the calculations are done only for the saturation induced harmonics and the harmonics due to coil deformation as a result of the Lorentz force on the coil are ignored. We have also ignored a small gap (of the order of 10 mil) between the and bottom halves of the yokes. Some calculations show that this maj give as much of 2 units of b2 and 0.2 units of b4 at 5 kA they they top + +In Table 6.1, we have also given the maximum change in the measured values of b2 and b4 harmonics till 5 kA. The diference between the calculations and measurements did not bother much when the actual value of the saturation induced harmonic was However, at this stage did matter as the target to make those harmonic becamne so small. The target was to make b2 saturation less then 2 unit and b4 saturation less then ! unit. This is within the difference between the calculations and measurements Therefore, we empirically cancel out these small unexplained differences between the calculations and measurements (in this particular cross section) in arriving to an optimized location of the hole. The approach indeed worked as can be seen in Fig. 2.1 and 2.2 and described in detail in reference 4. In these figures please see curves marked for DRSGR where DRSGR represents the short dipole "DRSOO6 rebuilt with the saturation suppressor holes" large. they Fig. + +Table 6.1: The measured, computed and the difference between the two in the values of b2 and b4 harmonics at 5 kA relative to 2 kA value (i.e, value at 5 kA value at 2 kA) in RHIC magnets built to date. These calculations are done with the code POISSON and ignore cryostat. Typically, at 5 kA cryostat induced b2 is ~+1.5 unit and 64 is ~-0.1 unit. long they + +| Magnet name | b2 Measured | b2 Computed | difference Msr-Cal | b4 Measured | 64 Computed | difference Msr-Cal | +|---------------|---------------|---------------|----------------------|---------------|---------------|----------------------| +| DRAOOI | 42.8 | 36 | +6.8 | -8.1 | -7.0 | ~1l | +| DRAOO2 | 39.7 | 36 | +3.7 | 7.4 | -7.0 | ~0.4 | +| DRAOO3 | 41.8 | 36 | 45.8 | ~7.5 | -7.0 | -0.5 | +| DRAOO4 | 34.5 | 35.5 | ~1.l | -5.2 | -5.8 | +0.6 | +| DRBOO5 | -6.1 | 8.8 | +2.7 | ~3.6 | ~4.0 | 40.4 | +| DRBOO6 | -7.1 | -8.8 | +1.7 | -3.7 | 24.0 | +0.3 | +| DRCOO7 | 0.4 | 0.8 | -0.4 | ~2.4 | ~2.4 | 0.0 | +| DRCoO8 | 0.5 | 0.8 | -0.3 | -2.4 | -2.4 | 0.0 | +| DRDOO9 | 7.3 | 9.4 | -2.1 | -1.2 | -0.4 | -0.8 | + +## 7 References + +- 1. P.A. Thompson; et.al., "Iron saturation control in RHIC dipole magnets" Presented at 1991 Particle Accelerator Conference +- 2 . Testing and Measurement Group Notes describing the results of magnetic measurements. +- 3 . P.A. Thompson, Magnet Division Notes describing design and comparing calculations with measurements. +- 4 R. Gupta, "DRSOO6 with Saturation Suppressor Holes" = Magnet Division Note No. 457-16 (RHIC-MD-165), July 28, 1992. +- 5. R. Gupta, "Reducing iron saturation in arc dipoles with a saturation suppressor hole" Magnet Division Note No. 447-16 (RHIC-MD-158) June 10, 1992. \ No newline at end of file diff --git a/llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.txt b/llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.txt new file mode 100644 index 00000000..7a4013b8 --- /dev/null +++ b/llm-service/JJL4WAJY5A3L4SVYJHLWTYK7OA4IFJ5A.txt @@ -0,0 +1,165 @@ +BNL\_47931 AD/RHC-113 Informal Report + +A Review of the Saturation Induced Harmonics in the 80 mm Aperture RHIC Arc Dipole Magnets + +R. Gupta, P. Thompson and P. Wanderer + +August 1992 + +R HI C P R 0 J E C T + +Brookhaven National Laboratory Associated Universities, Inc. Upton, NY 11973 + +Under Contract No. DE-AC02-76CHOO016 with the UNITED STATES DEPARTMENT OF ENERGY + +A Review of the Saturation Induced Harmonics in the 80 mm Aperture RHIC Arc Dipole Magnets + +R. Gupta, P. Thompson and P. Wanderer + +1. Introduction + +In this note we shall review, at times with a sense of history, the measured and computed saturation induced harmonics in the cross section of all and short 80 mm aperture RHIC dipole magnets built so far. A somewhat similar study for a fewer magnets has been presented earlier in reference 1 . With the help of several iterations in the crOSS section, we have been able to reduce the saturation induced b2 and b4 harmonics by more then an order of magnitude. We shall briefly describe those iterations. The calculations described in this note have generally been done with the computer program POISSON. However, while comparing the calculations and measurements, we have included the results of field calculations with the code PEZD and MDP as well. The measurements are the average of up and down ramps. A small difference between the calculations and measurements has been observed consistently in the saturation induced b2 and b4 harmonics in all magnets DRAOO1 through DRA0O9. More work is still needed to the current dependence of skew quadrupole harmonic (a1) We refer to current dependence of harmonics loosely as the saturation induced harmonics; but in an actual magnet it includes other effects like the harmonics induced by the coil deformation due to lorentz forces, etc. long yoke explain + +2 . Measurements + +In Fig. 2.1 through 2.4, we have summarized the measured current dependence of b2, b4, b6 and a1 harmonics in the 80 mm aperture RHIC dipoles built and tested to date. We present measurements only after 2 kAmp and are the results of the averaging the up and down ramp. In order to make it easier to compare, we have shifted all harmonics to start them from a zero value at 2 kAmp. These measurements have been presented and discussed in detail earlier in various Testing and Measuring Group Notes by Wanderer? et.al. and in Magnet Division Notes by Thompson? . Fig; they + +One can note in Fig. 2.1 and Fig. 2.2 that the b2 and b4 saturation in the most recent dipole DRSGR (DRSOOG Rebuilt with saturation suppressor hole) is signifcantly lower4 then in the earliest dipole DRAI through DRA4. In DRAl the maximum measured b2 saturation till the design current of 5 kAmp was 43 unit; in contrast to that in DRSOOGR it is under 2 unit. Similarly; in DRAI the maximum measured b4 saturation till 5 kAmp current was 8.5 unit; in contrast in DRSGRit is under 0.5 unit. The b6 saturation (Fig. 2.3) had a large fluctuations in the measurements in the earlier RHIC dipoles. It may have been -1 unit in DRAl; in magnet DRSGR, it is observed to be 1.2 unit maximum + +In 2.4, we have plotted the a1 saturation in the and short dipoles. It is clear that a large magnet to magnet variation has been observed both in the and in the short dipoles. A current dependence is to be expected in the skew quadrupole harmonics (a1) at high current when the fux lines can not be contained in the iron and start going through the low carbon steel cryostat which is asymmetrically located with respect to the magnet center. However, n0 current dependence was to be expected in the earlier magnets which were located symmetrically in the cryostat and in the short dipoles which are not inside a cryostat. long Fig: long yoke they long put + +In Table 2.1 through Table 2.9, we have presented the numerical values of the harmonics plotted in 2.1 through Fig. 2.4 for each magnet DRAOOI through DRDOO9. We have not presented the short magnets as most of them were measured with a 30' coil. The 30 coil measurements in the short magnets not only reflect the measured harmonics in the straight section but also include the effects of the ends (coil length 36.9" ), particularly in the iron saturation at high current where field lines tend to move more toward the two ends. The measurements with the 9" coils in magnets DRSOO6 and DRSOO8 have been described in detail in reference 4. long Fig: + +History of 62 Saturation in RHIC Dipoles + + + +History of b6 Saturation in RHIC Dipoles + + +History of al Saturation in RHIC Dipoles + + + + + + + + + + + +3. Calculations + +In this section we present the results of the POISSON calculations for all magnets built and tested 50 namely DRAOOI through DRDOO9. We have ignored the effect of cryostat wall on field harmonics, which is present in all magnets. The most recent short magnets are discussed in reference 4 Just as in the case of measurements, we have shifted the harmonics to start them from zero, however, in the case of calculations are made zero at zero current (i.e., for %u calculations) instead of 2 kAlong far , long they + +The magnets DRAOOI, DRAOO2 and DRAOO3 were built at BBC with an identical iron Cross section. A POISSON model for them is shown in 3.1 and the results of calculations are given in Table 3.1. These magnets have a 5 mm gap between the coil and yoke. The POISSON model is made as per the drawings obtained from BBC. Fig; + +The magnet DRAOO4 was built at BNL with some modifications in the the DRA0O3 CrOSS sectionA POISSON model for DRAOO4 is shown in 3.2 and the results of calculations are given in Table 3.2. This magnet also has a 5 mm gap between the coil and yoke. The iron yoke model is based on the drawing No. 22-242.04-4 Revision B. Fig: + +The magnets DRBOO5 and DRBOO6 were built at BNL with an identical iron crOSS section. A POISSON model for them is shown in 3.3 and the results of calculations are given in Table 3.3. These magnets have a 10 mm gap between the coil and The model is based on the drawing No. 22-398.05-5. The is made of non-magnetic stainless steel. Fig; yoke. yoke key + +The magnets DRCOO7 and DRCOO8 were built at BNL with an identical iron cross section. A POISSON model for them is shown in Fig. 3.4 and the results of calculations are given in Table 3.4. These magnets have à 10 mm gap between the coil and As in the case of DRBOO5, the iron model is based on the drawing No. 22-398.05-5. The only difference between the DRBOO5 (or DRBOO6) and DRCOO7 (or DRCOO8) is that the material is changed from non-magnetic stainless steel to low carbon magnet steel. yoke. key + +The magnet DRDOO9 was built at BNL with a new iron Cross section. A POISSON model for it is shown in 3.5 and the results of calculations are given in Table 3.5. This magnet, like all other dipoles starting from DRBOO5, has a 10 mm gap between the coil and the The POISSON model for the is based on the drawing No. 22-714.02-5 Revision A Fig; yoke. yoke + + + + + + + + + + + +4. Calculations versus Measurements + +In this section we compare measurements and the calculations for the current dependence of the field harmonics (b2 and b4 only) in all magnets . The calculations are done for the saturation induced harmonics with the computer codes POISSON, PEZD and MDP. Tle current dependence on the feld harmonics maj also come due to a small coil deformation as a result of the Lorentz force on the coil. This has not been included in the calculations. The b6 harmonic could not be obtained to the desired accuracy in the earlier magnets (DRAOOI through DRCO08) to make any meaningful comparison. In the latest magnet DRDO09, the agreement between the calculations and measurements for the current dependence of b6 is better than 4 unit. long long + +In Fig. 4.1 and 4.2 we have plotted computed and measured b2 and b4 as a function of current for the three magnets DRAOOI, DRAO02 and DRA003, made with the same iron cross-section. Tle calculations are made with the code POISSON, PEZD and MDP. Fig + +In 4.3 and 4.4 we have done the same comparison between the calculations and measurements for the magnet DRAOO4. The calculations are made with the code POISSON, PEZD and MDP. FigFig; + +In 4.5 and 4.6 b2 and b4 are plotted for magnets DRBOO5 and DRBOO6 for the calculations and measurements. The calculations are made with the code POISSON, PEZD and MDP. Fig; Fig. + +In the case of magnets DRCOO7 and DRCO08 the calculations are made with POISSON and PEZD The computed and measured b2 and b4 are plotted in Fig. 4.7 and Fig. 4.8. + +In 4.9 and Fig- 4.10 we have done the same comparison between the calculations and measurements for the magnet DRDOO9. The calculations are made with the code POISSON and PEZD Fig + +Computed and measured b2 in DRAOOI , DRAOO2 and DRAOO3 + + +Computed and measured b4 in DRAOOI, DRAOO2 and DRAOO3 + + +Computed and measured b2 in DRAOO4 + +[GUPTARHICDIPIDRA4 RESO;5 2 0PARHI81PPRA88 2E2,5592 + + + + 4 IGUPTAMEASURE RHICIDRAOO4A4 HARM:2 + 4 + 4 + + + + 8 2 + 8 2 + +Computed and measured 64 in DRAOO4 + + EGUPTSRHICDIPBRA884PEPRES:2 + + + + 8 [GUPTAMEASURE RHICIDRAOOZA4 HARM:2 + +Computed and measured b2 in DRBOO5 and DRBOO6 + + +Computed and measured b4 in DRBOO5 and DRBOO6 + + +Computed and measured b2 in DRCOO7 and DRCOO8 + + +Computed and measured b4 in DRCOO7 and DRCOO8 + + +Computed and measured 62 in DRDOO9 + + +Computed and measured b4 in DRDOO9 + + +5. DRE cross section + +For the sake of completeness we present the expected and computed harmonics in the next series of magnets DREOIl and DREO12. The only difference in the yoke design between DRDOO9 and DREOIl is the presence of a : diameter saturation suppressor hole at a radius of 7.5 cm and at an angle of 330 degree. It has been described in detail in reference 5. Computed harmonics are obtained from the POISSON calculations and the expected harmonics are obtained by first taking the measured harmonics in the magnet DRDOO9, and then empirically adding to them the differences between the calculations and measurements in DRDO09. The results are given in 5.1. long Fig; + + +6 . Discussion + +One can see from Fig. 2.1 that we have been able t0 reduce the current dependence of the sextupole harmonic (b2) by over an order of magnitude between 2 kA and 5 kA. The value of design current in the arc dipole for RHIC operation is ~5 kA. In the first magnet DRAOO1, the maximum variation in the b2 harmonic between the 2 kA and 5 kA current was over 42 unit and in the most recent short magnet this variation is reduced to under 2 unit. In the dipole magnet DREOll, we expect this to be under 2 unit as well. Similarly one can see from 2.2 that b4 variation has also been reduced by over an order of magnitude between 2 kA and 5 kA. In the first magnet DRAOOI, the maximum variation in the b4 harmonic between the 2 kA and 5 kA current was over 8 unit and in the most recent short magnet this variation is reduced to under 1/2 unit. In the dipole magnet DREOll, we expect the current dependent variation in the b4 harmonic to be under 1/2 unit as well. In the following paragraph we shall discuss what has been done to achieve this. We shall only discuss the features which were important from the iron saturation of view only and mechanical changes in the would be ignored. long long Fig; long long design point + +DRAOOI, DRAOO2 and DRA0O3 dipoles were constructed by BBC. They had a 5mm radial gap between coil and and had a notch at the location. A small gap and a notch both give a large iron saturation and hence we had over 42 unit of b2 harmonic and -8 unit of b4 DRAOO4 had the same basic feature except for some small changes near the outer surface of iron. These changes do not alter the iron saturation significantly. pole yoke pole + +To reduce iron saturation; the radial gap between the coil and was increased from 5mm to lOmm and the coil-yoke locating notch was moved from to midplane in the magnets DRBOO5 and DRBOO6. This brought b2 saturation down from +42 unit to -6 unit and b4 saturation from -8.5 unit to -3.6 unit. As before, these are the maximum deviation between 2 kA and 5 kA. This magnet had a non-magnetic stainless steel midplane In the magnets DRCOO7 and DRCO08, the material of this was changed from non-magnetic stainless steel to magnetic low carbon steel This change reduced b2 saturation to -2.5 unit and b4 saturation to -2.4 unit. In between a short magnet was built where the 5 mm midplane notch was modified to a 5mm iron tooth That reduced b2 saturation to +8 unit and b4 to -1.1 unit. However, the tooth idea was not adopted in DRCOO7 because of its mechanical complications. yoke pole yoke key. key key key. + +Neither the midplane notch nor the tooth (better magnetically but worse mechanically) was preferred for the production magnets. It is believed that a locating notch would be better able to define the location of the coil. As mentioned earlier, notch is bad magnetically. That in itself would make an already unacceptable saturation worse\_ pole pole pole + +Therefore, a detailed study was undertaken to modify the cross section to significanty change the magnetics of the with the desired mechanical properties. After considering a large number of variations, the one chosen for DRDOO9 was the one in which the location of the bypass hole was changed. This, with a notch and stainless steel actually improved the iron saturation (in b4 harmonic) relative to DRBOO5 instead of making it worse. The b2 saturation became +7 unit and b4 -1.3 unit. yoke pole key, + +Finally a small saturation suppressor hole was added to practically eliminate all b2 and b4 saturation in DREOII cross section Before we discuss that, let uS examine the differences between the calculations and measurements as are given in Table 6.1. These calculations are done with the code POISSON and ignore cryostat. Typically, at 5 kA cryostat induced b2 is ~+1.5 unit and b4 is ~-0.1 unit. Moreover, as mentioned earlier; the calculations are done only for the saturation induced harmonics and the harmonics due to coil deformation as a result of the Lorentz force on the coil are ignored. We have also ignored a small gap (of the order of 10 mil) between the and bottom halves of the yokes. Some calculations show that this maj give as much of 2 units of b2 and 0.2 units of b4 at 5 kA they they top + +In Table 6.1, we have also given the maximum change in the measured values of b2 and b4 harmonics till 5 kA. The diference between the calculations and measurements did not bother much when the actual value of the saturation induced harmonic was However, at this stage did matter as the target to make those harmonic becamne so small. The target was to make b2 saturation less then 2 unit and b4 saturation less then ! unit. This is within the difference between the calculations and measurements Therefore, we empirically cancel out these small unexplained differences between the calculations and measurements (in this particular cross section) in arriving to an optimized location of the hole. The approach indeed worked as can be seen in Fig. 2.1 and 2.2 and described in detail in reference 4. In these figures please see curves marked for DRSGR where DRSGR represents the short dipole "DRSOO6 rebuilt with the saturation suppressor holes" large. they Fig. + + +7 References + + 1. P.A. Thompson; et.al., "Iron saturation control in RHIC dipole magnets" Presented at 1991 Particle Accelerator Conference + 2 . Testing and Measurement Group Notes describing the results of magnetic measurements. + 3 . P.A. Thompson, Magnet Division Notes describing design and comparing calculations with measurements. + 4 R. Gupta, "DRSOO6 with Saturation Suppressor Holes" = Magnet Division Note No. 457-16 (RHIC-MD-165), July 28, 1992. + 5. R. Gupta, "Reducing iron saturation in arc dipoles with a saturation suppressor hole" Magnet Division Note No. 447-16 (RHIC-MD-158) June 10, 1992. \ No newline at end of file diff --git a/llm-service/app/ai/indexing/base.py b/llm-service/app/ai/indexing/base.py index daa7b65d..c7e472c9 100644 --- a/llm-service/app/ai/indexing/base.py +++ b/llm-service/app/ai/indexing/base.py @@ -7,6 +7,7 @@ from .readers.csv import CSVReader from .readers.docx import DocxReader from .readers.json import JSONReader +from .readers.markdown import MdReader from .readers.pdf import PDFReader from .readers.pptx import PptxReader from .readers.simple_file import SimpleFileReader @@ -14,7 +15,7 @@ READERS: Dict[str, Type[BaseReader]] = { ".pdf": PDFReader, ".txt": SimpleFileReader, - ".md": SimpleFileReader, + ".md": MdReader, ".docx": DocxReader, ".pptx": PptxReader, ".pptm": PptxReader, diff --git a/llm-service/app/ai/indexing/readers/markdown.py b/llm-service/app/ai/indexing/readers/markdown.py new file mode 100644 index 00000000..644a372b --- /dev/null +++ b/llm-service/app/ai/indexing/readers/markdown.py @@ -0,0 +1,99 @@ +# +# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP) +# (C) Cloudera, Inc. 2024 +# All rights reserved. +# +# Applicable Open Source License: Apache 2.0 +# +# NOTE: Cloudera open source products are modular software products +# made up of hundreds of individual components, each of which was +# individually copyrighted. Each Cloudera open source product is a +# collective work under U.S. Copyright Law. Your license to use the +# collective work is as provided in your written agreement with +# Cloudera. Used apart from the collective work, this file is +# licensed for your use pursuant to the open source license +# identified above. +# +# This code is provided to you pursuant a written agreement with +# (i) Cloudera, Inc. or (ii) a third-party authorized to distribute +# this code. If you do not have a written agreement with Cloudera nor +# with an authorized and properly licensed third party, you do not +# have any rights to access nor to use this code. +# +# Absent a written agreement with Cloudera, Inc. ("Cloudera") to the +# contrary, A) CLOUDERA PROVIDES THIS CODE TO YOU WITHOUT WARRANTIES OF ANY +# KIND; (B) CLOUDERA DISCLAIMS ANY AND ALL EXPRESS AND IMPLIED +# WARRANTIES WITH RESPECT TO THIS CODE, INCLUDING BUT NOT LIMITED TO +# IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE; (C) CLOUDERA IS NOT LIABLE TO YOU, +# AND WILL NOT DEFEND, INDEMNIFY, NOR HOLD YOU HARMLESS FOR ANY CLAIMS +# ARISING FROM OR RELATED TO THE CODE; AND (D)WITH RESPECT TO YOUR EXERCISE +# OF ANY RIGHTS GRANTED TO YOU FOR THE CODE, CLOUDERA IS NOT LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR +# CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, DAMAGES +# RELATED TO LOST REVENUE, LOST PROFITS, LOSS OF INCOME, LOSS OF +# BUSINESS ADVANTAGE OR UNAVAILABILITY, OR LOSS OR CORRUPTION OF +# DATA. +# + +# +# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP) +# (C) Cloudera, Inc. 2024 +# All rights reserved. +# +# Applicable Open Source License: Apache 2.0 +# +# +# This code is provided to you pursuant a written agreement with +# (i) Cloudera, Inc. or (ii) a third-party authorized to distribute +# this code. If you do not have a written agreement with Cloudera nor +# with an authorized and properly licensed third party, you do not +# have any rights to access nor to use this code. +# +# Absent a written agreement with Cloudera, Inc. ("Cloudera") to the +# contrary, A) CLOUDERA PROVIDES THIS CODE TO YOU WITHOUT WARRANTIES OF ANY +# KIND; (B) CLOUDERA DISCLAIMS ANY AND ALL EXPRESS AND IMPLIED +# WARRANTIES WITH RESPECT TO THIS CODE, INCLUDING BUT NOT LIMITED TO +# IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND +# FITNESS FOR A PARTICULAR PURPOSE; (C) CLOUDERA IS NOT LIABLE TO YOU, +# AND WILL NOT DEFEND, INDEMNIFY, NOR HOLD YOU HARMLESS FOR ANY CLAIMS +# ARISING FROM OR RELATED TO THE CODE; AND (D)WITH RESPECT TO YOUR EXERCISE +# OF ANY RIGHTS GRANTED TO YOU FOR THE CODE, CLOUDERA IS NOT LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR +# CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, DAMAGES +# RELATED TO LOST REVENUE, LOST PROFITS, LOSS OF INCOME, LOSS OF +# BUSINESS ADVANTAGE OR UNAVAILABILITY, OR LOSS OR CORRUPTION OF +# DATA. +# + +from pathlib import Path +from typing import Any, List, cast + +from llama_index.core.node_parser import MarkdownNodeParser +from llama_index.core.schema import TextNode, Document, BaseNode +from llama_index.readers.file import MarkdownReader + +from .base_reader import BaseReader + + +class MdReader(BaseReader): + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.inner = MarkdownReader() + + def load_chunks(self, file_path: Path) -> List[TextNode]: + with open(file_path, "r") as f: + content = f.read() + document = Document(text=content) + document.id_ = self.document_id + self._add_document_metadata(document, file_path) + + parser = MarkdownNodeParser() + nodes: list[BaseNode] = parser.get_nodes_from_documents([document]) + results : list[TextNode] = [] + for i, node in enumerate(nodes): + tn = cast(TextNode, node) + self._add_document_metadata(tn, file_path) + tn.metadata["chunk_format"] = "markdown" + results.append(tn) + return results diff --git a/llm-service/app/ai/indexing/readers/pdf.py b/llm-service/app/ai/indexing/readers/pdf.py index a68f7d7f..55504dfa 100644 --- a/llm-service/app/ai/indexing/readers/pdf.py +++ b/llm-service/app/ai/indexing/readers/pdf.py @@ -46,7 +46,7 @@ from llama_index.readers.file import PDFReader as LlamaIndexPDFReader from .base_reader import BaseReader -from .simple_file import SimpleFileReader +from .markdown import MdReader logger = logging.getLogger(__name__) @@ -92,7 +92,7 @@ class PDFReader(BaseReader): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.inner = LlamaIndexPDFReader(return_full_document=False) - self.markdown_reader = SimpleFileReader(*args, **kwargs) + self.markdown_reader = MdReader(*args, **kwargs) def load_chunks(self, file_path: Path) -> list[TextNode]: logger.debug(f"{file_path=}") @@ -114,6 +114,7 @@ def process_with_docling(self, file_path: Path) -> list[TextNode] | None: docling_enabled = ( os.getenv("USE_ENHANCED_PDF_PROCESSING", "false").lower() == "true" ) + logger.info(f"{docling_enabled=}") if not docling_enabled: return None directory = file_path.parent diff --git a/llm-service/app/ai/indexing/summary_indexer.py b/llm-service/app/ai/indexing/summary_indexer.py index b795e180..5a59e486 100644 --- a/llm-service/app/ai/indexing/summary_indexer.py +++ b/llm-service/app/ai/indexing/summary_indexer.py @@ -57,14 +57,12 @@ NodeRelationship, ) -from app.services.models import get_noop_embedding_model - -from ...config import Settings +from app.services.models import get_noop_embedding_model, get_noop_llm_model from .base import get_reader_class +from ...config import Settings logger = logging.getLogger(__name__) - SUMMARY_PROMPT = 'Summarize the contents into less than 100 words. If an adequate summary is not possible, please return "No summary available.".' # Since we don't use anything fancy to store the summaries, it's possible that two threads @@ -76,29 +74,36 @@ class SummaryIndexer: def __init__( - self, - data_source_id: int, - splitter: SentenceSplitter, - llm: LLM, + self, + data_source_id: int, + splitter: SentenceSplitter, + llm: LLM, ): self.data_source_id = data_source_id self.splitter = splitter self.llm = llm + @staticmethod + def __database_dir(data_source_id: int) -> str: + return os.path.join(Settings().rag_databases_dir, f"doc_summary_index_{data_source_id}") + def __persist_dir(self) -> str: - return os.path.join( - Settings().rag_databases_dir, f"doc_summary_index_{self.data_source_id}" - ) + return SummaryIndexer.__database_dir(self.data_source_id) - def __persist_root_dir(self) -> str: + @staticmethod + def __persist_root_dir() -> str: return os.path.join(Settings().rag_databases_dir, "doc_summary_index_global") def __index_kwargs(self) -> Dict[str, Any]: + return SummaryIndexer.__index_configuration(self.llm) + + @staticmethod + def __index_configuration(llm: LLM) -> Dict[str, Any]: return { - "llm": self.llm, + "llm": llm, "response_synthesizer": get_response_synthesizer( response_mode=ResponseMode.TREE_SUMMARIZE, - llm=self.llm, + llm=llm, use_async=True, verbose=True, ), @@ -118,21 +123,28 @@ def __init_summary_store(self, persist_dir: str) -> DocumentSummaryIndex: def __summary_indexer(self, persist_dir: str) -> DocumentSummaryIndex: try: - storage_context = StorageContext.from_defaults( + return SummaryIndexer.__summary_indexer_with_config( persist_dir=persist_dir, + index_configuration=self.__index_kwargs(), ) - doc_summary_index: DocumentSummaryIndex = cast( - DocumentSummaryIndex, - load_index_from_storage( - storage_context=storage_context, - **self.__index_kwargs(), - ), - ) - return doc_summary_index except FileNotFoundError: doc_summary_index = self.__init_summary_store(persist_dir) return doc_summary_index + @staticmethod + def __summary_indexer_with_config(persist_dir: str, index_configuration: Dict[str, Any]) -> DocumentSummaryIndex: + storage_context = StorageContext.from_defaults( + persist_dir=persist_dir, + ) + doc_summary_index: DocumentSummaryIndex = cast( + DocumentSummaryIndex, + load_index_from_storage( + storage_context=storage_context, + **index_configuration, + ), + ) + return doc_summary_index + def index_file(self, file_path: Path, document_id: str) -> None: logger.debug(f"Creating summary for file {file_path}") @@ -159,10 +171,10 @@ def index_file(self, file_path: Path, document_id: str) -> None: logger.debug(f"Summary for file {file_path} created") def __update_global_summary_store( - self, - summary_store: DocumentSummaryIndex, - added_node_id: Optional[str] = None, - deleted_node_id: Optional[str] = None, + self, + summary_store: DocumentSummaryIndex, + added_node_id: Optional[str] = None, + deleted_node_id: Optional[str] = None, ) -> None: # Llama index doesn't seem to support updating the summary when we add more documents. # So what we do instead is re-load all the summaries for the documents already associated with the data source @@ -214,7 +226,7 @@ def __update_global_summary_store( # Delete first so that we don't accumulate trash in the summary store. try: - global_summary_store.delete_ref_doc(str(self.data_source_id)) + global_summary_store.delete_ref_doc(str(self.data_source_id), delete_from_docstore=True) except KeyError: pass global_summary_store.insert_nodes(new_nodes) @@ -234,8 +246,7 @@ def get_full_summary(self) -> Optional[str]: global_summary_store = self.__summary_indexer(global_persist_dir) document_id = str(self.data_source_id) if ( - document_id - not in global_summary_store.index_struct.doc_id_to_summary_id + document_id not in global_summary_store.index_struct.doc_id_to_summary_id ): return None return global_summary_store.get_document_summary(document_id) @@ -249,19 +260,28 @@ def delete_document(self, document_id: str) -> None: summary_store, deleted_node_id=document_id ) - summary_store.delete_ref_doc(document_id) + summary_store.delete_ref_doc(document_id, delete_from_docstore=True) summary_store.storage_context.persist(persist_dir=persist_dir) def delete_data_source(self) -> None: with _write_lock: - # We need to re-load the summary index constantly because of this delete. - # TODO: figure out a less explosive way to do this. - shutil.rmtree(self.__persist_dir(), ignore_errors=True) + SummaryIndexer.delete_data_source_by_id(self.data_source_id) - global_persist_dir = self.__persist_root_dir() - global_summary_store = self.__summary_indexer(global_persist_dir) + @staticmethod + def delete_data_source_by_id(data_source_id: int) -> None: + with _write_lock: + # TODO: figure out a less explosive way to do this. + shutil.rmtree(SummaryIndexer.__database_dir(data_source_id), ignore_errors=True) + global_persist_dir = SummaryIndexer.__persist_root_dir() + try: + global_summary_store = SummaryIndexer.__summary_indexer_with_config(global_persist_dir, + SummaryIndexer.__index_configuration( + get_noop_llm_model())) + except FileNotFoundError: + ## global summary store doesn't exist, nothing to do + return try: - global_summary_store.delete_ref_doc(str(self.data_source_id)) + global_summary_store.delete_ref_doc(str(data_source_id), delete_from_docstore=True) + global_summary_store.storage_context.persist(persist_dir=global_persist_dir) except KeyError: pass - global_summary_store.storage_context.persist(persist_dir=global_persist_dir) diff --git a/llm-service/app/ai/vector_stores/qdrant.py b/llm-service/app/ai/vector_stores/qdrant.py index 150f9747..bee7da4e 100644 --- a/llm-service/app/ai/vector_stores/qdrant.py +++ b/llm-service/app/ai/vector_stores/qdrant.py @@ -90,12 +90,11 @@ def __init__( ): self.client = client or new_qdrant_client() self.table_name = table_name - self.data_source_metadata = data_sources_metadata_api.get_metadata( - data_source_id - ) + self.data_source_id = data_source_id def get_embedding_model(self) -> BaseEmbedding: - return models.get_embedding_model(self.data_source_metadata.embedding_model) + data_source_metadata = data_sources_metadata_api.get_metadata(self.data_source_id) + return models.get_embedding_model(data_source_metadata.embedding_model) def size(self) -> Optional[int]: """If the collection does not exist, return None.""" diff --git a/llm-service/app/routers/index/data_source/__init__.py b/llm-service/app/routers/index/data_source/__init__.py index 029eb70e..ba6623f7 100644 --- a/llm-service/app/routers/index/data_source/__init__.py +++ b/llm-service/app/routers/index/data_source/__init__.py @@ -102,9 +102,7 @@ def _get_summary_indexer(data_source_id: int) -> Optional[SummaryIndexer]: @exceptions.propagates def delete(self, data_source_id: int) -> None: self.chunks_vector_store.delete() - indexer = self._get_summary_indexer(data_source_id) - if indexer: - indexer.delete_data_source() + SummaryIndexer.delete_data_source_by_id(data_source_id) @router.get( "/chunks/{chunk_id}", @@ -125,9 +123,9 @@ def chunk_contents(self, chunk_id: str) -> ChunkContentsResponse: @exceptions.propagates def delete_document(self, data_source_id: int, doc_id: str) -> None: self.chunks_vector_store.delete_document(doc_id) - indexer = self._get_summary_indexer(data_source_id) - if indexer: - indexer.delete_document(doc_id) + summary_indexer = self._get_summary_indexer(data_source_id) + if summary_indexer: + summary_indexer.delete_document(doc_id) @router.post( "/documents/{doc_id}/index", diff --git a/llm-service/app/routers/index/sessions/__init__.py b/llm-service/app/routers/index/sessions/__init__.py index cc43e723..8b6923e3 100644 --- a/llm-service/app/routers/index/sessions/__init__.py +++ b/llm-service/app/routers/index/sessions/__init__.py @@ -85,8 +85,8 @@ class RagStudioChatRequest(BaseModel): @router.post("/chat", summary="Chat with your documents in the requested datasource") @exceptions.propagates def chat( - session_id: int, - request: RagStudioChatRequest, + session_id: int, + request: RagStudioChatRequest, ) -> RagStudioChatMessage: if request.configuration.exclude_knowledge_base: return llm_talk(session_id, request) @@ -96,8 +96,8 @@ def chat( def llm_talk( - session_id: int, - request: RagStudioChatRequest, + session_id: int, + request: RagStudioChatRequest, ) -> RagStudioChatMessage: chat_response = llm_completion.completion( session_id, request.query, request.configuration @@ -105,6 +105,7 @@ def llm_talk( new_chat_message = RagStudioChatMessage( id=str(uuid.uuid4()), source_nodes=[], + inference_model=request.configuration.model_name, evaluations=[], rag_message={ "user": request.query, @@ -128,18 +129,28 @@ class RagSuggestedQuestionsResponse(BaseModel): @router.post("/suggest-questions", summary="Suggest questions with context") @exceptions.propagates def suggest_questions( - session_id: int, - request: SuggestQuestionsRequest, + session_id: int, + request: SuggestQuestionsRequest, ) -> RagSuggestedQuestionsResponse: if len(request.data_source_ids) != 1: - raise HTTPException(status_code=400, detail="Only one datasource is supported for question suggestion.") + raise HTTPException( + status_code=400, + detail="Only one datasource is supported for question suggestion.", + ) total_data_sources_size: int = sum( - map(lambda ds_id: QdrantVectorStore.for_chunks(ds_id).size() or 0, request.data_source_ids)) + map( + lambda ds_id: QdrantVectorStore.for_chunks(ds_id).size() or 0, + request.data_source_ids, + ) + ) if total_data_sources_size == 0: raise HTTPException(status_code=404, detail="Knowledge base not found.") suggested_questions = generate_suggested_questions( - request.configuration, request.data_source_ids, total_data_sources_size, session_id + request.configuration, + request.data_source_ids, + total_data_sources_size, + session_id, ) return RagSuggestedQuestionsResponse(suggested_questions=suggested_questions) diff --git a/llm-service/app/services/chat.py b/llm-service/app/services/chat.py index 85ee6fcd..0db07d38 100644 --- a/llm-service/app/services/chat.py +++ b/llm-service/app/services/chat.py @@ -66,13 +66,16 @@ def v2_chat( response_id = str(uuid.uuid4()) if len(data_source_ids) != 1: - raise HTTPException(status_code=400, detail="Only one datasource is supported for chat.") + raise HTTPException( + status_code=400, detail="Only one datasource is supported for chat." + ) data_source_id: int = data_source_ids[0] if QdrantVectorStore.for_chunks(data_source_id).size() == 0: return RagStudioChatMessage( id=response_id, source_nodes=[], + inference_model=None, rag_message={ "user": query, "assistant": "I don't have any documents to answer your question.", @@ -94,6 +97,7 @@ def v2_chat( new_chat_message = RagStudioChatMessage( id=response_id, source_nodes=response_source_nodes, + inference_model=configuration.model_name, rag_message={ "user": query, "assistant": response.response, diff --git a/llm-service/app/services/chat_store.py b/llm-service/app/services/chat_store.py index 7462650d..48dbddc6 100644 --- a/llm-service/app/services/chat_store.py +++ b/llm-service/app/services/chat_store.py @@ -37,7 +37,7 @@ # ############################################################################## import os -from typing import List, Literal +from typing import List, Literal, Optional from llama_index.core.base.llms.types import ChatMessage, MessageRole from llama_index.core.storage.chat_store import SimpleChatStore @@ -66,6 +66,7 @@ class RagContext(BaseModel): class RagStudioChatMessage(BaseModel): id: str source_nodes: list[RagPredictSourceNode] + inference_model: Optional[str] # `None` for legacy data or no chunks rag_message: dict[Literal["user", "assistant"], str] evaluations: list[Evaluation] timestamp: float @@ -101,6 +102,9 @@ def retrieve_chat_history(self, session_id: int) -> List[RagStudioChatMessage]: source_nodes=assistant_message.additional_kwargs.get( "source_nodes", [] ), + inference_model=assistant_message.additional_kwargs.get( + "inference_model", None + ), rag_message={ MessageRole.USER.value: str(user_message.content), MessageRole.ASSISTANT.value: str(assistant_message.content), @@ -158,6 +162,7 @@ def append_to_history( additional_kwargs={ "id": message.id, "source_nodes": message.source_nodes, + "inference_model": message.inference_model, "evaluations": message.evaluations, "timestamp": message.timestamp, }, diff --git a/ui/package.json b/ui/package.json index 7c9cf7e7..25b05b48 100644 --- a/ui/package.json +++ b/ui/package.json @@ -26,7 +26,9 @@ "lodash": "^4.17.21", "react": "^18.3.1", "react-chartjs-2": "^5.2.0", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "react-markdown": "^9.0.1", + "remark-gfm": "^4.0.0" }, "devDependencies": { "@eslint/js": "^9.14.0", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index c97d0e01..91927f6f 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -44,6 +44,12 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + react-markdown: + specifier: ^9.0.1 + version: 9.0.1(@types/react@18.3.12)(react@18.3.1) + remark-gfm: + specifier: ^4.0.0 + version: 4.0.0 devDependencies: '@eslint/js': specifier: ^9.14.0 @@ -1035,21 +1041,36 @@ packages: '@types/babel__traverse@7.20.6': resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/debug@4.1.12': + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/eslint@9.6.1': resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} '@types/eslint__js@8.42.3': resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + '@types/estree-jsx@1.0.5': + resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} + '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/lodash@4.17.13': resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/ms@0.7.34': + resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + '@types/node@22.9.0': resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} @@ -1062,6 +1083,12 @@ packages: '@types/react@18.3.12': resolution: {integrity: sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==} + '@types/unist@2.0.11': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + + '@types/unist@3.0.3': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@typescript-eslint/eslint-plugin@8.14.0': resolution: {integrity: sha512-tqp8H7UWFaZj0yNO6bycd5YjMwxa6wIHOLZvWPkidwbgLCsBMetQoGj7DPuAlWa2yGO3H48xmPwjhsSPPCGU5w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1119,6 +1146,9 @@ packages: resolution: {integrity: sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/structured-clone@1.2.1': + resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} + '@vitejs/plugin-react@4.3.3': resolution: {integrity: sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -1266,6 +1296,9 @@ packages: babel-dead-code-elimination@1.0.6: resolution: {integrity: sha512-JxFi9qyRJpN0LjEbbjbN8g0ux71Qppn9R8Qe3k6QzHg2CaKsbUQtbn307LQGiDLGjV6JCtEFqfxzVig9MyDCHQ==} + bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1307,6 +1340,9 @@ packages: caniuse-lite@1.0.30001680: resolution: {integrity: sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==} + ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} @@ -1323,6 +1359,18 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + + character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + + character-reference-invalid@2.0.1: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + chart.js@4.4.6: resolution: {integrity: sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==} engines: {pnpm: '>=8'} @@ -1369,6 +1417,9 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} @@ -1442,6 +1493,9 @@ packages: decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + decode-named-character-reference@1.0.2: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -1465,6 +1519,9 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} @@ -1553,6 +1610,10 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + eslint-config-prettier@9.1.0: resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true @@ -1637,6 +1698,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-util-is-identifier-name@3.0.0: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -1658,6 +1722,9 @@ packages: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1818,6 +1885,12 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hast-util-to-jsx-runtime@2.3.2: + resolution: {integrity: sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg==} + + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + html-encoding-sniffer@4.0.0: resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} engines: {node: '>=18'} @@ -1825,6 +1898,9 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + html-url-attributes@3.0.1: + resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==} + http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} @@ -1862,10 +1938,19 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + inline-style-parser@0.2.4: + resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} + internal-slot@1.0.7: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} + is-alphabetical@2.0.1: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + + is-alphanumerical@2.0.1: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + is-array-buffer@3.0.4: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -1904,6 +1989,9 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + is-decimal@2.0.1: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1931,6 +2019,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-hexadecimal@2.0.1: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -1947,6 +2038,10 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} @@ -2100,6 +2195,9 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} + longest-streak@3.1.0: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -2130,6 +2228,54 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} + markdown-table@3.0.4: + resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} + + mdast-util-find-and-replace@3.0.1: + resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==} + + mdast-util-from-markdown@2.0.2: + resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + + mdast-util-gfm-autolink-literal@2.0.1: + resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} + + mdast-util-gfm-footnote@2.0.0: + resolution: {integrity: sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==} + + mdast-util-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} + + mdast-util-gfm-table@2.0.0: + resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} + + mdast-util-gfm-task-list-item@2.0.0: + resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} + + mdast-util-gfm@3.0.0: + resolution: {integrity: sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==} + + mdast-util-mdx-expression@2.0.1: + resolution: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==} + + mdast-util-mdx-jsx@3.1.3: + resolution: {integrity: sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==} + + mdast-util-mdxjs-esm@2.0.1: + resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + + mdast-util-phrasing@4.1.0: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + + mdast-util-to-markdown@2.1.2: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + + mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -2137,6 +2283,90 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + micromark-core-commonmark@2.0.2: + resolution: {integrity: sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==} + + micromark-extension-gfm-autolink-literal@2.1.0: + resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} + + micromark-extension-gfm-footnote@2.1.0: + resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} + + micromark-extension-gfm-strikethrough@2.1.0: + resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} + + micromark-extension-gfm-table@2.1.0: + resolution: {integrity: sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g==} + + micromark-extension-gfm-tagfilter@2.0.0: + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} + + micromark-extension-gfm-task-list-item@2.1.0: + resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} + + micromark-extension-gfm@3.0.0: + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + + micromark-factory-destination@2.0.1: + resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + + micromark-factory-label@2.0.1: + resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + + micromark-factory-space@2.0.1: + resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + + micromark-factory-title@2.0.1: + resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + + micromark-factory-whitespace@2.0.1: + resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + + micromark-util-character@2.1.1: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} + + micromark-util-chunked@2.0.1: + resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + + micromark-util-classify-character@2.0.1: + resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + + micromark-util-combine-extensions@2.0.1: + resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + + micromark-util-decode-numeric-character-reference@2.0.2: + resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + + micromark-util-decode-string@2.0.1: + resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + + micromark-util-encode@2.0.1: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} + + micromark-util-html-tag-name@2.0.1: + resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + + micromark-util-normalize-identifier@2.0.1: + resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + + micromark-util-resolve-all@2.0.1: + resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + + micromark-util-sanitize-uri@2.0.1: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} + + micromark-util-subtokenize@2.0.3: + resolution: {integrity: sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg==} + + micromark-util-symbol@2.0.1: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + + micromark-util-types@2.0.1: + resolution: {integrity: sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==} + + micromark@4.0.1: + resolution: {integrity: sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -2255,6 +2485,9 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + parse-entities@4.0.2: + resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2346,6 +2579,9 @@ packages: prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -2601,6 +2837,12 @@ packages: react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + react-markdown@9.0.1: + resolution: {integrity: sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg==} + peerDependencies: + '@types/react': '>=18' + react: '>=18' + react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} @@ -2628,6 +2870,18 @@ packages: resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} engines: {node: '>= 0.4'} + remark-gfm@4.0.0: + resolution: {integrity: sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==} + + remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + + remark-rehype@11.1.1: + resolution: {integrity: sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==} + + remark-stringify@11.0.0: + resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + resize-observer-polyfill@1.5.1: resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} @@ -2736,6 +2990,9 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -2779,6 +3036,9 @@ packages: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -2799,6 +3059,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + style-to-object@1.0.8: + resolution: {integrity: sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==} + stylis@4.3.4: resolution: {integrity: sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==} @@ -2877,6 +3140,12 @@ packages: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + + trough@2.2.0: + resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + ts-api-utils@1.4.0: resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==} engines: {node: '>=16'} @@ -2941,6 +3210,24 @@ packages: undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + unified@11.0.5: + resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} + + unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + + unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + unplugin@1.15.0: resolution: {integrity: sha512-jTPIs63W+DUEDW207ztbaoO7cQ4p5aVaB823LSlxpsFEU3Mykwxf3ZGC/wzxFJeZlASZYgVrWeo7LgOrqJZ8RA==} engines: {node: '>=14.0.0'} @@ -2964,6 +3251,12 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 + vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-node@2.1.4: resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -3136,6 +3429,9 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + snapshots: '@adobe/css-tools@4.4.0': {} @@ -3920,6 +4216,10 @@ snapshots: dependencies: '@babel/types': 7.26.0 + '@types/debug@4.1.12': + dependencies: + '@types/ms': 0.7.34 + '@types/eslint@9.6.1': dependencies: '@types/estree': 1.0.6 @@ -3929,12 +4229,26 @@ snapshots: dependencies: '@types/eslint': 9.6.1 + '@types/estree-jsx@1.0.5': + dependencies: + '@types/estree': 1.0.6 + '@types/estree@1.0.6': {} + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.3 + '@types/json-schema@7.0.15': {} '@types/lodash@4.17.13': {} + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.3 + + '@types/ms@0.7.34': {} + '@types/node@22.9.0': dependencies: undici-types: 6.19.8 @@ -3950,6 +4264,10 @@ snapshots: '@types/prop-types': 15.7.13 csstype: 3.1.3 + '@types/unist@2.0.11': {} + + '@types/unist@3.0.3': {} + '@typescript-eslint/eslint-plugin@8.14.0(@typescript-eslint/parser@8.14.0(eslint@9.14.0)(typescript@5.6.3))(eslint@9.14.0)(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -4031,6 +4349,8 @@ snapshots: '@typescript-eslint/types': 8.14.0 eslint-visitor-keys: 3.4.3 + '@ungap/structured-clone@1.2.1': {} + '@vitejs/plugin-react@4.3.3(vite@5.4.11(@types/node@22.9.0))': dependencies: '@babel/core': 7.26.0 @@ -4279,6 +4599,8 @@ snapshots: transitivePeerDependencies: - supports-color + bail@2.0.2: {} + balanced-match@1.0.2: {} binary-extensions@2.3.0: {} @@ -4319,6 +4641,8 @@ snapshots: caniuse-lite@1.0.30001680: {} + ccount@2.0.1: {} + chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -4339,6 +4663,14 @@ snapshots: chalk@5.3.0: {} + character-entities-html4@2.1.0: {} + + character-entities-legacy@3.0.0: {} + + character-entities@2.0.2: {} + + character-reference-invalid@2.0.1: {} + chart.js@4.4.6: dependencies: '@kurkle/color': 0.3.4 @@ -4386,6 +4718,8 @@ snapshots: dependencies: delayed-stream: 1.0.0 + comma-separated-tokens@2.0.3: {} + commander@12.1.0: {} compute-scroll-into-view@3.1.0: {} @@ -4454,6 +4788,10 @@ snapshots: decimal.js@10.4.3: {} + decode-named-character-reference@1.0.2: + dependencies: + character-entities: 2.0.2 + deep-eql@5.0.2: {} deep-is@0.1.4: {} @@ -4474,6 +4812,10 @@ snapshots: dequal@2.0.3: {} + devlop@1.1.0: + dependencies: + dequal: 2.0.3 + doctrine@2.1.0: dependencies: esutils: 2.0.3 @@ -4655,6 +4997,8 @@ snapshots: escape-string-regexp@4.0.0: {} + escape-string-regexp@5.0.0: {} + eslint-config-prettier@9.1.0(eslint@9.14.0): dependencies: eslint: 9.14.0 @@ -4770,6 +5114,8 @@ snapshots: estraverse@5.3.0: {} + estree-util-is-identifier-name@3.0.0: {} + estree-walker@2.0.2: {} estree-walker@3.0.3: @@ -4794,6 +5140,8 @@ snapshots: expect-type@1.1.0: {} + extend@3.0.2: {} + fast-deep-equal@3.1.3: {} fast-diff@1.3.0: {} @@ -4950,12 +5298,38 @@ snapshots: dependencies: function-bind: 1.1.2 + hast-util-to-jsx-runtime@2.3.2: + dependencies: + '@types/estree': 1.0.6 + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + hast-util-whitespace: 3.0.0 + mdast-util-mdx-expression: 2.0.1 + mdast-util-mdx-jsx: 3.1.3 + mdast-util-mdxjs-esm: 2.0.1 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + style-to-object: 1.0.8 + unist-util-position: 5.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.4 + html-encoding-sniffer@4.0.0: dependencies: whatwg-encoding: 3.1.1 html-escaper@2.0.2: {} + html-url-attributes@3.0.1: {} + http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 @@ -4989,12 +5363,21 @@ snapshots: indent-string@4.0.0: {} + inline-style-parser@0.2.4: {} + internal-slot@1.0.7: dependencies: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.0.6 + is-alphabetical@2.0.1: {} + + is-alphanumerical@2.0.1: + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 + is-array-buffer@3.0.4: dependencies: call-bind: 1.0.7 @@ -5033,6 +5416,8 @@ snapshots: dependencies: has-tostringtag: 1.0.2 + is-decimal@2.0.1: {} + is-extglob@2.1.1: {} is-finalizationregistry@1.0.2: @@ -5055,6 +5440,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-hexadecimal@2.0.1: {} + is-map@2.0.3: {} is-negative-zero@2.0.3: {} @@ -5065,6 +5452,8 @@ snapshots: is-number@7.0.0: {} + is-plain-obj@4.1.0: {} + is-potential-custom-element-name@1.0.1: {} is-regex@1.1.4: @@ -5252,6 +5641,8 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 9.0.0 + longest-streak@3.1.0: {} + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -5284,10 +5675,356 @@ snapshots: dependencies: semver: 7.6.3 + markdown-table@3.0.4: {} + + mdast-util-find-and-replace@3.0.1: + dependencies: + '@types/mdast': 4.0.4 + escape-string-regexp: 5.0.0 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + + mdast-util-from-markdown@2.0.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-decode-string: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-autolink-literal@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-find-and-replace: 3.0.1 + micromark-util-character: 2.1.1 + + mdast-util-gfm-footnote@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + micromark-util-normalize-identifier: 2.0.1 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-strikethrough@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-table@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + markdown-table: 3.0.4 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm-task-list-item@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-gfm@3.0.0: + dependencies: + mdast-util-from-markdown: 2.0.2 + mdast-util-gfm-autolink-literal: 2.0.1 + mdast-util-gfm-footnote: 2.0.0 + mdast-util-gfm-strikethrough: 2.0.0 + mdast-util-gfm-table: 2.0.0 + mdast-util-gfm-task-list-item: 2.0.0 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx-expression@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx-jsx@3.1.3: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + parse-entities: 4.0.2 + stringify-entities: 4.0.4 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + mdast-util-mdxjs-esm@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + transitivePeerDependencies: + - supports-color + + mdast-util-phrasing@4.1.0: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.0 + + mdast-util-to-hast@13.2.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.2.1 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.1 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + + mdast-util-to-markdown@2.1.2: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + + mdast-util-to-string@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + merge-stream@2.0.0: {} merge2@1.4.1: {} + micromark-core-commonmark@2.0.2: + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.1 + micromark-factory-label: 2.0.1 + micromark-factory-space: 2.0.1 + micromark-factory-title: 2.0.1 + micromark-factory-whitespace: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-html-tag-name: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-subtokenize: 2.0.3 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm-autolink-literal@2.1.0: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm-footnote@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-core-commonmark: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm-strikethrough@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm-table@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm-tagfilter@2.0.0: + dependencies: + micromark-util-types: 2.0.1 + + micromark-extension-gfm-task-list-item@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-extension-gfm@3.0.0: + dependencies: + micromark-extension-gfm-autolink-literal: 2.1.0 + micromark-extension-gfm-footnote: 2.1.0 + micromark-extension-gfm-strikethrough: 2.1.0 + micromark-extension-gfm-table: 2.1.0 + micromark-extension-gfm-tagfilter: 2.0.0 + micromark-extension-gfm-task-list-item: 2.1.0 + micromark-util-combine-extensions: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-factory-destination@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-factory-label@2.0.1: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-factory-space@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-types: 2.0.1 + + micromark-factory-title@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-factory-whitespace@2.0.1: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-util-character@2.1.1: + dependencies: + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-util-chunked@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-classify-character@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-util-combine-extensions@2.0.1: + dependencies: + micromark-util-chunked: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-util-decode-numeric-character-reference@2.0.2: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-decode-string@2.0.1: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.1.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-symbol: 2.0.1 + + micromark-util-encode@2.0.1: {} + + micromark-util-html-tag-name@2.0.1: {} + + micromark-util-normalize-identifier@2.0.1: + dependencies: + micromark-util-symbol: 2.0.1 + + micromark-util-resolve-all@2.0.1: + dependencies: + micromark-util-types: 2.0.1 + + micromark-util-sanitize-uri@2.0.1: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 + + micromark-util-subtokenize@2.0.3: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + micromark-util-symbol@2.0.1: {} + + micromark-util-types@2.0.1: {} + + micromark@4.0.1: + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.7 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-combine-extensions: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-encode: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-subtokenize: 2.0.3 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + transitivePeerDependencies: + - supports-color + micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -5399,6 +6136,16 @@ snapshots: dependencies: callsites: 3.1.0 + parse-entities@4.0.2: + dependencies: + '@types/unist': 2.0.11 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.0.2 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.26.2 @@ -5473,6 +6220,8 @@ snapshots: object-assign: 4.1.1 react-is: 16.13.1 + property-information@6.5.0: {} + punycode@2.3.1: {} queue-microtask@1.2.3: {} @@ -5813,6 +6562,23 @@ snapshots: react-is@18.3.1: {} + react-markdown@9.0.1(@types/react@18.3.12)(react@18.3.1): + dependencies: + '@types/hast': 3.0.4 + '@types/react': 18.3.12 + devlop: 1.1.0 + hast-util-to-jsx-runtime: 2.3.2 + html-url-attributes: 3.0.1 + mdast-util-to-hast: 13.2.0 + react: 18.3.1 + remark-parse: 11.0.0 + remark-rehype: 11.1.1 + unified: 11.0.5 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + transitivePeerDependencies: + - supports-color + react-refresh@0.14.2: {} react@18.3.1: @@ -5847,6 +6613,40 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 + remark-gfm@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-gfm: 3.0.0 + micromark-extension-gfm: 3.0.0 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-parse@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.2 + micromark-util-types: 2.0.1 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-rehype@11.1.1: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + mdast-util-to-hast: 13.2.0 + unified: 11.0.5 + vfile: 6.0.3 + + remark-stringify@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-to-markdown: 2.1.2 + unified: 11.0.5 + resize-observer-polyfill@1.5.1: {} resolve-from@4.0.0: {} @@ -5979,6 +6779,8 @@ snapshots: source-map-js@1.2.1: {} + space-separated-tokens@2.0.2: {} + stackback@0.0.2: {} std-env@3.8.0: {} @@ -6044,6 +6846,11 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.0.0 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -6060,6 +6867,10 @@ snapshots: strip-json-comments@3.1.1: {} + style-to-object@1.0.8: + dependencies: + inline-style-parser: 0.2.4 + stylis@4.3.4: {} supports-color@7.2.0: @@ -6121,6 +6932,10 @@ snapshots: dependencies: punycode: 2.3.1 + trim-lines@3.0.1: {} + + trough@2.2.0: {} + ts-api-utils@1.4.0(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -6196,6 +7011,39 @@ snapshots: undici-types@6.19.8: {} + unified@11.0.5: + dependencies: + '@types/unist': 3.0.3 + bail: 2.0.2 + devlop: 1.1.0 + extend: 3.0.2 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 6.0.3 + + unist-util-is@6.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-stringify-position@4.0.0: + dependencies: + '@types/unist': 3.0.3 + + unist-util-visit-parents@6.0.1: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + + unist-util-visit@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + unplugin@1.15.0: dependencies: acorn: 8.14.0 @@ -6215,6 +7063,16 @@ snapshots: dependencies: react: 18.3.1 + vfile-message@4.0.2: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.2 + vite-node@2.1.4(@types/node@22.9.0): dependencies: cac: 6.7.14 @@ -6398,3 +7256,5 @@ snapshots: yocto-queue@0.1.0: {} zod@3.23.8: {} + + zwitch@2.0.4: {} diff --git a/ui/src/api/chatApi.ts b/ui/src/api/chatApi.ts index 5567e509..85a770e2 100644 --- a/ui/src/api/chatApi.ts +++ b/ui/src/api/chatApi.ts @@ -85,6 +85,7 @@ interface ChatHistoryRequestType { export interface ChatMessageType { id: string; source_nodes: SourceNode[]; + inference_model?: string; rag_message: RagMessageV2; evaluations: Evaluation[]; timestamp: number; diff --git a/ui/src/api/ragQueryApi.ts b/ui/src/api/ragQueryApi.ts index c03c9b27..35c5f84e 100644 --- a/ui/src/api/ragQueryApi.ts +++ b/ui/src/api/ragQueryApi.ts @@ -90,6 +90,7 @@ const suggestQuestionsQuery = async ( export interface ChunkMetadata { row_number?: number; page_number?: string; + chunk_format?: string; } export interface ChunkContentsResponse { diff --git a/ui/src/components/images/Images.ts b/ui/src/components/images/Images.ts index cc7ac7ea..3c009ef4 100644 --- a/ui/src/components/images/Images.ts +++ b/ui/src/components/images/Images.ts @@ -52,6 +52,7 @@ import User from "./ic-user.svg?react"; import PlusCircle from "./ic-plus-circle.svg?react"; import RagStudioProduct from "./rag-studio-product-icon.svg"; import image404 from "./404image.png"; +import Models from "./ic-models.svg?react"; const Images = { AiAssistant: AiAssistant, @@ -64,6 +65,7 @@ const Images = { DB: DB, Ghost: Ghost, History: History, + Models: Models, KnowledgeBase: KnowledgeBase, Upload: Upload, PlusCircle: PlusCircle, diff --git a/ui/src/components/images/ic-models.svg b/ui/src/components/images/ic-models.svg new file mode 100644 index 00000000..3bfbad55 --- /dev/null +++ b/ui/src/components/images/ic-models.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatBodyController.test.tsx b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatBodyController.test.tsx index c67d1c75..c7e0e385 100644 --- a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatBodyController.test.tsx +++ b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatBodyController.test.tsx @@ -82,6 +82,13 @@ describe("ChatBodyController", () => { })), })); + vi.mock("src/api/modelsApi.ts", () => ({ + useGetLlmModels: vi.fn(() => ({ + data: [], + isLoading: false, + })), + })); + vi.mock("src/api/summaryApi.ts", () => ({ useGetDataSourceSummary: vi.fn(() => ({ data: "Mocked summary data", diff --git a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessage.tsx b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessage.tsx index 7893737b..a565e064 100644 --- a/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessage.tsx +++ b/ui/src/pages/RagChatTab/ChatOutput/ChatMessages/ChatMessage.tsx @@ -40,7 +40,7 @@ import { Divider, Flex, Typography } from "antd"; import SourceNodes from "pages/RagChatTab/ChatOutput/Sources/SourceNodes.tsx"; import PendingRagOutputSkeleton from "pages/RagChatTab/ChatOutput/Loaders/PendingRagOutputSkeleton.tsx"; import { ChatMessageType, isPlaceholder } from "src/api/chatApi.ts"; -import { cdlBlue500 } from "src/cuix/variables.ts"; +import { cdlBlue500, cdlGray200 } from "src/cuix/variables.ts"; import UserQuestion from "pages/RagChatTab/ChatOutput/ChatMessages/UserQuestion.tsx"; import { Evaluations } from "pages/RagChatTab/ChatOutput/ChatMessages/Evaluations.tsx"; import Images from "src/components/images/Images.ts"; @@ -68,21 +68,36 @@ const ChatMessage = ({ gap={8} >
- + {data.source_nodes.length > 0 ? ( + + ) : ( + + )}
- + - - {data.rag_message.assistant} + + {data.rag_message.assistant.trimStart()} diff --git a/ui/src/pages/RagChatTab/ChatOutput/Sources/MetaData.tsx b/ui/src/pages/RagChatTab/ChatOutput/Sources/MetaData.tsx index b9039986..34ef5afa 100644 --- a/ui/src/pages/RagChatTab/ChatOutput/Sources/MetaData.tsx +++ b/ui/src/pages/RagChatTab/ChatOutput/Sources/MetaData.tsx @@ -37,6 +37,7 @@ ******************************************************************************/ import { Typography } from "antd"; import { ChunkContentsResponse } from "src/api/ragQueryApi.ts"; +import { SourceCardTitle } from "pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx"; const MetaData = ({ metadata, @@ -63,9 +64,7 @@ const MetaData = ({ return ( <> - - Metadata - + {hasMetadata ? ( <> diff --git a/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx b/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx index 3193949c..24485ecc 100644 --- a/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx +++ b/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx @@ -40,6 +40,7 @@ import Icon from "@ant-design/icons"; import { Alert, Card, + Divider, Flex, Popover, Spin, @@ -55,6 +56,33 @@ import { useGetDocumentSummary } from "src/api/summaryApi.ts"; import DocumentationIcon from "src/cuix/icons/DocumentationIcon"; import { cdlGray600 } from "src/cuix/variables.ts"; import MetaData from "pages/RagChatTab/ChatOutput/Sources/MetaData.tsx"; +import Markdown from "react-markdown"; +import Remark from "remark-gfm"; +import "./sourceCard.css"; + +export const SourceCardTitle = ({ titleText }: { titleText: string }) => { + return ( + + {titleText} + + + ); +}; + +const CardTitle = ({ source }: { source: SourceNode }) => { + return ( + + + + {source.source_file_name} + + + + Score: {source.score} + + + ); +}; export const SourceCard = ({ source }: { source: SourceNode }) => { const { activeSession } = useContext(RagChatContext); @@ -83,26 +111,13 @@ export const SourceCard = ({ source }: { source: SourceNode }) => { onOpenChange={handleGetChunkContents} content={ - - - {source.source_file_name} - - - - Score: {source.score} - - - } + title={} bordered={false} style={{ width: 600, height: 300, overflowY: "auto" }} > - - Generated document summary - + {documentSummary.data ?? "No summary available"} @@ -126,14 +141,23 @@ export const SourceCard = ({ source }: { source: SourceNode }) => { ) : ( chunkContents.data && ( - - Extracted reference content - - - {chunkContents.data.text} - + + {chunkContents.data.metadata.chunk_format === "markdown" ? ( +
+ + {chunkContents.data.text} + +
+ ) : ( + + chunkContents.data.text + + )}
) diff --git a/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceNodes.tsx b/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceNodes.tsx index 1a06f571..9320c43c 100644 --- a/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceNodes.tsx +++ b/ui/src/pages/RagChatTab/ChatOutput/Sources/SourceNodes.tsx @@ -36,14 +36,46 @@ * DATA. ******************************************************************************/ -import { Flex } from "antd"; +import { Flex, Typography } from "antd"; import { SourceCard } from "pages/RagChatTab/ChatOutput/Sources/SourceCard.tsx"; -import {ChatMessageType} from "src/api/chatApi.ts"; +import { ChatMessageType } from "src/api/chatApi.ts"; +import { WarningTwoTone } from "@ant-design/icons"; +import { cdlOrange050, cdlOrange500 } from "src/cuix/variables.ts"; +import { useGetLlmModels } from "src/api/modelsApi.ts"; const SourceNodes = ({ data }: { data: ChatMessageType }) => { + const { data: inferenceModels } = useGetLlmModels(); + const nodes = data.source_nodes.map((node) => ( )); + + const modelName = () => { + if (!data.inference_model) { + return "the model"; + } + const model = inferenceModels + ?.filter((model) => model.model_id === data.inference_model) + .pop(); + return model?.name ?? "the model"; + }; + + if (nodes.length === 0) { + return ( + + + + This answer is provided directly by{" "} + + {modelName()} + {" "} + and does not reference the Knowledge Base. + + + ); + } return ( {nodes} diff --git a/ui/src/pages/RagChatTab/ChatOutput/Sources/sourceCard.css b/ui/src/pages/RagChatTab/ChatOutput/Sources/sourceCard.css new file mode 100644 index 00000000..b2e4605a --- /dev/null +++ b/ui/src/pages/RagChatTab/ChatOutput/Sources/sourceCard.css @@ -0,0 +1,53 @@ +/* + * CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP) + * (C) Cloudera, Inc. 2024 + * All rights reserved. + * + * Applicable Open Source License: Apache 2.0 + * + * NOTE: Cloudera open source products are modular software products + * made up of hundreds of individual components, each of which was + * individually copyrighted. Each Cloudera open source product is a + * collective work under U.S. Copyright Law. Your license to use the + * collective work is as provided in your written agreement with + * Cloudera. Used apart from the collective work, this file is + * licensed for your use pursuant to the open source license + * identified above. + * + * This code is provided to you pursuant a written agreement with + * (i) Cloudera, Inc. or (ii) a third-party authorized to distribute + * this code. If you do not have a written agreement with Cloudera nor + * with an authorized and properly licensed third party, you do not + * have any rights to access nor to use this code. + * + * Absent a written agreement with Cloudera, Inc. ("Cloudera") to the + * contrary, A) CLOUDERA PROVIDES THIS CODE TO YOU WITHOUT WARRANTIES OF ANY + * KIND; (B) CLOUDERA DISCLAIMS ANY AND ALL EXPRESS AND IMPLIED + * WARRANTIES WITH RESPECT TO THIS CODE, INCLUDING BUT NOT LIMITED TO + * IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE; (C) CLOUDERA IS NOT LIABLE TO YOU, + * AND WILL NOT DEFEND, INDEMNIFY, NOR HOLD YOU HARMLESS FOR ANY CLAIMS + * ARISING FROM OR RELATED TO THE CODE; AND (D)WITH RESPECT TO YOUR EXERCISE + * OF ANY RIGHTS GRANTED TO YOU FOR THE CODE, CLOUDERA IS NOT LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR + * CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, DAMAGES + * RELATED TO LOST REVENUE, LOST PROFITS, LOSS OF INCOME, LOSS OF + * BUSINESS ADVANTAGE OR UNAVAILABILITY, OR LOSS OR CORRUPTION OF + * DATA. + */ + +.styled-markdown table { + border: 1px solid #838b92; + border-collapse: collapse; +} +.styled-markdown table td { + border: 1px solid #838b92; + padding: 4px; +} +.styled-markdown table th { + padding: 4px; + border: 1px solid #838b92; +} +.styled-markdown table thead { + border-bottom: 2px solid #838b92; +} \ No newline at end of file