django-spire 0.21.0__py3-none-any.whl → 0.22.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. django_spire/ai/chat/templates/django_spire/ai/chat/element/recent_chat_select_element.html +1 -1
  2. django_spire/ai/chat/templates/django_spire/ai/chat/widget/selection_widget.html +1 -1
  3. django_spire/consts.py +1 -1
  4. django_spire/core/static/django_spire/css/app-navigation.css +4 -4
  5. django_spire/core/static/django_spire/css/app-side-panel.css +0 -45
  6. django_spire/core/{tags → tag}/intelligence/tag_set_bot.py +5 -4
  7. django_spire/core/tag/mixins.py +23 -0
  8. django_spire/core/{tags → tag}/models.py +1 -1
  9. django_spire/core/tag/service/tag_service.py +72 -0
  10. django_spire/core/{tags → tag}/tests/test_intelligence.py +1 -1
  11. django_spire/core/tag/tests/test_tags.py +102 -0
  12. django_spire/core/tag/tools.py +66 -0
  13. django_spire/core/templates/django_spire/navigation/top_navigation.html +42 -38
  14. django_spire/core/templates/django_spire/page/full_page.html +69 -47
  15. django_spire/core/templates/django_spire/tag/element/tag.html +1 -0
  16. django_spire/core/templatetags/spire_core_tags.py +12 -0
  17. django_spire/knowledge/collection/models.py +2 -2
  18. django_spire/knowledge/collection/services/tag_service.py +16 -14
  19. django_spire/knowledge/entry/models.py +2 -2
  20. django_spire/knowledge/entry/querysets.py +5 -0
  21. django_spire/knowledge/entry/services/tag_service.py +5 -5
  22. django_spire/knowledge/intelligence/bots/entries_search_llm_bot.py +44 -0
  23. django_spire/knowledge/intelligence/intel/entry_intel.py +24 -4
  24. django_spire/knowledge/intelligence/workflows/knowledge_workflow.py +46 -25
  25. django_spire/knowledge/templates/django_spire/knowledge/collection/page/display_page.html +6 -4
  26. django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/editor_page.html +3 -2
  27. django_spire/knowledge/templates/django_spire/knowledge/message/knowledge_message_intel.html +14 -6
  28. django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/item/entry_sub_navigation_item.html +1 -0
  29. django_spire/settings.py +1 -1
  30. {django_spire-0.21.0.dist-info → django_spire-0.22.0.dist-info}/METADATA +2 -2
  31. {django_spire-0.21.0.dist-info → django_spire-0.22.0.dist-info}/RECORD +39 -41
  32. django_spire/core/tags/mixins.py +0 -61
  33. django_spire/core/tags/tests/test_tags.py +0 -102
  34. django_spire/core/tags/tools.py +0 -20
  35. django_spire/knowledge/intelligence/bots/entry_search_llm_bot.py +0 -45
  36. django_spire/knowledge/intelligence/decoders/collection_decoder.py +0 -19
  37. django_spire/knowledge/intelligence/decoders/entry_decoder.py +0 -22
  38. django_spire/knowledge/intelligence/intel/collection_intel.py +0 -8
  39. django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/form_page.html +0 -26
  40. /django_spire/core/{tags → tag}/__init__.py +0 -0
  41. /django_spire/core/{tags → tag}/intelligence/__init__.py +0 -0
  42. /django_spire/core/{tags → tag}/querysets.py +0 -0
  43. /django_spire/core/{tags/tests → tag/service}/__init__.py +0 -0
  44. /django_spire/{knowledge/intelligence/decoders → core/tag/tests}/__init__.py +0 -0
  45. {django_spire-0.21.0.dist-info → django_spire-0.22.0.dist-info}/WHEEL +0 -0
  46. {django_spire-0.21.0.dist-info → django_spire-0.22.0.dist-info}/licenses/LICENSE.md +0 -0
  47. {django_spire-0.21.0.dist-info → django_spire-0.22.0.dist-info}/top_level.txt +0 -0
@@ -7,6 +7,7 @@
7
7
  {% if AuthController.knowledge.can_view %}
8
8
  :href="'{% url "django_spire:knowledge:entry:version:page:editor" pk=0 %}'.replace(0, entry.version_id)"
9
9
  {% endif %}
10
+ data-closes-nav
10
11
  >
11
12
  <i class="bi bi-file-earmark-text flex-shrink-0"></i>
12
13
  <span class="text-truncate ms-1" x-text="entry.name"></span>
