django-spire 0.20.3__py3-none-any.whl → 0.21.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 (33) hide show
  1. django_spire/ai/chat/intelligence/decoders/intent_decoder.py +49 -0
  2. django_spire/ai/chat/intelligence/workflows/chat_workflow.py +19 -53
  3. django_spire/ai/chat/message_intel.py +15 -7
  4. django_spire/ai/chat/models.py +6 -5
  5. django_spire/ai/chat/router.py +105 -0
  6. django_spire/ai/chat/templates/django_spire/ai/chat/message/message.html +2 -2
  7. django_spire/ai/chat/tests/test_router/test_base_chat_router.py +110 -0
  8. django_spire/ai/chat/tests/test_router/test_chat_workflow.py +113 -0
  9. django_spire/ai/chat/tests/test_router/test_integration.py +147 -0
  10. django_spire/ai/chat/tests/test_router/test_intent_decoder.py +141 -0
  11. django_spire/ai/chat/tests/test_router/test_message_intel.py +67 -0
  12. django_spire/ai/chat/tests/test_router/test_spire_chat_router.py +92 -0
  13. django_spire/ai/chat/tests/test_urls/test_json_urls.py +1 -1
  14. django_spire/ai/chat/views/message_request_views.py +5 -3
  15. django_spire/ai/chat/views/message_response_views.py +2 -2
  16. django_spire/ai/sms/intelligence/workflows/sms_conversation_workflow.py +8 -8
  17. django_spire/ai/sms/models.py +1 -1
  18. django_spire/ai/tests/test_ai.py +1 -1
  19. django_spire/consts.py +1 -1
  20. django_spire/core/static/django_spire/js/theme.js +22 -0
  21. django_spire/knowledge/collection/seeding/seeder.py +2 -2
  22. django_spire/knowledge/entry/seeding/seeder.py +10 -5
  23. django_spire/knowledge/intelligence/decoders/entry_decoder.py +4 -1
  24. django_spire/knowledge/intelligence/intel/message_intel.py +1 -1
  25. django_spire/knowledge/intelligence/router.py +26 -0
  26. django_spire/knowledge/intelligence/workflows/knowledge_workflow.py +4 -3
  27. django_spire/settings.py +13 -6
  28. {django_spire-0.20.3.dist-info → django_spire-0.21.0.dist-info}/METADATA +1 -1
  29. {django_spire-0.20.3.dist-info → django_spire-0.21.0.dist-info}/RECORD +32 -24
  30. django_spire/ai/chat/intelligence/decoders/tools.py +0 -34
  31. {django_spire-0.20.3.dist-info → django_spire-0.21.0.dist-info}/WHEEL +0 -0
  32. {django_spire-0.20.3.dist-info → django_spire-0.21.0.dist-info}/licenses/LICENSE.md +0 -0
  33. {django_spire-0.20.3.dist-info → django_spire-0.21.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,26 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from django_spire.ai.chat.router import BaseChatRouter
6
+ from django_spire.knowledge.intelligence.workflows.knowledge_workflow import knowledge_search_workflow
7
+
8
+ if TYPE_CHECKING:
9
+ from dandy.llm.request.message import MessageHistory
10
+ from django.core.handlers.wsgi import WSGIRequest
11
+
12
+ from django_spire.ai.chat.message_intel import BaseMessageIntel
13
+
14
+
15
+ class KnowledgeSearchRouter(BaseChatRouter):
16
+ def workflow(
17
+ self,
18
+ request: WSGIRequest,
19
+ user_input: str,
20
+ message_history: MessageHistory | None = None
21
+ ) -> BaseMessageIntel:
22
+ return knowledge_search_workflow(
23
+ request=request,
24
+ user_input=user_input,
25
+ message_history=message_history
26
+ )
@@ -15,15 +15,16 @@ if TYPE_CHECKING:
15
15
  from django.core.handlers.wsgi import WSGIRequest
16
16
  from dandy.llm.request.message import MessageHistory
17
17
 
18
+
18
19
  NO_KNOWLEDGE_MESSAGE_INTEL = DefaultMessageIntel(
19
20
  text='Sorry, I could not find any information on that.'
20
21
  )
21
22
 
22
23
 
23
24
  def knowledge_search_workflow(
24
- request: WSGIRequest,
25
- user_input: str,
26
- message_history: MessageHistory,
25
+ request: WSGIRequest,
26
+ user_input: str,
27
+ message_history: MessageHistory | None = None,
27
28
  ) -> BaseMessageIntel | None:
28
29
  collection_decoder = get_collection_decoder()
29
30
  collections = collection_decoder.process(user_input).values
django_spire/settings.py CHANGED
@@ -5,13 +5,20 @@ DJANGO_SPIRE_AUTH_CONTROLLERS = {
5
5
  }
6
6
 
7
7
  # AI Settings
8
- AI_PERSONA_NAME = 'AI Assistant'
9
- AI_CHAT_CALLABLE = None
10
- AI_CHAT_DEFAULT_CALLABLE = None
11
- AI_SMS_CONVERSATION_DEFAULT_CALLABLE = None
8
+ DJANGO_SPIRE_AI_PERSONA_NAME = 'AI Assistant'
9
+ DJANGO_SPIRE_AI_DEFAULT_CHAT_ROUTER = 'SPIRE'
12
10
 
13
- ORGANIZATION_NAME = 'No Organization Provided'
14
- ORGANIZATION_DESCRIPTION = 'No Description Provided'
11
+ DJANGO_SPIRE_AI_CHAT_ROUTERS = {
12
+ 'SPIRE': 'django_spire.ai.chat.router.SpireChatRouter',
13
+ }
14
+
15
+ DJANGO_SPIRE_AI_INTENT_CHAT_ROUTERS = {
16
+ 'KNOWLEDGE_SEARCH': {
17
+ 'INTENT_DESCRIPTION': 'The user is asking about information in the knowledge base.',
18
+ 'REQUIRED_PERMISSION': 'django_spire_knowledge.view_collection',
19
+ 'CHAT_ROUTER': 'django_spire.knowledge.intelligence.router.KnowledgeSearchRouter',
20
+ },
21
+ }
15
22
 
16
23
  # Theme Settings
17
24
  DJANGO_SPIRE_DEFAULT_THEME = 'default-light'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-spire
3
- Version: 0.20.3
3
+ Version: 0.21.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.
@@ -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=mYYUa0o4UzderI1zTwJJ7vbGKz77PDNmsO-cG9cqKc8,171
3
+ django_spire/consts.py,sha256=TCG9nz1swPo3cWfSwE1_lA2D8L4Wz4xH63GGZ32jB7M,171
4
4
  django_spire/exceptions.py,sha256=L5ndRO5ftMmh0pHkO2z_NG3LSGZviJ-dDHNT73SzTNw,48
5
- django_spire/settings.py,sha256=5gzQCMKAHcBYFREPrYLkQcqFj5gSSgyduUU1H2ztWN8,685
5
+ django_spire/settings.py,sha256=g6GVznY_k9vuBnOdJfcI0yDEMBzg9FKiSllSwXrgGM4,972
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
@@ -16,18 +16,19 @@ django_spire/ai/chat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
16
16
  django_spire/ai/chat/admin.py,sha256=PGTQFFH5Fc9tBdKXNFITO4Ca9S7z7ma8vzWSTEKDwxM,1533
17
17
  django_spire/ai/chat/apps.py,sha256=UQIVzvw8Ax21_SPkeqRmXvLLd0gv6n9IWiygeyrcelw,646
18
18
  django_spire/ai/chat/choices.py,sha256=_ogoONrHdDmeJWBSnlDJL2Dwhh7b0skWHTHE5TDktzA,203
19
- django_spire/ai/chat/message_intel.py,sha256=DQ3m1FYFUVCumv63njPE2hLD8W9bRdxNRkUif_zjB00,1046
20
- django_spire/ai/chat/models.py,sha256=oEIAIh-etdICXK4N_vJoCBoswjZL0qGRe57TAWZt-1Q,4767
19
+ django_spire/ai/chat/message_intel.py,sha256=CF7czj8gpwiaDrkoijLbkoWU9TzD3xtq_Znm0scDeug,1345
20
+ django_spire/ai/chat/models.py,sha256=ib8SrsBKV0BeTb0sK3HyNiwJhrOZXDThKc8kcKWdw6I,4821
21
21
  django_spire/ai/chat/querysets.py,sha256=MZW9FHGRsriX1jmhOK5ZwOUmu4Xr-sONLTOXQF_tAFI,965
22
22
  django_spire/ai/chat/responses.py,sha256=Hmb2xLdcuqJi4BK19fE1ZPIJu0vJjgqg-KQKQng5aW8,2460
23
+ django_spire/ai/chat/router.py,sha256=uK6L3RDNqDPuO7ZOkjBcS6jlZEHPZSOOhs2tGFz_yGY,3397
23
24
  django_spire/ai/chat/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
25
  django_spire/ai/chat/auth/controller.py,sha256=l4xHQxSlPgS_QPvofsARUOMcXzVo3cTMs2twXb9hlRk,273
25
26
  django_spire/ai/chat/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
27
  django_spire/ai/chat/intelligence/prompts.py,sha256=jnFaN7EUUQM-wxloWJZ2UAGw1RDXIOKkX4JfvT6ukxw,686
27
28
  django_spire/ai/chat/intelligence/decoders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- django_spire/ai/chat/intelligence/decoders/tools.py,sha256=pC3Rvg0a1bgi0ESAsDH2HDJQTsu9aCcTslXfp4R7HwQ,1233
29
+ django_spire/ai/chat/intelligence/decoders/intent_decoder.py,sha256=eW5QJ3pU6JL_pVcWni-_8UjcBqgH76ZsStxEhMlZS-w,1611
29
30
  django_spire/ai/chat/intelligence/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- django_spire/ai/chat/intelligence/workflows/chat_workflow.py,sha256=VaaIqN2U5C1opyQXyJevDs9fDtfwn7gVm5-EZDju1EI,2475
31
+ django_spire/ai/chat/intelligence/workflows/chat_workflow.py,sha256=6dahRe-5wGe6ARno0Su4q2VEc-3BZeE3M-ULaf_QuQU,1198
31
32
  django_spire/ai/chat/migrations/0001_initial.py,sha256=1cbREhX3_fNsbfumJoKAZ8w91Kq5NeXUn_iI45B7oGE,2632
32
33
  django_spire/ai/chat/migrations/0002_remove_chatmessage_content_chatmessage__content_and_more.py,sha256=KeNT7VRFmwA74odh9wxIE1Cr4KAO4Tmtqu0FuI2AmK0,752
33
34
  django_spire/ai/chat/migrations/0003_rename__content_chatmessage__intel_data_and_more.py,sha256=wAcJ6Ia3fWrGbqnVrqD2C3-3ijAot0LK-B3KZavoY_A,754
@@ -38,7 +39,7 @@ django_spire/ai/chat/templates/django_spire/ai/chat/dropdown/ellipsis_dropdown.h
38
39
  django_spire/ai/chat/templates/django_spire/ai/chat/element/recent_chat_select_element.html,sha256=NgKGSjbcoCVezdDvvd3aTnpLPgE7oCEsRkHXGxTLn9c,4838
39
40
  django_spire/ai/chat/templates/django_spire/ai/chat/message/default_message.html,sha256=6MT6O9jpkl8DCNKywZYa3YpRvxgQWhlmVJAu4NO70aU,143
40
41
  django_spire/ai/chat/templates/django_spire/ai/chat/message/loading_response_message.html,sha256=m3vcYC_tl7OYzbsguJWs8C6jPiJBKVsojginN4cSBkc,1845
41
- django_spire/ai/chat/templates/django_spire/ai/chat/message/message.html,sha256=hIvM1S2ds_9eAss5gZmb672YzS6XrJoC1Ig7xgiinlw,1938
42
+ django_spire/ai/chat/templates/django_spire/ai/chat/message/message.html,sha256=vgl3DykmUHzwDaRt18qhuLHP0X_AIRd5n0Dc5T0FQP0,1936
42
43
  django_spire/ai/chat/templates/django_spire/ai/chat/message/request_message.html,sha256=NwGYA_SgJEzAqhW8CgnXP9yEbOHEdonbJ_GIEI2s4c8,526
43
44
  django_spire/ai/chat/templates/django_spire/ai/chat/message/response_message.html,sha256=NZDDVY1nYxvyplQobO3gW6i-sevPZd8pXSIsNacF9Yw,525
44
45
  django_spire/ai/chat/templates/django_spire/ai/chat/page/chat_page.html,sha256=atgCFgXIAIVKnD6oEFzIF7MiUFTrS7GwN8klKRdB7LE,957
@@ -47,9 +48,15 @@ django_spire/ai/chat/templates/django_spire/ai/chat/widget/dialog_widget.html,sh
47
48
  django_spire/ai/chat/templates/django_spire/ai/chat/widget/recent_chat_list_widget.html,sha256=pbn8yyVL2i0ugyS84cmNX-nrr1K-oOAQiHnsjlQ_wYc,132
48
49
  django_spire/ai/chat/templates/django_spire/ai/chat/widget/selection_widget.html,sha256=Fa5Ja2i7J4rL5hU53b90RKPjFFyDpGujqOp5LpnyfCU,1617
49
50
  django_spire/ai/chat/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
+ django_spire/ai/chat/tests/test_router/test_base_chat_router.py,sha256=SgC4S7Ijm_1Mq2lb8r6gO3BUssc1V7mE6wCGuVxrFYQ,3624
52
+ django_spire/ai/chat/tests/test_router/test_chat_workflow.py,sha256=DWKcNhoWMYZ3vrsOcOfS_KjCTXbTxBQmuJ0jRggQCGU,4297
53
+ django_spire/ai/chat/tests/test_router/test_integration.py,sha256=C8yCr5bNvN4mRtwkyXlhQaeMUpZ7XZwwcmkIUWL5u1g,5753
54
+ django_spire/ai/chat/tests/test_router/test_intent_decoder.py,sha256=bC7CjY0UXnd-UZ1K-jlcnmMOBUK35LCytVOvP6sa96w,4935
55
+ django_spire/ai/chat/tests/test_router/test_message_intel.py,sha256=1oH0PTEjvnEzZkwrqb6uBoQvfSkPF1XzAxJNY-KytfA,2276
56
+ django_spire/ai/chat/tests/test_router/test_spire_chat_router.py,sha256=08P_-maBxV6zbRFZoiruvpp7xvfqRlrx3jec9tcLK2s,3518
50
57
  django_spire/ai/chat/tests/test_urls/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
58
  django_spire/ai/chat/tests/test_urls/factories.py,sha256=HgZAzsNtFPF1twA6PCP8btRL3-ib6GfE2dr8Mktoy5c,327
52
- django_spire/ai/chat/tests/test_urls/test_json_urls.py,sha256=4P_zBs8qY1aZaeSTVFnf-1wpSoo7CYUT6HO-Ic4dk6o,693
59
+ django_spire/ai/chat/tests/test_urls/test_json_urls.py,sha256=SJEQdx4eOeLjRc4dYr4AIPRVQ4-1AbubKW_ozkdBDo8,684
53
60
  django_spire/ai/chat/urls/__init__.py,sha256=TXgZcobB7VRHtMJFismwsIkXH1iRBOjsA0JXzCXs37w,446
54
61
  django_spire/ai/chat/urls/json_urls.py,sha256=atO7QOJxSIS6If65G2md6ZhUqsOYkMyTp2aG9ZLG9VE,351
55
62
  django_spire/ai/chat/urls/message_request_urls.py,sha256=0nmG2lMSUK0TGJPAfq6tKEih8yet8lPRt6zD8fOQGGU,214
@@ -60,8 +67,8 @@ django_spire/ai/chat/urls/template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
60
67
  django_spire/ai/chat/urls/template/template_urls.py,sha256=gq44AmAgYcxdzSM_ilIqgCVAKs9lwysDX51lEwkZprc,461
61
68
  django_spire/ai/chat/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
69
  django_spire/ai/chat/views/json_views.py,sha256=G6YojdOhzWbJhetgAxTflFfj9MGnqHqwA-SGktqNFNw,1569
63
- django_spire/ai/chat/views/message_request_views.py,sha256=k6GX81w6OFapt8CdHOiCtH-F8EXHUXjw841uCsMtG64,2261
64
- django_spire/ai/chat/views/message_response_views.py,sha256=HpsIAIzCPUL29p4gCl7FnYdN5QadUGJDpGJwYgg_drE,1380
70
+ django_spire/ai/chat/views/message_request_views.py,sha256=SM009kmLrzmdCi2txMP5jqQebEuUL8dYW9ZS8mmMZ0U,2346
71
+ django_spire/ai/chat/views/message_response_views.py,sha256=566mmznpSzfs2mYW-8L2PhrrqgnYdDVTbrRSR_FUweE,1421
65
72
  django_spire/ai/chat/views/message_views.py,sha256=8_valLgpJVKdN3LTSTdKRh3PbU_4H18yVWB1xveHJLw,872
66
73
  django_spire/ai/chat/views/page_views.py,sha256=hbNLKWDiAvHQ2JP__RB9fvxrL0NSGK7OZttEfxWskz8,831
67
74
  django_spire/ai/chat/views/template/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -106,20 +113,20 @@ django_spire/ai/sms/admin.py,sha256=mdB4HSqD_pNWVuVEktdGCr9poHhpwPeU6H2qMG1N0kk,
106
113
  django_spire/ai/sms/apps.py,sha256=sRi4UI1reoWPlFtvrpkkhprgafNl-DptWWH5iPsmdEM,414
107
114
  django_spire/ai/sms/decorators.py,sha256=ZnhfaHd2XkdOHFmt9RPl4dcBznNJmR4er8NqH7ESRNM,836
108
115
  django_spire/ai/sms/intel.py,sha256=VM_YbXjNx6XPM1hqoejzD73iO6fDm62D-su-i_Biy_Q,107
109
- django_spire/ai/sms/models.py,sha256=gfImD1BVg7xwlAy3WC98DF-NvSJMfcrw6lfmZH7cdP0,3376
116
+ django_spire/ai/sms/models.py,sha256=Ve6sNb7MVKuxQTpkNL06xnkN5v5cFPbjNEZeMErwbMQ,3376
110
117
  django_spire/ai/sms/querysets.py,sha256=VLFtHQtybwVuGCDT_AXrCQtiwnYyBNnDsZMfqJWbFV8,545
111
118
  django_spire/ai/sms/urls.py,sha256=v_ePAgj0GzqFpWUBq1UV4jYxIfWVgohqw-gcJ1WhO9U,200
112
119
  django_spire/ai/sms/views.py,sha256=o4sH1Qq4iMuWfTmWZblrGvh_j3328cqSaTi9wy7xin0,1631
113
120
  django_spire/ai/sms/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
121
  django_spire/ai/sms/intelligence/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
- django_spire/ai/sms/intelligence/workflows/sms_conversation_workflow.py,sha256=Bx_IBof2mMU7W9geTr0Tkc2vt0pai2P7jUkC4zilA5U,814
122
+ django_spire/ai/sms/intelligence/workflows/sms_conversation_workflow.py,sha256=MzkXRqvM5q01S6DjcltSomdIFQFU26xSqykvL0MUV4w,806
116
123
  django_spire/ai/sms/migrations/0001_initial.py,sha256=G1sverIO5VeYGX1gXGd7adsN1IMotkKL3Qo_qbO4Wdo,2780
117
124
  django_spire/ai/sms/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
125
  django_spire/ai/sms/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
126
  django_spire/ai/sms/tests/test_sms.py,sha256=l1-sT6rfiagX_nSycNf3QSwd6s1kIC8jc4UcAzRqJj8,1070
120
127
  django_spire/ai/sms/tests/test_webhook.py,sha256=EV9OO8DGHjzmHRv3C2P7m7ca6bKz3TsvDHh29kCqrzs,1284
121
128
  django_spire/ai/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
- django_spire/ai/tests/test_ai.py,sha256=HOYz-nmCWTjy8DQ8l71rP2G4T1flrf9uGCuMlbbczbo,935
129
+ django_spire/ai/tests/test_ai.py,sha256=Jr38wExt2ccf4Dh-7nZ1bHLTf2awxhzU5fMG9W_5sV4,923
123
130
  django_spire/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
124
131
  django_spire/auth/apps.py,sha256=lyDwlwNe-_i2073kkPHGNiHpOF1n91BK43dpOBijs88,441
125
132
  django_spire/auth/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -572,7 +579,7 @@ django_spire/core/static/django_spire/js/cookie.js,sha256=N9ifDzqmJHRDwYI2Lqia1y
572
579
  django_spire/core/static/django_spire/js/dropdown.js,sha256=cSvzdsct8-45gIWZlO5MzmbW2vDuxJVttLZjOBl14GE,934
573
580
  django_spire/core/static/django_spire/js/modal.js,sha256=ay0Sovi0HhedEz3dRhB_INhkh1PEJ7zPc5POYo_Wwg0,370
574
581
  django_spire/core/static/django_spire/js/session_controller.js,sha256=aMom087y00MUhdxrZlrg89f88mBC7cWEhGWopeb5hlQ,232
575
- django_spire/core/static/django_spire/js/theme.js,sha256=APZnTjuhgXV7m1vVlmvNIMZACJ0gG8uGeiyWSmhZTmQ,8512
582
+ django_spire/core/static/django_spire/js/theme.js,sha256=Aq3KOJarjCr_Qjn0HyJlEFG0FWW1C948ppVvWxW554o,9606
576
583
  django_spire/core/static/django_spire/js/ui.js,sha256=Xrnw6cMmddCiUKC7iAJn1U7lk3nMJYxFJJO-J5zCqSw,673
577
584
  django_spire/core/tags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
578
585
  django_spire/core/tags/mixins.py,sha256=ibnPcLmdB0js8ha4M93CqRv5kOQ7fijKBCLoxM9F7C0,1979
@@ -814,7 +821,7 @@ django_spire/knowledge/collection/models.py,sha256=_wqLIzOHwvsVxdc-GjEZeXWKo_MOH
814
821
  django_spire/knowledge/collection/querysets.py,sha256=8DWTGvo4WovXQ9n7XRLoxtyDdBUka2N-kcPUnJVOhOo,2479
815
822
  django_spire/knowledge/collection/seeding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
816
823
  django_spire/knowledge/collection/seeding/seed.py,sha256=i4VEvScJvZ1SUV9ukKZp0qdh_owyLyVSHGgl8vIzhwQ,303
817
- django_spire/knowledge/collection/seeding/seeder.py,sha256=l8qDxIPYMlc8hntpVtb3BpvlPXr3XLemxOdnl8B16fo,1531
824
+ django_spire/knowledge/collection/seeding/seeder.py,sha256=Zgrl-S0iAwK6LU2pMmRIdr87kAvrPtQ7GLJlONUSBlM,1523
818
825
  django_spire/knowledge/collection/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
819
826
  django_spire/knowledge/collection/services/factory_service.py,sha256=92DLZODSRPF-iA9r3Jgys2GzbC39KssGEk9eOJ5wZjs,1298
820
827
  django_spire/knowledge/collection/services/ordering_service.py,sha256=vTkSdt1lVT4VxSK3GhZibj8FPDDy5butwPkVzqmm07g,1243
@@ -845,7 +852,7 @@ django_spire/knowledge/entry/models.py,sha256=RSWXFLWAPZ43klgZvqXEzYl39g4hNIUPmX
845
852
  django_spire/knowledge/entry/querysets.py,sha256=oVTylFT_Zx0elT5IVbYZRa0FwyGd9YaRz0vdcumfrsU,1121
846
853
  django_spire/knowledge/entry/seeding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
847
854
  django_spire/knowledge/entry/seeding/seed.py,sha256=n7ereq118GuqV1luNih7nuVpkrZpkBgPWt0FuE4Bl88,105
848
- django_spire/knowledge/entry/seeding/seeder.py,sha256=m5X9iqa9UnbtvmjFdtPsx2dcFA1Q0se4ZF2nps6oaNE,1955
855
+ django_spire/knowledge/entry/seeding/seeder.py,sha256=AqClwSzrFYWU59VsbUMJiN1Dh4P6Dvax-M3gqhoZoQM,2069
849
856
  django_spire/knowledge/entry/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
850
857
  django_spire/knowledge/entry/services/automation_service.py,sha256=0_Ypk5cXhGvkQLkmKBArFTrE_sZhXCnBencmuJeLxMI,1826
851
858
  django_spire/knowledge/entry/services/factory_service.py,sha256=bgUEHjdc9u2mxUJFy26qYOxUiJRHmhtcoH6AG3xzU0I,1379
@@ -930,17 +937,18 @@ django_spire/knowledge/entry/views/json_views.py,sha256=UqfKcJZ908y2UmKBBF0PoQj1
930
937
  django_spire/knowledge/entry/views/page_views.py,sha256=piqmMm7WXuaiy-shGXfcP3bAcJN8oh3Y4MxfBzFiK70,819
931
938
  django_spire/knowledge/entry/views/template_views.py,sha256=Y-3JnslI_hj4WesN8dJbpImhUZSSjxpWErqV5aL9ecI,1188
932
939
  django_spire/knowledge/intelligence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
940
+ django_spire/knowledge/intelligence/router.py,sha256=4nPcIJJPHtwGgBXrLZiZaSNrfHDADrE5wCznvQOOm2s,802
933
941
  django_spire/knowledge/intelligence/bots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
934
942
  django_spire/knowledge/intelligence/bots/entry_search_llm_bot.py,sha256=02fRELEyRjqRc1o_McQPWucQOTQtpIO6_v8-3OO7mLs,1689
935
943
  django_spire/knowledge/intelligence/decoders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
936
944
  django_spire/knowledge/intelligence/decoders/collection_decoder.py,sha256=Vqh-JQukPatbxvV3NMWKvl8Np3bgRtDxQZjd2T3E0Rc,599
937
- django_spire/knowledge/intelligence/decoders/entry_decoder.py,sha256=q6RzbCz0Ph00wJ9p8Ujp-2hYwppeRZa8Pj_-0YDwYlI,516
945
+ django_spire/knowledge/intelligence/decoders/entry_decoder.py,sha256=cyywWGDlXmEeq050AEcAc4II0ItwBp8HFM1aQXfGAl4,572
938
946
  django_spire/knowledge/intelligence/intel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
939
947
  django_spire/knowledge/intelligence/intel/collection_intel.py,sha256=4ci6_bVUimj_33FZgQ7wCpESXrKBMxHGF0yyfrstmvI,144
940
948
  django_spire/knowledge/intelligence/intel/entry_intel.py,sha256=lGlGqeruV5oOu0aArGA_Bxa1pqAI7lr1MD7UATAy2Sg,445
941
- django_spire/knowledge/intelligence/intel/message_intel.py,sha256=yLTlFZ3dRJU800yOtp3Tme3TZdmi8pf02gbo6uZlUps,420
949
+ django_spire/knowledge/intelligence/intel/message_intel.py,sha256=iYXdOkS1KfP3QH3-KsTSJ_BspRh1vPw-zG7uJMNOWf8,419
942
950
  django_spire/knowledge/intelligence/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
943
- django_spire/knowledge/intelligence/workflows/knowledge_workflow.py,sha256=s_KXlpYSwG89slEItbEA9pEPiH8DyAmRQ-VpZEP36Ns,1894
951
+ django_spire/knowledge/intelligence/workflows/knowledge_workflow.py,sha256=6NjF9-ErMaEqa69C2GUAmv2h7IdbHTTLoiza-Wewgd4,1897
944
952
  django_spire/knowledge/migrations/0001_initial.py,sha256=0oAx4e0Tu1wbcMwQZ4I_B2X_EGdEA9Qz_UBdVNGc3yE,5487
945
953
  django_spire/knowledge/migrations/0002_alter_entryversionblock_type.py,sha256=Eg8tLjDO0nJ3go_jgVvoqwYKFOpYUUyNtZtLI2V3IQQ,527
946
954
  django_spire/knowledge/migrations/0003_alter_collection_order_alter_entry_order_and_more.py,sha256=nIIUg1lHQ1iLbPlOulwZgzHrP1erGMYVXDaEdDXv4ik,749
@@ -1143,8 +1151,8 @@ django_spire/theme/urls/page_urls.py,sha256=S8nkKkgbhG3XHI3uMUL-piOjXIrRkuY2UlM_
1143
1151
  django_spire/theme/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1144
1152
  django_spire/theme/views/json_views.py,sha256=W1khC2K_EMbEzAFmMxC_P76_MFnkRH4-eVdodrRfAhw,1904
1145
1153
  django_spire/theme/views/page_views.py,sha256=pHr8iekjtR99xs7w1taj35HEo133Svq1dvDD0y0VL1c,3933
1146
- django_spire-0.20.3.dist-info/licenses/LICENSE.md,sha256=tlTbOtgKoy-xAQpUk9gPeh9O4oRXCOzoWdW3jJz0wnA,1091
1147
- django_spire-0.20.3.dist-info/METADATA,sha256=T_ep3Ot_z22dxlznx_fMgn22xFzMjxUXtRETiMK1J1Y,4967
1148
- django_spire-0.20.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1149
- django_spire-0.20.3.dist-info/top_level.txt,sha256=xf3QV1e--ONkVpgMDQE9iqjQ1Vg4--_6C8wmO-KxPHQ,13
1150
- django_spire-0.20.3.dist-info/RECORD,,
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,,
@@ -1,34 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Callable, TYPE_CHECKING
4
-
5
- from dandy import Decoder
6
-
7
- from django_spire.auth.controller.controller import AppAuthController
8
- from django_spire.conf import settings
9
- from django_spire.core.utils import get_callable_from_module_string_and_validate_arguments
10
- from django_spire.knowledge.intelligence.workflows.knowledge_workflow import knowledge_search_workflow
11
-
12
- if TYPE_CHECKING:
13
- from django.core.handlers.wsgi import WSGIRequest
14
-
15
-
16
- def generate_intent_decoder(
17
- request: WSGIRequest,
18
- default_callable: Callable | None = None
19
- ) -> Decoder:
20
- intent_dict = {}
21
-
22
- if AppAuthController(app_name='knowledge', request=request).can_view():
23
- intent_dict['The user is looking for information or knowledge on something.'] = knowledge_search_workflow
24
-
25
- if settings.AI_CHAT_DEFAULT_CALLABLE is not None:
26
- intent_dict['None of the above choices match the user\'s intent'] = get_callable_from_module_string_and_validate_arguments(
27
- settings.AI_CHAT_DEFAULT_CALLABLE,
28
- ['request', 'user_input', 'message_history']
29
- )
30
-
31
- return Decoder(
32
- mapping_keys_description='Intent of the User\'s Request',
33
- mapping=intent_dict
34
- )