django_spire/settings.py CHANGED
@@ -14,7 +14,7 @@ DJANGO_SPIRE_AI_CHAT_ROUTERS = {
14
14
 
15
15
  DJANGO_SPIRE_AI_INTENT_CHAT_ROUTERS = {
16
16
  'KNOWLEDGE_SEARCH': {
17
- 'INTENT_DESCRIPTION': 'The user is asking about information in the knowledge base.',
17
+ 'INTENT_DESCRIPTION': 'The user is asking about information, help or support that could be found in knowledge base.',
18
18
  'REQUIRED_PERMISSION': 'django_spire_knowledge.view_collection',
19
19
  'CHAT_ROUTER': 'django_spire.knowledge.intelligence.router.KnowledgeSearchRouter',
20
20
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-spire
3
- Version: 0.21.0
3
+ Version: 0.22.0
4
4
  Summary: A project for Django Spire
5
5
  Author-email: Brayden Carlson <braydenc@stratusadv.com>, Nathan Johnson <nathanj@stratusadv.com>
6
6
  License: Copyright (c) 2024 Stratus Advanced Technologies and Contributors.
@@ -49,7 +49,7 @@ Requires-Dist: beautifulsoup4>=4.14.2
49
49
  Requires-Dist: boto3>=1.34.0
50
50
  Requires-Dist: botocore>=1.34.0
51
51
  Requires-Dist: crispy-bootstrap5==2024.10
52
- Requires-Dist: dandy>=1.3.3
52
+ Requires-Dist: dandy>=1.3.5
53
53
  Requires-Dist: django>=5.1.8
54
54
  Requires-Dist: django-crispy-forms==2.3
55
55
  Requires-Dist: django-glue>=0.8.1
@@ -1,8 +1,8 @@
1
1
  django_spire/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  django_spire/conf.py,sha256=c5Hs-7lk9T15254tOasiQ2ZTFLQIVJof9_QJDfm1PAI,933
3
- django_spire/consts.py,sha256=TCG9nz1swPo3cWfSwE1_lA2D8L4Wz4xH63GGZ32jB7M,171
3
+ django_spire/consts.py,sha256=TSGO2fhA5NvrhZi9txx5DGQlgsO1tZDXIoDfg7qdtqY,171
4
4
  django_spire/exceptions.py,sha256=L5ndRO5ftMmh0pHkO2z_NG3LSGZviJ-dDHNT73SzTNw,48
5
- django_spire/settings.py,sha256=g6GVznY_k9vuBnOdJfcI0yDEMBzg9FKiSllSwXrgGM4,972
5
+ django_spire/settings.py,sha256=B4GPqBGt_dmkt0Ay0j-IP-SZ6mY44m2Ap5kVSON5YLA,1005
6
6
  django_spire/urls.py,sha256=mKeZszb5U4iIGqddMb5Tt5fRC72U2wABEOi6mvOfEBU,656
7
7
  django_spire/utils.py,sha256=kW0HP1xWj8Oz0h1GWs4NflnD8Jq8_F4hABwKTiT-Iyk,1006
8
8
  django_spire/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -36,7 +36,7 @@ django_spire/ai/chat/migrations/0004_chatmessage_response_type_chatmessage_sende
36
36
  django_spire/ai/chat/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  django_spire/ai/chat/templates/django_spire/ai/chat/card/chat_card.html,sha256=65wbyinYxqOlAqISkgLoykcwv_dD2X4z0K-r9RQnP0g,309
38
38
  django_spire/ai/chat/templates/django_spire/ai/chat/dropdown/ellipsis_dropdown.html,sha256=fiWuRkqcf8_oOVt5mRvsyKHhevAKM0hzbjhCdrZHZUU,736
39
- django_spire/ai/chat/templates/django_spire/ai/chat/element/recent_chat_select_element.html,sha256=NgKGSjbcoCVezdDvvd3aTnpLPgE7oCEsRkHXGxTLn9c,4838
39
+ django_spire/ai/chat/templates/django_spire/ai/chat/element/recent_chat_select_element.html,sha256=7P6rYxkTsiOv9y409Up62Ct3ab8nwycckMkXR_sKDKM,4854
40
40
  django_spire/ai/chat/templates/django_spire/ai/chat/message/default_message.html,sha256=6MT6O9jpkl8DCNKywZYa3YpRvxgQWhlmVJAu4NO70aU,143
41
41
  django_spire/ai/chat/templates/django_spire/ai/chat/message/loading_response_message.html,sha256=m3vcYC_tl7OYzbsguJWs8C6jPiJBKVsojginN4cSBkc,1845
42
42
  django_spire/ai/chat/templates/django_spire/ai/chat/message/message.html,sha256=vgl3DykmUHzwDaRt18qhuLHP0X_AIRd5n0Dc5T0FQP0,1936
@@ -46,7 +46,7 @@ django_spire/ai/chat/templates/django_spire/ai/chat/page/chat_page.html,sha256=a
46
46
  django_spire/ai/chat/templates/django_spire/ai/chat/section/confirm_delete_section.html,sha256=yJr-zmu4CV7REGnHa2uA_MqgqiftSz-r2bb7U0_5CIY,720
47
47
  django_spire/ai/chat/templates/django_spire/ai/chat/widget/dialog_widget.html,sha256=-TwiNUfwh81JHjSLPmE-WLM8FR0FxPM9jeL0IZwztlI,5306
48
48
  django_spire/ai/chat/templates/django_spire/ai/chat/widget/recent_chat_list_widget.html,sha256=pbn8yyVL2i0ugyS84cmNX-nrr1K-oOAQiHnsjlQ_wYc,132
49
- django_spire/ai/chat/templates/django_spire/ai/chat/widget/selection_widget.html,sha256=Fa5Ja2i7J4rL5hU53b90RKPjFFyDpGujqOp5LpnyfCU,1617
49
+ django_spire/ai/chat/templates/django_spire/ai/chat/widget/selection_widget.html,sha256=TTYHwPpa6gyZA7zNAwrzpUd5JdSOOH76L3GpEes9UQA,1633
50
50
  django_spire/ai/chat/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  django_spire/ai/chat/tests/test_router/test_base_chat_router.py,sha256=SgC4S7Ijm_1Mq2lb8r6gO3BUssc1V7mE6wCGuVxrFYQ,3624
52
52
  django_spire/ai/chat/tests/test_router/test_chat_workflow.py,sha256=DWKcNhoWMYZ3vrsOcOfS_KjCTXbTxBQmuJ0jRggQCGU,4297
@@ -512,11 +512,11 @@ django_spire/core/static/django_spire/css/app-button.css,sha256=iUPOFgXp2v_gsNBe
512
512
  django_spire/core/static/django_spire/css/app-default.css,sha256=RLVP_vLlkNx_UpNmMmgO73R3UUB_h3sVHt8I2z_iPVk,315
513
513
  django_spire/core/static/django_spire/css/app-import.css,sha256=HMoCBzxpPXvOqxj_BOo_yqtYvODFouRbKqs4Wgg_rOU,418
514
514
  django_spire/core/static/django_spire/css/app-layout.css,sha256=Wwnbf3tJ3khvTAC2DgzXPtgfR3rWyfMzQ1wljCNsOLo,458
515
- django_spire/core/static/django_spire/css/app-navigation.css,sha256=_yQ7JCIOoHyOhfpTkj8Q07ma0dFvOMHXTHetnT8-27I,2587
515
+ django_spire/core/static/django_spire/css/app-navigation.css,sha256=G4P2FR2PU3DDI4oEtvS7TQPbDwRAJdCevwPEvoyVx3c,2504
516
516
  django_spire/core/static/django_spire/css/app-offcanvas.css,sha256=SxDsONE1eqERJ1gDAP8chjoJ0aD0Q1VHBPqRWJi8-Mw,178
517
517
  django_spire/core/static/django_spire/css/app-override.css,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
518
518
  django_spire/core/static/django_spire/css/app-page.css,sha256=pB-sSZc9NEUkkMcCfzzrCfeiggGmhONn8Eid5HLs8c0,363
519
- django_spire/core/static/django_spire/css/app-side-panel.css,sha256=ltggQkEc9tswJ9g2M0qzmWprdzycvizrS0YgY2We2U0,1954
519
+ django_spire/core/static/django_spire/css/app-side-panel.css,sha256=tZUwmC_yK9ZNnoF-I1y6Nx-EtL445K8-CqBbWUcAi1M,1083
520
520
  django_spire/core/static/django_spire/css/app-template.css,sha256=D5ORspwfokNqRW0HwyCbzjBp2Kf_2XtWKa6FSQuSXOg,485
521
521
  django_spire/core/static/django_spire/css/app-text.css,sha256=YQYhTsXux7vVuZhzsyHV5TuPCpKam8F14GiOnMcGOyk,10141
522
522
  django_spire/core/static/django_spire/css/app-theme.css,sha256=6vxu-tNDS4i1wWwLxdkCuiucN_ZKzGqwZmqZ8Vcwzk0,421
@@ -581,16 +581,18 @@ django_spire/core/static/django_spire/js/modal.js,sha256=ay0Sovi0HhedEz3dRhB_INh
581
581
  django_spire/core/static/django_spire/js/session_controller.js,sha256=aMom087y00MUhdxrZlrg89f88mBC7cWEhGWopeb5hlQ,232
582
582
  django_spire/core/static/django_spire/js/theme.js,sha256=Aq3KOJarjCr_Qjn0HyJlEFG0FWW1C948ppVvWxW554o,9606
583
583
  django_spire/core/static/django_spire/js/ui.js,sha256=Xrnw6cMmddCiUKC7iAJn1U7lk3nMJYxFJJO-J5zCqSw,673
584
- django_spire/core/tags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
585
- django_spire/core/tags/mixins.py,sha256=ibnPcLmdB0js8ha4M93CqRv5kOQ7fijKBCLoxM9F7C0,1979
586
- django_spire/core/tags/models.py,sha256=zKXITkpyYNe80-CmJh46qw0YqxbJM79ud2wpgznmZH4,819
587
- django_spire/core/tags/querysets.py,sha256=vLdAV9KRTn-B9G9vhB4tQ3j-iNyz6OVZR5E9nVvAZY8,263
588
- django_spire/core/tags/tools.py,sha256=CB8vOlFSmk8Q79x-5OGYXCGx-VteTgDAPUCVOYaTmhU,787
589
- django_spire/core/tags/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
590
- django_spire/core/tags/intelligence/tag_set_bot.py,sha256=-U-dkyodua48F6xatV1XHzeTTO-Zukl6rYOLMLxdIig,1289
591
- django_spire/core/tags/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
592
- django_spire/core/tags/tests/test_intelligence.py,sha256=UJj9OL_RaZQZ0tVih1VjntB9K5UkTg__VwE7iOr3Kog,1074
593
- django_spire/core/tags/tests/test_tags.py,sha256=dTf0hkbgmnGK4HjdKO21dOdZLuZ2qqgeatsQvqqNeEg,3516
584
+ django_spire/core/tag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
585
+ django_spire/core/tag/mixins.py,sha256=jbBlg-ycTUE7SX1j08iRE2cu8_9j6dp5eI2uzeoYC7Y,707
586
+ django_spire/core/tag/models.py,sha256=50z8sVEollHQoedHxDyjcfy6PiJ3C5A6CKZEum7Qhfw,818
587
+ django_spire/core/tag/querysets.py,sha256=vLdAV9KRTn-B9G9vhB4tQ3j-iNyz6OVZR5E9nVvAZY8,263
588
+ django_spire/core/tag/tools.py,sha256=SyYRrYhjwu-TFnUeHRq82J21n5aVe8Wwy-iO5GGvvd8,2142
589
+ django_spire/core/tag/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
590
+ django_spire/core/tag/intelligence/tag_set_bot.py,sha256=1kIZjt3NB52z1HMOocuGZn0LCng0zuqwmw1tzycxua8,1345
591
+ django_spire/core/tag/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
592
+ django_spire/core/tag/service/tag_service.py,sha256=R_YUQsSYn4kDhKjfeOvoGUQalPwsJoBe2H5186-cA-k,2534
593
+ django_spire/core/tag/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
594
+ django_spire/core/tag/tests/test_intelligence.py,sha256=qYRecu9qfRgiSdZbcuHPgCZrX_V_oC8CMoi6aiuwRTg,1073
595
+ django_spire/core/tag/tests/test_tags.py,sha256=kLpu41VQhM2fYDNR1ce-uiTMNYGcovwNho7H-Wo-Tks,3827
594
596
  django_spire/core/templates/django_spire/403.html,sha256=35OX-3z-Yi6Igx9DTAcxNwWiZ17wXdm4wYGML4U2pns,37
595
597
  django_spire/core/templates/django_spire/404.html,sha256=91sTr518M2YxQ8X3GlzDsNP6IVo3MW07tbHdcLBL8Iw,235
596
598
  django_spire/core/templates/django_spire/500.html,sha256=8N-aqCoafjq2mFcjLZv-BkAEqRh2bzJ2SqojlboS8g4,247
@@ -672,7 +674,7 @@ django_spire/core/templates/django_spire/modal/element/model_close_element.html,
672
674
  django_spire/core/templates/django_spire/navigation/mobile_navigation.html,sha256=btXoeLihu3jd_7XzKrZiwaBgffDiLoDorMSxhYrnhc4,997
673
675
  django_spire/core/templates/django_spire/navigation/navigation_links.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
674
676
  django_spire/core/templates/django_spire/navigation/side_navigation.html,sha256=qiI4LMRx45JhCco22jYdXAvDy4L8BQcaXj56FgeRYOk,2285
675
- django_spire/core/templates/django_spire/navigation/top_navigation.html,sha256=A_wYyv6Nlx4PGztppZnp7Y6a-5zvpPC2gHYV-OmHL4Q,3786
677
+ django_spire/core/templates/django_spire/navigation/top_navigation.html,sha256=TzIBqa-1McH2HWIi7Yp8hEvT8MmznnbWZoEigXVUBwQ,4116
676
678
  django_spire/core/templates/django_spire/navigation/accordion/nav_accordion.html,sha256=etJNDg2Hal_16A7qBrqRjuQ3KKtfeGY_KpjFOyUubcQ,1246
677
679
  django_spire/core/templates/django_spire/navigation/accordion/settings_nav_accordion.html,sha256=5jy4VBU199bG_-WPmWVhe5bZYWsm03bzZC6XqGK2XFM,794
678
680
  django_spire/core/templates/django_spire/navigation/elements/nav_link.html,sha256=HwDO3oTgsW1W9w0l0LWgIbT1ulPd96croKpLEvrGPpA,153
@@ -684,19 +686,20 @@ django_spire/core/templates/django_spire/page/center_card_page.html,sha256=CqUtX
684
686
  django_spire/core/templates/django_spire/page/delete_confirmation_form_page.html,sha256=kmAA2eeD-5s3oAdS-HdFwbqHnzPlqihqh5JwxMJIP_o,168
685
687
  django_spire/core/templates/django_spire/page/delete_form_page.html,sha256=0ZYlWgl3eVq2OTbu_C0UiHVfSIbj2gg_iJ7xeafHVu4,240
686
688
  django_spire/core/templates/django_spire/page/form_full_page.html,sha256=5yp3EfOC2LlcTc0PYQ5MLuQvuw1QFPsMtnPvRdP0A2g,299
687
- django_spire/core/templates/django_spire/page/full_page.html,sha256=s2N2wIs_w5_mh0_t-gMP-qgZQJL1rhJEHRB3vdgrj3o,11646
689
+ django_spire/core/templates/django_spire/page/full_page.html,sha256=HijZKeAlEwXVA2andd8A6RMpSTvaZ3aC6FVGDwSTJyc,12182
688
690
  django_spire/core/templates/django_spire/page/page.html,sha256=D6qoyoo3E0_Qu8qov6c2YaYbJQ-LnZnCLKHb5bN0sOs,397
689
691
  django_spire/core/templates/django_spire/speech/speech_recognition.html,sha256=0SiRq9L4wFPFl_c8WnwflsYFfQ2wVUPi7aklEPdZPjQ,805
690
692
  django_spire/core/templates/django_spire/speech/speech_synthesis.html,sha256=25HetXDLzVWxC8hBnIuVbNXfvGxfaYvtZUPPtN0fkQY,805
691
693
  django_spire/core/templates/django_spire/tab/tab.html,sha256=1zSIX0Xk337VV9Qa4tvoSJlhoT2LDTfEfCwJvESNG-Q,1964
692
694
  django_spire/core/templates/django_spire/tab/element/tab_section_element.html,sha256=tEo0ENKhss74ll8HcFE9_kml35vusAfiMQHpudh3aEc,181
693
695
  django_spire/core/templates/django_spire/tab/element/tab_trigger_element.html,sha256=9VmMhfEGa3ARHerwyXojtQWyIkUj9sOPGhckcQR3h6k,442
696
+ django_spire/core/templates/django_spire/tag/element/tag.html,sha256=Zx2HyGd-A01SrfohjHhPGjYrJj3h0xH0BUNFDD5BH_4,131
694
697
  django_spire/core/templates/django_spire/wizard/wizard.html,sha256=iPkdo5O9mh3IQnhFijP9ZQXOaJDzhHGLmZo2Y49QnJ4,2266
695
698
  django_spire/core/templates/django_spire/wizard/wizard_page.html,sha256=emW5W2z_mkGERsbw3A9tFJoUOwhxa4Efr8thtZ_gHkI,75
696
699
  django_spire/core/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
697
700
  django_spire/core/templatetags/json.py,sha256=2XY8hQZrJOSmGMblL8bLRYD9hvUSQvhYaSJvwGaKzwU,280
698
701
  django_spire/core/templatetags/message.py,sha256=y70pMv1ddttJ41c11O1S7h7v8h_gTtJVdXe67J4Ld3g,491
699
- django_spire/core/templatetags/spire_core_tags.py,sha256=_IN6HWrscCKJ8LjDRe47y5g1kvBgDAQ7tNAuD5SiuEY,4247
702
+ django_spire/core/templatetags/spire_core_tags.py,sha256=V1pRiEo9fOh938dpxTRcjuIh3ukxIYNGnrmE59r-Cg4,4575
700
703
  django_spire/core/templatetags/string_formating.py,sha256=pE5ID0-cvOKfmbAIixVXEW3LN8_XLEF_OlpztHkiILk,444
701
704
  django_spire/core/templatetags/variable_types.py,sha256=LFk9NO-LKBTBnXu04jLJ_miOKyuO-KAvqaBM8jwzg7s,686
702
705
  django_spire/core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -817,7 +820,7 @@ django_spire/knowledge/auth/controller.py,sha256=ktTJ7gjtbYmCYESZnK97q7_fPojTASc
817
820
  django_spire/knowledge/collection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
818
821
  django_spire/knowledge/collection/admin.py,sha256=9OKEgiSDiSHX6ZwB11l6mCx-jdF4VKfOe-SwFBdjKK4,1370
819
822
  django_spire/knowledge/collection/forms.py,sha256=7JovVxNzE67hSydDa-1JGK4U4zPyzOj605QyEl0JkP8,238
820
- django_spire/knowledge/collection/models.py,sha256=_wqLIzOHwvsVxdc-GjEZeXWKo_MOHF7DyaHCEPuaCwM,2390
823
+ django_spire/knowledge/collection/models.py,sha256=69ol2B-ytH6mJ48afFywPhENQNnM37gAsX-Grjim-g4,2387
821
824
  django_spire/knowledge/collection/querysets.py,sha256=8DWTGvo4WovXQ9n7XRLoxtyDdBUka2N-kcPUnJVOhOo,2479
822
825
  django_spire/knowledge/collection/seeding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
823
826
  django_spire/knowledge/collection/seeding/seed.py,sha256=i4VEvScJvZ1SUV9ukKZp0qdh_owyLyVSHGgl8vIzhwQ,303
@@ -827,7 +830,7 @@ django_spire/knowledge/collection/services/factory_service.py,sha256=92DLZODSRPF
827
830
  django_spire/knowledge/collection/services/ordering_service.py,sha256=vTkSdt1lVT4VxSK3GhZibj8FPDDy5butwPkVzqmm07g,1243
828
831
  django_spire/knowledge/collection/services/processor_service.py,sha256=3ArKBndoL3HEvH_1EBqfiw7AnbFYZ0WmBgcPV8BHdLQ,911
829
832
  django_spire/knowledge/collection/services/service.py,sha256=sEamdqRcKdNcL6yz18hok0jww3Z4VRCPWrMF2QLvKGE,1830
830
- django_spire/knowledge/collection/services/tag_service.py,sha256=7EUIoTn70oAvcsX53RvKMLTZ_sySmBNgWhBvg8RCesE,1430
833
+ django_spire/knowledge/collection/services/tag_service.py,sha256=o1HnL0-du0XCGIl_8nMGMgW9AzEQE-AWbGOoBN_cQb0,1774
831
834
  django_spire/knowledge/collection/services/transformation_service.py,sha256=ME_jYURSG7at4oujTbcRzIVXyKnb75Xi6M4Nclbw6Yo,3464
832
835
  django_spire/knowledge/collection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
833
836
  django_spire/knowledge/collection/tests/factories.py,sha256=NUu4OliEZIQL9c05RPIPdzYP3Dtn1szLZxP4Wl-kX2w,429
@@ -848,8 +851,8 @@ django_spire/knowledge/collection/views/page_views.py,sha256=jiKsIqi9pvSY5KbLLGD
848
851
  django_spire/knowledge/entry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
849
852
  django_spire/knowledge/entry/admin.py,sha256=pY-0sYx24Su0y7sb1I2-GMCZxFEZj9oXhRckEdHNKno,1568
850
853
  django_spire/knowledge/entry/forms.py,sha256=Mhol37dMJP-pnex5IPxQVdchYcFBXnGzcWoY0SkU7lo,339
851
- django_spire/knowledge/entry/models.py,sha256=RSWXFLWAPZ43klgZvqXEzYl39g4hNIUPmX7btOrzbGk,2141
852
- django_spire/knowledge/entry/querysets.py,sha256=oVTylFT_Zx0elT5IVbYZRa0FwyGd9YaRz0vdcumfrsU,1121
854
+ django_spire/knowledge/entry/models.py,sha256=S7UV7UbWJZMyw_Tj2Y5IAJ3ShBbFp-H7i-E2Ll74IdE,2138
855
+ django_spire/knowledge/entry/querysets.py,sha256=uD7eoxGvyzTdom55xrwBzGoS7bs3dGVixioQhvM_hs8,1284
853
856
  django_spire/knowledge/entry/seeding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
854
857
  django_spire/knowledge/entry/seeding/seed.py,sha256=n7ereq118GuqV1luNih7nuVpkrZpkBgPWt0FuE4Bl88,105
855
858
  django_spire/knowledge/entry/seeding/seeder.py,sha256=AqClwSzrFYWU59VsbUMJiN1Dh4P6Dvax-M3gqhoZoQM,2069
@@ -858,7 +861,7 @@ django_spire/knowledge/entry/services/automation_service.py,sha256=0_Ypk5cXhGvkQ
858
861
  django_spire/knowledge/entry/services/factory_service.py,sha256=bgUEHjdc9u2mxUJFy26qYOxUiJRHmhtcoH6AG3xzU0I,1379
859
862
  django_spire/knowledge/entry/services/processor_service.py,sha256=sfAM5ku7Td4k0jCe2szyoR72Bt1_OS75UKh7YPL4l2s,494
860
863
  django_spire/knowledge/entry/services/service.py,sha256=-A8_UcmQ8aLvkRNzGzTMA4faN9UWOd5pdlFlujB1YHI,1912
861
- django_spire/knowledge/entry/services/tag_service.py,sha256=AA4xDmofhuFOxa6HuKqlM9_SY-kjPWLKAnPUhvA7Is4,793
864
+ django_spire/knowledge/entry/services/tag_service.py,sha256=y5iYeWD4yi3aL4V8bbDIMvzVzqmcaqFSl5tQx5KlJtQ,792
862
865
  django_spire/knowledge/entry/services/tool_service.py,sha256=QL6w8t284LfSOJrQaF46uWInd4t413WYxcXCWsat_jE,1083
863
866
  django_spire/knowledge/entry/services/transformation_services.py,sha256=6WPQxW-_XATi8HCwshtJjoYbQFJcIdCqFaADHnTyk1U,2687
864
867
  django_spire/knowledge/entry/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -939,16 +942,12 @@ django_spire/knowledge/entry/views/template_views.py,sha256=Y-3JnslI_hj4WesN8dJb
939
942
  django_spire/knowledge/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
940
943
  django_spire/knowledge/intelligence/router.py,sha256=4nPcIJJPHtwGgBXrLZiZaSNrfHDADrE5wCznvQOOm2s,802
941
944
  django_spire/knowledge/intelligence/bots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
942
- django_spire/knowledge/intelligence/bots/entry_search_llm_bot.py,sha256=02fRELEyRjqRc1o_McQPWucQOTQtpIO6_v8-3OO7mLs,1689
943
- django_spire/knowledge/intelligence/decoders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
944
- django_spire/knowledge/intelligence/decoders/collection_decoder.py,sha256=Vqh-JQukPatbxvV3NMWKvl8Np3bgRtDxQZjd2T3E0Rc,599
945
- django_spire/knowledge/intelligence/decoders/entry_decoder.py,sha256=cyywWGDlXmEeq050AEcAc4II0ItwBp8HFM1aQXfGAl4,572
945
+ django_spire/knowledge/intelligence/bots/entries_search_llm_bot.py,sha256=Pnpbu9mzEm2_vKvUNz4DIqZL_XzZx4L44LQ2vIqDPnk,1664
946
946
  django_spire/knowledge/intelligence/intel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
947
- django_spire/knowledge/intelligence/intel/collection_intel.py,sha256=4ci6_bVUimj_33FZgQ7wCpESXrKBMxHGF0yyfrstmvI,144
948
- django_spire/knowledge/intelligence/intel/entry_intel.py,sha256=lGlGqeruV5oOu0aArGA_Bxa1pqAI7lr1MD7UATAy2Sg,445
947
+ django_spire/knowledge/intelligence/intel/entry_intel.py,sha256=7B7qLqNl39VFQKq_e5m1ShhSNgN2AV2gqesKRCnXid0,844
949
948
  django_spire/knowledge/intelligence/intel/message_intel.py,sha256=iYXdOkS1KfP3QH3-KsTSJ_BspRh1vPw-zG7uJMNOWf8,419
950
949
  django_spire/knowledge/intelligence/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
951
- django_spire/knowledge/intelligence/workflows/knowledge_workflow.py,sha256=6NjF9-ErMaEqa69C2GUAmv2h7IdbHTTLoiza-Wewgd4,1897
950
+ django_spire/knowledge/intelligence/workflows/knowledge_workflow.py,sha256=55e_zFeeKBglQ73hi3d71Zc7WLUuWO5SwvFLCP5rUDg,2449
952
951
  django_spire/knowledge/migrations/0001_initial.py,sha256=0oAx4e0Tu1wbcMwQZ4I_B2X_EGdEA9Qz_UBdVNGc3yE,5487
953
952
  django_spire/knowledge/migrations/0002_alter_entryversionblock_type.py,sha256=Eg8tLjDO0nJ3go_jgVvoqwYKFOpYUUyNtZtLI2V3IQQ,527
954
953
  django_spire/knowledge/migrations/0003_alter_collection_order_alter_entry_order_and_more.py,sha256=nIIUg1lHQ1iLbPlOulwZgzHrP1erGMYVXDaEdDXv4ik,749
@@ -973,7 +972,7 @@ django_spire/knowledge/templates/django_spire/knowledge/collection/container/det
973
972
  django_spire/knowledge/templates/django_spire/knowledge/collection/element/ellipsis_dropdown.html,sha256=o9cceexfwUSDtac4uhlUm4LimnBQrgTP6QPkpJF6DD0,1376
974
973
  django_spire/knowledge/templates/django_spire/knowledge/collection/form/form.html,sha256=gDjvFBpNQHGn4PNJBi4pBw89-IakpyrC23D9dr0xQ-c,1902
975
974
  django_spire/knowledge/templates/django_spire/knowledge/collection/item/collection_item.html,sha256=gaOqh1wxf5IcWdxWWiYyz6HWjoPyn6FohaTMIssJ67k,517
976
- django_spire/knowledge/templates/django_spire/knowledge/collection/page/display_page.html,sha256=v6lLzrubEYzVgoTKt_Oh3xAV0agUkWmyTFtAmD5uQcg,2281
975
+ django_spire/knowledge/templates/django_spire/knowledge/collection/page/display_page.html,sha256=AzYod7og_yU_lfxWIRFC2R_ga_jwH_Cr4VE07sRlGT8,2400
977
976
  django_spire/knowledge/templates/django_spire/knowledge/collection/page/form_page.html,sha256=eD190iYnmx-6u8Y0EAExDdilPtxTlS_ic6-WBfTtj2s,274
978
977
  django_spire/knowledge/templates/django_spire/knowledge/container/container.html,sha256=Fi-PL8neKrmGeLQtvhNiGoimpen86m4r9YlAS-amWXI,1220
979
978
  django_spire/knowledge/templates/django_spire/knowledge/entry/badge/entry_status_badge.html,sha256=qz7Y2ac1T4qu0Nr_Yj4BdUbQamgA6Llq7TmoXAf5Arw,381
@@ -990,15 +989,14 @@ django_spire/knowledge/templates/django_spire/knowledge/entry/modal/publish_conf
990
989
  django_spire/knowledge/templates/django_spire/knowledge/entry/page/form_page.html,sha256=EBfDjDBvo7IR6f5joTtZjzK5LtZb4rt0U1FO1HQNt88,291
991
990
  django_spire/knowledge/templates/django_spire/knowledge/entry/page/import_form_page.html,sha256=TK8Bc7mUZwsmV1Xm9FPyWz7Hws68Ijy4c55orvNoOC4,308
992
991
  django_spire/knowledge/templates/django_spire/knowledge/entry/version/container/editor_container.html,sha256=NAtXEq8UJOV9_vp3l5HIIdQp-lZhNVW4luF0Nvv8Sl8,3389
993
- django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/editor_page.html,sha256=Q6bPXeIORGQMZ4Wb6YDsWWoMUKws6a-oGhl4mv7syUE,3019
994
- django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/form_page.html,sha256=ufUISOfNmk45hl7F-ujtAzpHdEmUxh55odW0eyL6SMU,722
995
- django_spire/knowledge/templates/django_spire/knowledge/message/knowledge_message_intel.html,sha256=fpCJAwgxYqzJPLV63mLmUFjfEFk98t4FBX0RkSvDnzQ,698
992
+ django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/editor_page.html,sha256=Gc5uYGjYJR8nwaLa0hm-5GHO3ezI9CLO0H_OLp8EvdE,3092
993
+ django_spire/knowledge/templates/django_spire/knowledge/message/knowledge_message_intel.html,sha256=sjZNgvXnOdqg068nhqo79GljR1P1XUJafExERUdBwZc,842
996
994
  django_spire/knowledge/templates/django_spire/knowledge/page/full_page.html,sha256=vz3WQ6SAL43QALRf0haaLfNkUfIQQemR0FAZQ2tznV4,1331
997
995
  django_spire/knowledge/templates/django_spire/knowledge/page/home_page.html,sha256=LMGSoPuP4N0NMX9QB1r5qJaExDvt6IKlJNp69Dt2EeQ,293
998
996
  django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/element/collection_sub_navigation_ellipsis_dropdown.html,sha256=DeM7yRcjRN25eRvdOK-3Ae0kbYaMWvk7Ufbc8AZphgk,1023
999
997
  django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/element/entry_sub_navigation_ellipsis_dropdown.html,sha256=SiwlFdvIbmcWyexxNMBO4b-mbOwqAAtPHLv8Fqr8UIs,757
1000
998
  django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/item/collection_sub_navigation_item.html,sha256=zfuT2vx5kTEDqIAN4QroBR7BWL5ifc4KRQU7dmAQmKc,1181
1001
- django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/item/entry_sub_navigation_item.html,sha256=t9YnXZT101IFF0SXyHvdIc__OclrqO17eFZDt75lnAw,856
999
+ django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/item/entry_sub_navigation_item.html,sha256=piZwe5YmWQMn9675YSzTfXEdkWdqNwTvGTvdSsIdpVE,880
1002
1000
  django_spire/knowledge/templates/django_spire/knowledge/sub_navigation/widget/collection_entry_sub_navigation_widget.html,sha256=m9dzz9rxVCb_T5dKeo1spYWKRGogTZ07snKIfau0njA,6121
1003
1001
  django_spire/knowledge/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1004
1002
  django_spire/knowledge/templatetags/spire_knowledge_tags.py,sha256=n3eHc8QZplOi9ovD8qbfzp66F91tdm6q8z1YPcnmVOM,622
@@ -1151,8 +1149,8 @@ django_spire/theme/urls/page_urls.py,sha256=S8nkKkgbhG3XHI3uMUL-piOjXIrRkuY2UlM_
1151
1149
  django_spire/theme/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1152
1150
  django_spire/theme/views/json_views.py,sha256=W1khC2K_EMbEzAFmMxC_P76_MFnkRH4-eVdodrRfAhw,1904
1153
1151
  django_spire/theme/views/page_views.py,sha256=pHr8iekjtR99xs7w1taj35HEo133Svq1dvDD0y0VL1c,3933
1154
- django_spire-0.21.0.dist-info/licenses/LICENSE.md,sha256=tlTbOtgKoy-xAQpUk9gPeh9O4oRXCOzoWdW3jJz0wnA,1091
1155
- django_spire-0.21.0.dist-info/METADATA,sha256=KmPh1hAMWgthYDDBTqPUl1hvK7BfCigChQRl6eWX8cQ,4967
1156
- django_spire-0.21.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1157
- django_spire-0.21.0.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
1158
- django_spire-0.21.0.dist-info/RECORD,,
1152
+ django_spire-0.22.0.dist-info/licenses/LICENSE.md,sha256=tlTbOtgKoy-xAQpUk9gPeh9O4oRXCOzoWdW3jJz0wnA,1091
1153
+ django_spire-0.22.0.dist-info/METADATA,sha256=jWPW3aT41-AoEvBFVxoW-pi2ppG7ccH1AxcKV3me4vk,4967
1154
+ django_spire-0.22.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1155
+ django_spire-0.22.0.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
1156
+ django_spire-0.22.0.dist-info/RECORD,,
@@ -1,61 +0,0 @@
1
- from django.db import models
2
- from django.db.models import QuerySet
3
-
4
- from django_spire.core.tags.models import Tag
5
- from django_spire.core.tags import tools
6
-
7
-
8
- class TagsModelMixin(models.Model):
9
- tags = models.ManyToManyField(Tag, related_name='+', null=True, blank=True, editable=False)
10
-
11
- class Meta:
12
- abstract = True
13
-
14
- @property
15
- def tag_set(self) -> set[str]:
16
- return set(self.tags.values_list('name', flat=True))
17
-
18
- @property
19
- def tag_set_simplified(self) -> set[str]:
20
- simplified_tag_words = []
21
-
22
- for tag in self.tag_set:
23
- tag_words = tag.split('-')
24
- simplified_tag_words.extend(tag_words)
25
-
26
- return set(simplified_tag_words)
27
-
28
- def add_tags_from_tag_set(self, tag_set: set[str]):
29
- self._update_global_tags_from_set(tag_set)
30
-
31
- self.tags.add(*Tag.objects.in_tag_set(tag_set))
32
-
33
- def clear_tags(self):
34
- self.tags.clear()
35
-
36
- def get_matching_tags_from_tag_set(self, tag_set: set[str]) -> QuerySet:
37
- return self.tags.in_tag_set(tag_set)
38
-
39
- def get_matching_percentage_of_tag_set(self, tag_set: set[str]) -> float:
40
- return tools.get_matching_a_percentage_from_tag_sets(tag_set, self.tag_set)
41
-
42
- def get_matching_percentage_of_model_tags_from_tag_set(self, tag_set: set[str]) -> float:
43
- return tools.get_matching_b_percentage_from_tag_sets(tag_set, self.tag_set)
44
-
45
- def has_tags_in_tag_set(self, tag_set: set[str]) -> bool:
46
- return self.tag_set.issuperset(tag_set)
47
-
48
- def remove_tags_by_tag_set(self, tag_set: set[str]):
49
- tag_objects = Tag.objects.in_tag_set(tag_set)
50
-
51
- self.tags.remove(*tag_objects)
52
-
53
- def set_tags_from_tag_set(self, tag_set: set[str]):
54
- self._update_global_tags_from_set(tag_set)
55
-
56
- tag_objects = Tag.objects.in_tag_set(tag_set)
57
- self.tags.set(tag_objects)
58
-
59
- @staticmethod
60
- def _update_global_tags_from_set(tag_set: set[str]):
61
- Tag.add_tags([Tag(name=tag) for tag in tag_set])
@@ -1,102 +0,0 @@
1
- from django.test import TestCase
2
-
3
- from django_spire.core.tags.models import Tag
4
- from django_spire.knowledge.collection.models import Collection
5
-
6
-
7
- class TestTags(TestCase):
8
- def setUp(self):
9
- self.collection = Collection.objects.create(
10
- name='Test Collection', description='Test Collection Description'
11
- )
12
-
13
- self.tag_set_a = {'apple', 'banana', 'orange'}
14
- self.tag_set_b = {'grape', 'kiwi', 'pear'}
15
- self.tag_set_c = {'lemon', 'lime', 'mango'}
16
-
17
- self.mixed_tag_set = {'apple', 'grape', 'lemon'}
18
-
19
- self.dirty_tag_set = {'HaT~', 'four* tacos', '123 hoop!!'}
20
-
21
- self.collection.add_tags_from_tag_set(self.tag_set_a)
22
- self.collection.add_tags_from_tag_set(self.tag_set_b)
23
- self.collection.add_tags_from_tag_set(self.tag_set_c)
24
-
25
- self.collection.add_tags_from_tag_set(self.mixed_tag_set)
26
-
27
- self.collection.add_tags_from_tag_set(self.dirty_tag_set)
28
-
29
- def test_tag_removal(self):
30
- self.assertIn('apple', self.collection.tag_set)
31
-
32
- self.collection.remove_tags_by_tag_set(self.mixed_tag_set)
33
-
34
- self.assertNotIn('lemon', self.collection.tag_set)
35
-
36
- self.assertIn('kiwi', self.collection.tag_set)
37
-
38
- def test_tag_add_and_set(self):
39
- self.collection.set_tags_from_tag_set(self.mixed_tag_set)
40
-
41
- self.assertIn('lemon', self.collection.tag_set)
42
-
43
- self.assertNotIn('banana', self.collection.tag_set)
44
-
45
- def test_tag_count(self):
46
- self.assertEqual(Tag.objects.count(), 12)
47
- self.assertEqual(self.collection.tags.count(), 12)
48
-
49
- def test_tag_removal(self):
50
- self.collection.remove_tags_by_tag_set(self.tag_set_a)
51
-
52
- self.assertEqual(self.collection.tags.count(), 9)
53
-
54
- def test_tag_bool_methods(self):
55
- self.collection.remove_tags_by_tag_set(self.tag_set_b)
56
-
57
- self.assertTrue(self.collection.has_tags_in_tag_set(self.tag_set_c))
58
- self.assertFalse(self.collection.has_tags_in_tag_set(self.mixed_tag_set))
59
-
60
- def test_tag_matching_methods(self):
61
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.tag_set_a)), 3)
62
-
63
- self.collection.remove_tags_by_tag_set(self.tag_set_a)
64
-
65
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.tag_set_a)), 0)
66
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.tag_set_b)), 3)
67
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.mixed_tag_set)), 2)
68
-
69
- self.collection.remove_tags_by_tag_set(self.tag_set_b)
70
-
71
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.tag_set_b)), 0)
72
-
73
- self.assertEqual(len(self.collection.get_matching_tags_from_tag_set(self.mixed_tag_set)), 1)
74
-
75
- def test_tag_metric_methods(self):
76
- self.assertAlmostEqual(
77
- self.collection.get_matching_percentage_of_tag_set(self.tag_set_a),
78
- 1.00,
79
- 2
80
- )
81
-
82
- self.assertAlmostEqual(
83
- self.collection.get_matching_percentage_of_model_tags_from_tag_set(self.tag_set_b),
84
- 0.25,
85
- 2
86
- )
87
-
88
- self.collection.remove_tags_by_tag_set(self.mixed_tag_set)
89
-
90
- self.assertAlmostEqual(
91
- self.collection.get_matching_percentage_of_tag_set(self.tag_set_a),
92
- 0.666,
93
- 2
94
- )
95
-
96
-
97
- self.assertAlmostEqual(
98
- self.collection.get_matching_percentage_of_model_tags_from_tag_set(self.tag_set_b),
99
- 0.222,
100
- 2
101
- )
102
-
@@ -1,20 +0,0 @@
1
- def get_matching_tag_set_from_tag_sets(tag_set_a: set[str], tag_set_b: set[str]) -> set[str]:
2
- return tag_set_a.intersection(tag_set_b)
3
-
4
-
5
- def get_matching_count_from_tag_sets(tag_set_a: set[str], tag_set_b: set[str]) -> int:
6
- return len(get_matching_tag_set_from_tag_sets(tag_set_a, tag_set_b))
7
-
8
-
9
- def get_matching_a_percentage_from_tag_sets(tag_set_a: set[str], tag_set_b: set[str]) -> float:
10
- try:
11
- return get_matching_count_from_tag_sets(tag_set_a, tag_set_b) / len(tag_set_a)
12
- except ZeroDivisionError:
13
- return 0.0
14
-
15
-
16
- def get_matching_b_percentage_from_tag_sets(tag_set_a: set[str], tag_set_b: set[str]) -> float:
17
- try:
18
- return get_matching_count_from_tag_sets(tag_set_a, tag_set_b) / len(tag_set_b)
19
- except ZeroDivisionError:
20
- return 0.0
@@ -1,45 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from dandy import Bot, Prompt
4
-
5
- from django_spire.knowledge.entry.models import Entry
6
- from django_spire.knowledge.intelligence.intel.collection_intel import CollectionIntel
7
- from django_spire.knowledge.intelligence.intel.entry_intel import EntryIntel
8
-
9
-
10
- class EntrySearchBot(Bot):
11
- llm_role = 'Knowledge Entry Search Assistant'
12
- llm_task = 'Read through the knowledge entry the information request and return information and the block id that relevant'
13
- llm_guidelines = (
14
- Prompt()
15
- .list([
16
- 'Make sure the relevant heading text is from a heading with mark down formatting.'
17
- 'When returning the relevant heading remove any of the markdown formating characters.'
18
- ])
19
- )
20
- llm_intel_class = EntryIntel
21
-
22
- def process(self, user_input: str, entry: Entry) -> EntryIntel:
23
- entry_prompt = Prompt()
24
- entry_prompt.sub_heading('Information Request')
25
- entry_prompt.line_break()
26
- entry_prompt.text(f'{user_input}')
27
- entry_prompt.line_break()
28
- entry_prompt.sub_heading(f'Knowledge Entry: {entry.name}')
29
- entry_prompt.line_break()
30
-
31
- for version_block in entry.current_version.blocks.all():
32
- entry_prompt.text(f'{version_block.id}: {version_block.render_to_text()}')
33
-
34
- entry_intel = self.llm.prompt_to_intel(
35
- prompt=entry_prompt,
36
- exclude_fields={'entry_id', 'collection_intel'},
37
- )
38
-
39
- entry_intel.entry_id = entry.id
40
- entry_intel.collection_intel = CollectionIntel(
41
- name=entry.collection.name,
42
- collection_id=entry.collection.id,
43
- )
44
-
45
- return entry_intel
@@ -1,19 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from dandy import Decoder
4
-
5
- from django_spire.knowledge.collection.models import Collection
6
-
7
-
8
- def get_collection_decoder() -> Decoder:
9
- class CollectionDecoder(Decoder):
10
- mapping_keys_description = 'Knowledge Collections Tags'
11
- mapping = {
12
- **{
13
- f'{collection.services.tag.get_aggregated_tag_set_simplified()}': collection
14
- for collection in Collection.objects.all().annotate_entry_count()
15
- },
16
- 'No Matching Knowledge Collection Tags': None,
17
- }
18
-
19
- return CollectionDecoder()
@@ -1,22 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import TYPE_CHECKING
4
-
5
- from dandy import Decoder
6
-
7
- if TYPE_CHECKING:
8
- from django_spire.knowledge.collection.models import Collection
9
-
10
-
11
- def get_entry_decoder(collection: Collection) -> Decoder:
12
- class EntryDecoder(Decoder):
13
- mapping_keys_description = 'Knowledge Entries Tags'
14
- mapping = {
15
- **{
16
- f'{entry.tag_set}': entry
17
- for entry in collection.entries.all()
18
- },
19
- 'No Matching Knowledge Entries': None
20
- }
21
-
22
- return EntryDecoder()
@@ -1,8 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from dandy import BaseIntel
4
-
5
-
6
- class CollectionIntel(BaseIntel):
7
- name: str
8
- collection_id: int = None
@@ -1,26 +0,0 @@
1
- {% extends 'django_spire/knowledge/page/full_page.html' %}
2
-
3
- {% load static %}
4
-
5
- {% block base_body_additional_top_js %}
6
- <script type="application/javascript" src="{% static 'django_spire/knowledge/entry/version/js/managers.js' %}?v={{ DJANGO_SPIRE_VERSION }}"></script>
7
- {% endblock %}
8
-
9
- {% block knowledge_full_page_content %}
10
- <style>
11
- .block {}
12
-
13
- .action-items {
14
- opacity: 0;
15
- }
16
-
17
- .block:hover .action-items {
18
- opacity: 1;
19
- }
20
- </style>
21
- <div class="row justify-content-center">
22
- <div class="col-12 col-xl-8">
23
- {% include 'django_spire/knowledge/entry/version/container/form_container.html' %}
24
- </div>
25
- </div>
26
- {% endblock %}
File without changes
File without changes